login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A177462
Smallest k such that A000125(n)+k and A000125(n)-k are both prime.
0
1, 3, 2, 3, 1, 3, 4, 21, 3, 9, 18, 5, 9, 55, 36, 5, 21, 57, 30, 9, 7, 21, 14, 33, 49, 3, 150, 39, 117, 19, 12, 11, 27, 17, 66, 27, 21, 87, 10, 75, 7, 21, 14, 33, 39, 45, 30, 47, 3, 5, 210, 49, 27, 3, 30, 63, 5, 21, 58, 69, 5, 9, 168, 153, 9, 37, 204, 23, 33, 41, 78, 21, 123, 3, 100
OFFSET
2,2
EXAMPLE
4+-1->primes. 8+-3->primes. 15+-2->primes. 26+-3->primes,..
MATHEMATICA
g[n_]:=(n+1)*(n^2-n+6)/6; f[n_]:=Block[{k}, If[OddQ[n], k=2, k=1]; While[ !PrimeQ[n-k]||!PrimeQ[n+k], k+=2]; k]; Table[f[g[n]], {n, 2, 5!}]
KEYWORD
nonn
AUTHOR
EXTENSIONS
Definition rephrased and offset adapted by R. J. Mathar, Aug 15 2010
STATUS
approved