Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize divisibility of substrings by java

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report