OFFSET
1,3
COMMENTS
As n increases, Sum_{i=1..n} a(n) tends to n*(n+1)/2.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..704
EXAMPLE
2*(2-0) - 1 = 3, which is prime, so a(1)=0;
2*3*(2*3 - 1) - 1 = 29, which is prime, so a(2)=1;
2*3*5*(2*3*5 - 2) - 1 = 839, which is prime, so a(3)=2.
PROG
(PARI) { allocatemem(932245000); default(primelimit, 4294965247); n=0; p=1; q=1; until (0, n=n+1; p=nextprime(p+1); q=q*p; for (a=0, 1000000000, r=q*(q-a)-1; if (isprime(r), print(n, " ", a); write("b145173.txt", n, " ", a); break; ); ) ) } \\ Harry J. Smith, Jan 14 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Oct 03 2008
EXTENSIONS
Corrected by several correspondents, Jan 14 2009
STATUS
approved