(In reply to
By inspection... by Brian Smith)
Indeed it works for the first 35 primes as the following output shows:
list
5 for I=1 to 35
10 P=nxtprm(P)
20 print p, (!(P)-1)@P
30 next
run
2 1
3 2
5 4
7 6
11 10
13 12
17 16
19 18
23 22
29 28
31 30
37 36
41 40
43 42
47 46
53 52
59 58
61 60
67 66
71 70
73 72
79 78
83 82
89 88
97 96
101 100
103 102
107 106
109 108
113 112
127 126
131 130
137 136
139 138
149 148
OK
----------
The above is a UBASIC program, that language having the built-in nxtprm function and factorial function.
|
Posted by Charlie
on 2003-10-16 09:52:36 |