blob: 8fe9330cd40a9172ebdb195896250561baa615b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
Task 1: "Write a script to display attractive numbers between 1 and 50.
A number is an attractive number if the number of its prime factors is
also prime number.
For example: The number 20 is an attractive number, whose prime factors
are 2, 2 and 5. The total prime factors is 3 which is also a prime number.
"
My notes: Think I have a prime-factors finder from an earlier challenge;
should be easy given that.
Task 2: "Write a script to display the first 20 Leonardo Numbers. Read
https://en.wikipedia.org/wiki/Leonardo_number for more information.
For example:
L(0) = 1
L(1) = 1
L(2) = L(0) + L(1) + 1 = 3
L(3) = L(1) + L(2) + 1 = 5
and so on.
"
My notes: sounds very nearly as simple as Fibonacci numbers.
|