cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A140378 Lengths of runs of consecutive primes and nonprimes in A007775.

This page as a plain text file.
%I A140378 #8 Oct 21 2021 17:02:12
%S A140378 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 A140378 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 A140378 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 A140378 Lengths of runs of consecutive primes and nonprimes in A007775.
%C A140378 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 A140378 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 A140378 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 A140378 Cf. A136066, A132231, A132232, A132233, A039919, A132234, A132235, A132236.
%K A140378 nonn
%O A140378 1,2
%A A140378 _Juri-Stepan Gerasimov_, Jun 13 2008
%E A140378 Edited by _R. J. Mathar_, Jun 16 2008