login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A256252
Number of successive odd noncomposite numbers A006005 and number of successive odd composite numbers A071904, interleaved.
2
4, 1, 2, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 2, 1, 3, 1, 1, 2, 1, 2, 1, 1, 6, 1, 1, 1, 2, 2, 4, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 4, 2, 1, 2, 5, 1, 5, 1, 1, 2, 1, 1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 4, 1, 6, 1, 1, 2, 1, 1, 6, 1, 2, 1, 4, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2
OFFSET
1,1
COMMENTS
See also A256253 and A256262 which contain similar diagrams.
FORMULA
a(n) = A256253(n+1), n >= 2.
EXAMPLE
Consider an irregular array in which the odd-indexed rows list successive odd noncomposite numbers (A006005) and the even-indexed rows list successive odd composite numbers (A071904), in the sequence of odd numbers (A005408), as shown below:
1, 3, 5, 7;
9;
11, 13;
15;
17; 19;
21,
23;
25, 27;
39, 31;
...
a(n) is the length of the n-th row.
.
Illustration of the first 16 regions of the diagram of the symmetric representation of odd noncomposite numbers A006005 and odd composite numbers A071904:
. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
. |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | 31
. |_ _ _ _ _ _ _ _ _ _ _ _ _ _ | | 29
. | | |_ _ _ _ _ _ _ _ _ _ _ | | | 23
. | | | |_ _ _ _ _ _ _ _ _ | | | | 19
. | | | |_ _ _ _ _ _ _ _ | | | | | 17
. | | | | |_ _ _ _ _ _ | | | | | | 13
. | | | | |_ _ _ _ _ | | | | | | | 11
. | | | | | |_ _ _ | | | | | | | | 7
. | | | | | |_ _ | | | | | | | | | 5
. | | | | | |_ | | | | | | | | | | 3
. A071904 | | | | | |_|_|_|_| | | | | | | | 1
. 9 | | | | |_ _ _ _ _|_|_| | | | | | A006005
. 15 | | | |_ _ _ _ _ _ _ _|_|_| | | |
. 21 | | |_ _ _ _ _ _ _ _ _ _ _|_| | |
. 25 | |_ _ _ _ _ _ _ _ _ _ _ _ _| | |
. 27 |_ _ _ _ _ _ _ _ _ _ _ _ _ _|_|_|
.
a(n) is also the length of the n-th boundary segment in the zig-zag path of the above diagram, between the two types of numbers, as shown below for n = 1..9:
. _ _ _ _
. |_ _
. |_ _
. |_
. |
. |_ _
.
The sequence begins: 4,1,2,1,2,1,1,2,2,...
.
PROG
(PARI) lista(nn) = {my(nb = 1, isc = 0); forstep (n=3, nn, 2, if (bitxor(isc, isprime(n)), nb++, print1(nb, ", "); nb = 1; isc = ! isc); ); } \\ Michel Marcus, May 25 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Mar 30 2015
STATUS
approved