-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEuler_Problem-021.b93
54 lines (46 loc) · 10.8 KB
/
Euler_Problem-021.b93
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
v
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
################################################################################################################################################################################################################################################################################################################################################################################################################
>v ># v# <
>"d"4*:10p55**00p00g>1-::20p0\2/:|>:20g\%#^_:30p+30g>1-:#^_$v
|: p+1/g01g02%g01g02<
v$$ p100< >1 ^
>00g1-20p090p>20g10g%20g10g/1+g40p40g10g%40g10g/1+g50p 20g50g-#v_20g40g`!#v_20g." - ",,,40g.55+,v
|p02-1:g02 < < p09++g04g02g09<
@.g09<
[0,0] 10 000
[1,0] Width (400)
[2,0] Curr Number
[3,0] Temp (short lifed)
[4,0] D(Curr Number)
[5,0] D(D(Curr Number))
[9,0] Sum Amicable
// Get Divisors (only for numbers >2 )
v ># v# <
"n"2* :20p0\1->:20g\%#^_:30p+30g>1-:#^_$@
---------------------------------------
Most of the time is here spent in the NumberOfDivisors function. So we first cache every possible result of this function (from 0 to 10000).
The rest is simple searching for numbers where a == D(D(a)) and a != D(a).