OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
If n=1, then 1*(1-1)/2=0=a(1).
If n=9, then 9*(9-1)/2=36=a(2).
etc.
MAPLE
p:= -1: Res:= NULL: count:= 0:
while count < 100 do
q:= p; p:= nextprime(p);
if p - q > 2 then
count:= count + p-q-2;
Res:= Res, seq(k*(k+1)/2, k=q+1..p-2);
fi
od:
Res; # Robert Israel, Jul 03 2018
MATHEMATICA
Reap[For[n = 1, n <= 100, n++, If[!PrimeQ[n] && !PrimeQ[n-1], Sow[n(n-1)/2] ] ] ][[2, 1]] (* Jean-François Alcover, Mar 27 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Dec 01 2008
EXTENSIONS
3570 inserted by R. J. Mathar, Dec 10 2008
STATUS
approved