OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
2 is a term because 2*(2+1)/2 = 3 is prime,
3 is a term because 3*(3+1)/2 = (5+7)/2,
5 is a term because 5*(5+1)/2 = (13+17)/2.
MATHEMATICA
a = {2}; For[n = 1, n < 320, n++, t = n*(n + 1)/2;
If[t == (NextPrime[t] + NextPrime[t, -1])/2, AppendTo[a, n],
1]]; Print[a]; (* David Scambler, Apr 02 2012 *)
PROG
(PARI) is(n)=n*=(n+1)/2; n>1&&2*n==nextprime(n)+precprime(n) \\ Charles R Greathouse IV, Apr 04 2012
(Magma) [2] cat [n: n in [3..320] | 2*t eq PreviousPrime(t)+NextPrime(t) where t is n*(n+1) div 2]; // Bruno Berselli, Apr 04 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Mar 31 2012
EXTENSIONS
STATUS
approved