OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
45 is in the sequence because 45+55 (consecutive triangular numbers) = 100 = 47+53 (consecutive primes).
MAPLE
f:= proc(n) local p, q;
p:= prevprime(floor((n+1)^2/2)); q:= nextprime(p);
if p+q = (n+1)^2 then n*(n+1)/2 else NULL fi
end proc:
map(f, [$2..1000]); # Robert Israel, Jan 19 2018
PROG
(PARI) L=List(); forprime(p=2, 200000, q=nextprime(p+1); t=p+q; if(issquare(4*t, &sq) && (sq-2)%2==0, u=(sq-2)\2; listput(L, u*(u+1)/2))); Vec(L)
CROSSREFS
KEYWORD
nonn
AUTHOR
Colin Barker, Jan 19 2018
STATUS
approved