Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize divisibility of substrings by java

Shulou Source: shulou.com Published: 2022-06-01 01:04:29 10月04日 Update

Editor to share with you how java to achieve the divisibility of substrings, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

1406357289 is an all-digit number from 0 to 9 because it is made up of ten numbers 0 to 9, but in addition, it has an interesting property: divisibility of substrings.

Remember that D1 is its first number, D2 is the second number, and so on, we notice:

D2d3d4=406 is divisible by 2.

D3d4d5=063 is divisible by 3.

D4d5d6=635 is divisible by 5.

D5d6d7=357 is divisible by 7.

D6d7d8=572 is divisible by 11.

D7d8d9=728 is divisible by 13.

D8d9d10=289 is divisible by 17.

Find out all the all-digit numbers 0 to 9 that satisfy the same property and find their sum.

System.out.println (pandigitalPrime ())

Parsing:

First determine whether it is a full number, and then determine whether it is a prime number.

The above is all the content of the article "how to realize the divisibility of substrings in java". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Numbers articles all content words nature interesting and so on not much ten numbers most more knowledge primes industry information information channels other than that channels references Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Tech Info MariaDB vpn Linux