login
A071185
Smallest k such that prime(k*n)-k*prime(n) is prime.
1
7, 4, 2, 2, 2, 2, 6, 6, 4, 2, 2, 6, 2, 8, 2, 20, 4, 2, 2, 2, 6, 6, 8, 6, 6, 2, 4, 12, 2, 8, 6, 8, 2, 2, 6, 4, 2, 4, 6, 26, 24, 2, 2, 2, 4, 8, 18, 4, 2, 2, 4, 12, 4, 4, 18, 8, 6, 16, 4, 2, 2, 2, 4, 2, 2, 2, 4, 18, 6, 6, 4, 2, 4, 4, 6, 18, 2, 6, 2, 18, 4, 24, 6, 2, 6, 6, 18, 40, 2, 4, 2, 2, 18, 8, 34, 2, 2
OFFSET
1,1
LINKS
MATHEMATICA
ppn[n_]:=Module[{k=1, prn=Prime[n]}, While[!PrimeQ[Prime[k n]-k prn], k++]; k]; Array[ppn, 100] (* Harvey P. Dale, May 22 2012 *)
PROG
(PARI) for(n=1, 210, s=1; while(isprime(prime(s*n)-s*prime(n))==0, s++); print1(s, ", "))
(Python)
from sympy import isprime, prime
def a(n):
pn = prime(n); k = 1
while not isprime(prime(k*n) - k*pn): k += 1
return k
print([a(n) for n in range(1, 98)]) # Michael S. Branicky, Jul 04 2021
CROSSREFS
Sequence in context: A188628 A021578 A273093 * A373018 A165244 A198356
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Jun 10 2002
STATUS
approved