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 calculate Spiral Primes by java

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly shows you java how to find helix primes, the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor to take you to study and learn "java how to find helix primes" this article.

By spiraling the natural numbers counterclockwise from 1, we can construct a spiral array with a side length of 7.

37 36 35 34 33 32 31

38 17 16 15 14 13 30

39 18 5 4 3 12 29

40 19 6 1 2 11 28

41 20 7 8 9 10 27

42 21 22 23 24 25 26

43 44 45 46 47 48 49

It can be found that all the odd squares are on the lower right diagonal of the spiral policy, and more interestingly, there are a total of 8 primes on all diagonals, with a proportion of 8 ≈ 13 62%.

By adding a complete layer to the outside of the square, a spiral matrix with a side length of 9 can be constructed. If this process is repeated over and over again, what is the side length of the spiral array when the ratio of primes on the diagonal is less than 10% for the first time?

What can Java be used for? Java is mainly used in: 1. Web development; 2. Android development; 3. Client development; 4. Web page development; 5. Enterprise application development; 6. Java big data development; 7. Game development and so on.

The above is about "java how to find Spiral Primes". If this article is helpful to you and you think it is well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to 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