-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEuler_Problem-070.b93
79 lines (64 loc) · 7.06 KB
/
Euler_Problem-070.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
v00000 000 // Project Euler - Problem 70
ccc
?? ?? ??
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
######################################################################################################################################################
>55*6*:10p57*:20p*40p230p"2("*11p"}("*21p022p112p"}22 "***31p1v>030p v>g 0\v v\-1 < >g 0\v v\-1 <
vp08*8**::**::8p31p30:" " _^#`g03g04< 2 v+55:<>\1>9*\:| 2 v+55:<>\1>9*\:|
>"X"30g:10g%\10g/3+p30g>30g+:40g\` #v_$>30g1+:30p:10g%\10g/3+g" "-| 7 >%\:#^|#/+55\$< 8 >%\:#^|#/+55\$<
^p+3/g01\%g01:\" ":< ^ < >$ #\>#<>\# :#+_+^>$ #\>#<>\# :#+_vv
vg11 <^ < v -+<-
>:42p::10g%\10g/3+g"X"-#v_:1+>:52p::10g%\10g/3+g"X"-#v_42g52g*:72p31g`#v_72g22g*42g1-52g1-*:82p12g*`#v_^v_v
>$12g.@ v $< < v < <
^_^#-g12:+1 < <^_^#-g12:+1 < <p22g28p21g27<
[10] width 150 55*6*
[20] height 35 57*
[30] position 0 (initial 0)
[40] size 5250 (automatic)
[11] LOWER 2000 "2("* [CONSTANT]
[21] UPPER 5000 "}("* [CONSTANT]
[31] LIMIT 10000000 "}22 "*** [CONSTANT]
[12] Best_N
[22] Best_PHI
[42] prime[1]
[52] prime[2]
[72] n ( prime[1] * prime[2] )
[82] phi ( (prime[1]-1) * (prime[2]-1) )
---------------------------------------
The solution is practically identical to the one from [Mathblog](http://www.mathblog.dk/project-euler-70-investigate-values-of-n-for-which-%CF%86n-is-a-permutation-of-n/).
But Kristian explains it much better than I :).
We use our trustworthy [Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) snippet and the *GetCombinatoricHash*-function from problem-62
The rest was straight-forward and not really that interesting.