Determine all possible values of a positive integer N ≥ 3, such that
NC
2 – 1 is a
prime power.
Note:
NC
2 represents N
choose 2.
list
10 N=3:PrevN=2
20 while N>=3
30 C=N*PrevN//2-1
40 D=prmdiv(C)
50 C=C//D:Ct=1
60 while C>1
70 DNew=prmdiv(C)
80 if DNew<>D then goto *NotGood
90 C=C//D:inc Ct
100 wend
110 print N,N*PrevN//2-1,D;Ct
120 *NotGood
130 PrevN=N
140 inc N
150 wend
OK
run
3 2 2 1
4 5 5 1
5 9 3 2
8 27 3 3
Division by zero in 50
?n,c
262260 34390022669
OK
The program stopped at N = 262,260, when the combination less 1 became too big (34,390,022,669) for UBASIC to find its lowest prime divisor.
The table is interpreted:
N C(N,2)-1 equals
3 2 2^1
4 5 5^1
5 9 3^2
8 27 3^3
and no other value of N lower than 262,260 will work.
|
Posted by Charlie
on 2010-04-18 13:45:26 |