login
A245597
Smallest k > 1 such that prime(n)*k^prime(n)-1 is prime.
4
2, 2, 4, 8, 10, 56, 46, 6, 4, 102, 98, 90, 52, 12, 28, 418, 426, 482, 38, 28, 140, 26, 354, 882, 756, 268, 146, 4, 260, 76, 48, 288, 1584, 38, 1102, 2688, 464, 3500, 16, 5146, 2562, 2072, 1020, 726, 306, 1796, 38, 866, 508, 800, 3480, 132, 750, 4170
OFFSET
1,1
COMMENTS
Start:
For primes, p < 25,000, for which p*k^p-1 is a prime:
k=1: just 3;
k=2: 2, 3, 751, 12379, …, ; indices: 1, 2, 133, 1478, …, ;
k=4: 2, 3, 5, 23, 107, 1973, 20747, …, ; indices: 1, 2, 3, 9, 28, 298, 2336, …, ;
k=6: 2, 3, 19, 107, 1999, …, ; indices: 1, 2, 8, 28, 303, …, ;
k=8: 2, 7, …, ; indices: 1, 4, …, ;
k=10: 2, 3, 11, 2843, …, ; indices: 1, 2, 5, 413, …, ; etc.
End. - Robert G. Wilson v, Aug 02 2014
LINKS
EXAMPLE
2*2^2-1=7 prime so a(1)=2.
3*2^3-1=23 prime so a(2)=2.
5*2^5-1=159 composite.
5*4^5-1=5119 prime so a(3)=4.
MATHEMATICA
f[n_] := Block[{k = 2, p = Prime@ n}, While[ !PrimeQ[p*k^p - 1], k += 2]; k]; Array[f, 60] (* Robert G. Wilson v, Aug 02 2014 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM i, 0
DIM j
DIM n, -1
DIMS t
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET i, i+1
IF i>300 THEN END
SET j, p(i)
SET n, 0
LABEL loop2
SET n, n+2
SETS t, %d, %d, %d\,; i; j; n
PRP j*n^j-1, t
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
WRITE myf, t
GOTO loop1
(PARI) a(n) = k=2; while(!isprime(prime(n)*k^prime(n)-1), k+=2); k
vector(20, n, a(n)) \\ Colin Barker, Jul 27 2014
CROSSREFS
Cf. A245598.
Sequence in context: A333045 A050047 A056381 * A324039 A019463 A152763
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 27 2014
EXTENSIONS
Definition corrected by Colin Barker, Jul 27 2014
STATUS
approved