login
A245598
Smallest k > 1 such that prime(n)*k^prime(n)+1 is prime.
4
3, 4, 8, 4, 42, 60, 8, 198, 8, 54, 130, 778, 108, 178, 924, 44, 180, 706, 4, 170, 474, 30, 480, 1578, 214, 416, 34, 132, 2940, 60, 834, 666, 336, 168, 408, 216, 538, 114, 60, 266, 188, 58, 36, 1504, 4868, 2398, 430, 4, 1940, 408, 2036, 3038, 1146, 1902
OFFSET
1,1
COMMENTS
Start:
For primes, p < 25000, for which p*k^p-1 is a prime:
k=1: only the first prime, 2;
k=2: none;
k=3: only the first prime, 2;
k=4: 3, 7, 67, 223, …, ; indices: 2, 4, 19, 48, …, ;
k=6: 2, 9901, 12043, …, ; indices: 1, 1221, 1443, …, ;
k=8: 5, 17, 23, …, ; indices: 3, 7, 9, …, ;
k=9 only for the first prime, 2;
k=10: 3, 2161, …, ; indices: 2, 326, …, ; etc.
End. - Robert G. Wilson v, Aug 05 2014
LINKS
EXAMPLE
2*2^2+1=9 composite.
2*3^2+1=19 prime so a(1)=3.
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 27 2014 *)
PROG
(PFGW & SCRIPT)
SCRIPT
DIM i, 1
DIM j
DIM n
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++); k
vector(40, n, a(n)) \\ Colin Barker, Jul 30 2014
CROSSREFS
Cf. A245597.
Sequence in context: A198125 A127122 A086850 * A340533 A050274 A262951
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 27 2014
EXTENSIONS
Definition corrected by Zak Seidov, Jul 27 2014
STATUS
approved