A140378 Lengths of runs of consecutive primes and nonprimes in A007775.
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, 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, 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
Offset: 1
Keywords
Examples
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.
Programs
-
Maple
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
Extensions
Edited by R. J. Mathar, Jun 16 2008
Comments