Java algorithm example for finding the number of daffodils between 10 and 100000

This example describes the Java algorithm for finding the number of daffodils between 10 and 100000. Share with you for your reference, as follows:

Number of daffodils:

Concept: narcissus number refers to an n-digit number (n ≥ 3), and the sum of the N-power of the number on each digit is equal to itself. (for example: 1 ^ 3 + 5 ^ 3 + 3 ^ 3 = 153)

Analysis of algorithm ideas: this algorithm is divided into two steps; First, we do a function to find the number of digits of a number; Second: we call this function to calculate prime numbers between 10 and 100000!

Specific codes are given below (for reference only):

Operation results:

For more information about Java algorithms, readers who are interested can see the topics on this site: Java data structure and algorithm tutorial, summary of Java DOM node operation skills, summary of java file and directory operation skills, and summary of Java cache operation skills

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>