First, the number of daffodils
1, what is the number of daffodils?
Narcissus number refers to an n-bit positive integer (n≥3), and its number on each bit of the sum of n is equal to its own. (Example: 1^3 + 5^3+ 3^3 = 153)
2, the use of JS to achieve the number of daffodils to find.
This time we look for the number of daffodils method, is the very basic JS in the while loop. The code is as follows:
Si not si very magical ~
Second, Fibonacci sequence
1. What is the Fibonacci sequence?
Fibonacci series (Fibonacci sequence), also known as the Golden Section series, because the mathematician Leonardo's Fibonacci (Leonardoda Fibonacci) to the rabbit breeding as an example of the introduction, so called "Rabbit series", refers to such a series: 1, 1, 2, 3, 5, 8, 13, 21, 、......
2, the use of JS to achieve the Rabbit series of the top 20 list.
This is still done using the while loop, the code is as follows:
Hum, still very magical.
Tips_of_js using JS to realize the search and realization of narcissus number Fibonacci sequence