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 find the Prime number of a complete number by java

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

Share

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

Editor to share with you java how to complete the prime number, I hope you will learn something after reading this article, let's discuss it together!

If an n-digit is used exactly once for each number from 1 to n, we call it all-digital. For example, 2143 is a four-digit all-digit number, and it also happens to be a prime.

What is the largest prime number of all digits?

System.out.println (champernowneConstant ())

Analysis:

Calculate the numbers of each position separately, and then multiply them. BitInt indicates a number of digits, and total indicates that there are a total of several digits when I is executed. If total is exactly equal to num, the last bit of I is returned. If it is less than that, the loop continues, otherwise it means more, the excess distant is intercepted, and each extra bit I moves forward one bit (iUnix 10) until the distance distant is shortened to 0.

After reading this article, I believe you have a certain understanding of "java how to complete the prime of numbers". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

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