login
Product of next a(n) odd numbers plus 2 is prime.
3

%I #14 Sep 24 2024 09:31:37

%S 1,1,1,4,1,1,2,2,1,1,5,1,3,10,1,1,2,1,4,1,2,2,8,3,2,2,6,3,2,1,12,2,1,

%T 3,4,1,1,7,4,1,2,1,2,6,3,6,2,1,1,7,19,26,5,2,3,1,81,3,56,28,23,2,2,17,

%U 1,6,4,9,1,2,4,1,5,9,1,7,3,1,2,16,1,6,49,7,1,2,6,3,1,6,17,3,1

%N Product of next a(n) odd numbers plus 2 is prime.

%C 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.

%C 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

%H Robert Israel, <a href="/A073693/b073693.txt">Table of n, a(n) for n = 0..1263</a>

%p m:= 0: A:= NULL: P:= 1: count:= 0:

%p for i from 1 do

%p P:= P*(2*i-1);

%p if isprime(P+2) then

%p A:= A, i-m;

%p m:= i; P:= 1;

%p count:= count+1; if count = 101 then break fi;

%p fi

%p od:

%p A; # _Robert Israel_, Sep 23 2024

%t 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 *)

%o (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","))

%Y Cf. A073691, A073692.

%K nonn

%O 0,4

%A _Amarnath Murthy_, Aug 12 2002

%E Corrected and extended by _Ralf Stephan_, Mar 18 2003

%E Name clarified by _Robert Israel_, Sep 23 2024