%I #8 Oct 21 2021 17:02:12
%S 1,12,1,6,1,3,1,6,2,2,1,2,1,3,1,2,1,3,1,4,2,1,2,6,1,1,1,1,1,6,2,1,2,4,
%T 3,2,2,4,1,1,1,1,1,3,1,2,2,1,1,2,1,2,1,3,1,4,2,1,1,2,2,3,2,2,4,2,2,1,
%U 1,4,2,1,1,4,1,3,2,1,1,3,1,3,2,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,1,3,2,2,2
%N Lengths of runs of consecutive primes and nonprimes in A007775.
%C Primes can be classified according to their remainder modulo 30: remainder 1 (A136066), 7 (A132231), 11 (A132232), 13 (A132233), 17 (A039949), 19 (A132234), 23 (A132235), or 29 (A132236). In the sequence A007775 of all numbers (prime or nonprime) in any of these remainder classes, we look for runs of numbers that are successively prime or nonprime and place the lengths of these runs in this sequence.
%e Groups of runs in A007775 are (1), (7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47), (49), (53, 59, 61, 67, 71, 73), (77), (79, 83,...), which is 1 nonprime followed by 12 primes followed by 1 nonprime followed by 6 primes etc.
%p A007775 := proc(n) option remember ; local a; if n = 1 then 1; else for a from A007775(n-1)+1 do if a mod 2 <>0 and a mod 3 <>0 and a mod 5 <> 0 then RETURN(a) ; fi ; od: fi ; end: A := proc() local al,isp,n; al := 0: isp := false ; n := 1: while n< 300 do a := A007775(n) ; if isprime(a) <> isp then printf("%d,",al) ; al := 1; isp := not isp ; else al := al+1 ; fi ; n := n+1: od: end: A() ; # _R. J. Mathar_, Jun 16 2008
%Y Cf. A136066, A132231, A132232, A132233, A039919, A132234, A132235, A132236.
%K nonn
%O 1,2
%A _Juri-Stepan Gerasimov_, Jun 13 2008
%E Edited by _R. J. Mathar_, Jun 16 2008
|