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!}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, May 09 2010
EXTENSIONS
Definition rephrased and offset adapted by R. J. Mathar, Aug 15 2010
STATUS
approved