aboutsummaryrefslogtreecommitdiff
path: root/challenge-169/duncan-c-white/README
blob: de1ee5c0510f3e77364de243ed26ef759fd9df44 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
TASK 1: Brilliant Numbers

Write a script to generate first 20 Brilliant Numbers.

    Brilliant numbers are numbers with two prime factors of the same length.

The number should have exactly two prime factors, i.e. it's the product
of two primes of the same length.

For example,

24287 = 149 x 163
24289 = 107 x 227

Therefore 24287 and 24289 are 2-brilliant numbers.  These two brilliant
numbers happen to be consecutive as there are no even brilliant numbers
greater than 14.

Output

4, 6, 9, 10, 14, 15, 21, 25, 35, 49, 121, 143, 169, 187, 209, 221, 247, 253, 289, 299

MY NOTES: ok, sounds relatively easy, but I'm getting very bored of
"tasks to do with Number Theory and (especially) Primes".


Task 2: Achilles Numbers

Write a script to generate first 20 Achilles Numbers. Please checkout
wikipedia for more information.

An Achilles number is a number that is powerful but imperfect (not a
perfect power). Named after Achilles, a hero of the Trojan war, who was
also powerful but imperfect.

A positive integer n is a powerful number if, for every prime factor p
of n, p^2 is also a divisor.

A number is a perfect power if it has any integer roots (square root,
cube root, etc.).

For example 36 factors to (2, 2, 3, 3) - every prime factor (2, 3) also
has its square as a divisor (4, 9). But 36 has an integer square root,
6, so the number is a perfect power.

But 72 factors to (2, 2, 2, 3, 3); it similarly has 4 and 9 as divisors,
but it has no integer roots. This is an Achilles number.

Output

 72, 108,  200,  288,  392,  432,  500,  648,  675,  800,  864, 968, 972, 1125, 1152, 1323, 1352, 1372, 1568, 1800


MY NOTES: Ok, yet another prime variant.  I can immediately see some mileage
in pre-computing a lookup table of all perfect-powers up to N.  Perhaps N=1800
as we know the answer:-)