OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(0)=2 because 2*0*(0+1)/2+2*(2+1)/2=2 is prime,
a(1)=0 because 2*1*(1+1)/2+0*(0+1)/2=2 is prime,
a(2)=1 because 2*2*(2+1)/2+1*(1+1)/2=7 is prime,
a(3)=1 because 2*3*(3+1)/2+1*(1+1)/2=13 is prime,
a(4)=2 because 2*4*(4+1)/2+2*(2+1)/2=23 is prime.
MATHEMATICA
tri[n_] := n*(n+1)/2; Table[k = 0; While[! PrimeQ[2*tri[n] + tri[k]], k++]; k, {n, 0, 83}] (* T. D. Noe, Apr 03 2012 *)
lnk[n_]:=Module[{k=0}, While[!PrimeQ[2n+(k(k+1))/2], k++]; k]; Join[{2}, lnk/@ Accumulate[ Range[80]]] (* Harvey P. Dale, Aug 28 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gerasimov Sergey, Apr 03 2012
STATUS
approved