OFFSET
0,4
COMMENTS
Group the odd numbers so that the product of the terms in each group + 2 is a prime: (1), (3), (5), (7, 9, 11, 13), (15), (17), (19, 21), (23, 25), (27), (29), ...; sequence gives the number of terms in each group.
a(n) is the least k >= 1 such that if sum_{i < n} a(i) = m, 2 + product_{m+1 <= i <=m+k} (2i-1) is prime. - Robert Israel, Sep 23 2024
LINKS
Robert Israel, Table of n, a(n) for n = 0..1263
MAPLE
m:= 0: A:= NULL: P:= 1: count:= 0:
for i from 1 do
P:= P*(2*i-1);
if isprime(P+2) then
A:= A, i-m;
m:= i; P:= 1;
count:= count+1; if count = 101 then break fi;
fi
od:
A; # Robert Israel, Sep 23 2024
MATHEMATICA
t = {}; s = 1; c = 0; Do[s = s*i; c += 1; If[PrimeQ[s + 2], AppendTo[t, c]; s = 1; c = 0], {i, 1, 1200, 2}]; t (* Jayanta Basu, Jul 07 2013 *)
PROG
(PARI) o=1:for(k=1, 100, n=1:p=o:while(!isprime(p+2), o=o+2:p=p*o:n=n+1):o=o+2:print1(n", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 12 2002
EXTENSIONS
Corrected and extended by Ralf Stephan, Mar 18 2003
Name clarified by Robert Israel, Sep 23 2024
STATUS
approved