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.

A251092 a(n) is the number of primes in the n-th group of consecutive primes among the odd numbers.

This page as a plain text file.
%I A251092 #41 Jun 29 2021 13:34:21
%S A251092 3,2,2,1,2,1,2,1,1,2,1,2,1,1,1,1,2,2,1,1,1,2,2,1,1,1,1,2,2,2,1,1,2,1,
%T A251092 2,1,1,1,2,1,2,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,2,1,1,1,
%U A251092 1,1,1,1,2,1,1,1,1,2,1,1,1,2,1,1,2,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1
%N A251092 a(n) is the number of primes in the n-th group of consecutive primes among the odd numbers.
%C A251092 Explanation:
%C A251092 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25,... = Odd numbers
%C A251092    ^  ^  ^      ^   ^       ^   ^       ^         = Prime numbers
%C A251092   <---3--->    <--2-->     <--2-->    <-1->       = Primes beside other primes divided into groups of how many there are.
%C A251092 Note that the first group (3, 5 and 7) is the only group of 3. Therefore the rest of the sequence only consists of 1's and 2's.
%C A251092 Essentially the same as A175632. - _Robert Israel_, Mar 29 2015
%H A251092 Harvey P. Dale, <a href="/A251092/b251092.txt">Table of n, a(n) for n = 1..1000</a>
%p A251092 N:= 1000: # to use the first N+1 odd numbers
%p A251092 L:= map(t -> isprime(2*t+1), [$1..N]):
%p A251092 Starts:= [1, op(select(i -> L[i] and not L[i-1], [$2..N]))]:
%p A251092 Ends:= select(i -> L[i] and not L[i+1], [$1..N-1]):
%p A251092 seq(Ends[i]-Starts[i]+1,i=1..nops(Ends)); # _Robert Israel_, Mar 27 2015
%t A251092 Length /@ Split[Select[2 Range@ 1200 - 1, PrimeQ], #2 - #1 == 2 &] (* _Michael De Vlieger_, Mar 20 2015 *)
%t A251092 Length/@DeleteCases[Split[Table[If[PrimeQ[n],1,0],{n,3,1001,2}]],_?(FreeQ[ #,1]&)] (* _Harvey P. Dale_, Jun 29 2021 *)
%Y A251092 Cf. A000040 (prime numbers), A005408 (odd numbers), A001097 (twin primes), A175632.
%K A251092 nonn
%O A251092 1,1
%A A251092 _Arthur Edward Chadwick_, Mar 20 2015