login
A290838
a(n) = smallest prime p such that 2p - 2n + 1 is prime.
2
2, 2, 3, 5, 5, 7, 7, 13, 11, 11, 11, 13, 13, 19, 17, 17, 17, 19, 19, 37, 23, 23, 23, 29, 29, 31, 29, 29, 29, 31, 31, 37, 37, 41, 37, 37, 37, 43, 41, 41, 41, 43, 43, 61, 47, 47, 47, 53, 53, 67, 53, 53, 53, 59, 59, 61, 59, 59, 59, 61, 61, 67, 67, 71, 67, 67, 67, 73
OFFSET
0,1
COMMENTS
a(n) > n. - Iain Fox, Nov 13 2017
FORMULA
a(-n) = A290839(n+1) - Iain Fox, Dec 14 2017
MATHEMATICA
Table[j=0; found=False; While[!found, j++; found=PrimeQ[2Prime[j]-2n+1] && 2Prime[j]-2n+1>0]; Prime[j], {n, 67}]
(* Second program: *)
Table[SelectFirst[Prime@ Range[n^2], And[# > 0, PrimeQ@ #] &[2 # - 2 n + 1] &], {n, 67}] (* Michael De Vlieger, Aug 14 2017 *)
PROG
(PARI) a(n) = {my(p=2); while(!isprime(2*p-2*n+1), p = nextprime(p+1)); p; } \\ Michel Marcus, Aug 12 2017
(PARI) a(n) = forprime(p=n+1, , if(isprime(2*p - 2*n + 1), return(p))) \\ Iain Fox, Nov 13 2017
KEYWORD
nonn,easy
AUTHOR
XU Pingya, Aug 11 2017
EXTENSIONS
a(0) prepended by Iain Fox, Dec 14 2017
STATUS
approved