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”).

A209355
Sequence with each term appearing in runs of every length infinitely often.
2
0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0
OFFSET
1
COMMENTS
This construction is in stages for sequence range 0, 1:
Stage 1: 0, 1
Stage 2: 0, 1, 0, 0, 1, 1
Stage 3: 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, etc.,
where each stage is the previous stage (if any) followed by stage-number of zeros then stage-number of ones. The sequence is all stages read sequentially as rows. See PARI program for comments about stage lengths and cumulative lengths.
For each positive integer n each term appears in runs of length exactly n infinitely often. This sequence's construction process, which can clearly be generalized for any (finite) number of distinct terms, has A079813 as the limit of its n-th stage as n --> infinity.
LINKS
EXAMPLE
Terms a(15) through a(17) are the first run (of infinitely many such runs) of exactly three zeros.
PROG
(PARI)
/* range = vector of r >= 2 integers in desired order. */
/*(r = 0, 1 allowed but [], constant seq., resp., result)*/
/* stages_wanted >= 1 (or empty vector returned). */
/* Stage (Row) sizes for r = 2 integers in range are */
/* 2, 6, 12, 20, 30, 42, ... (A002378(stage) for each stage), */
/* producing vector v's A007290(stages_wanted+2) terms.*/
/* */
{a(range, stages_wanted) =
local(v = [], next_stage = [], stage = 0, k, m);
while(stage<stages_wanted,
stage++;
for(k=1, matsize(range)[2],
next_stage=concat(next_stage, vector(stage, m, range[k]))
); v = concat(v, next_stage);
); return(v)}
/* A209355 = a([0, 1], 6); /* 112= 2+6+12+20+30+42 terms*/
A209355 = a([0, 1], 31); /* 10912 = A007290(33)terms */
for(n=1, 10000, write("b209355.txt", n, " ", A209355[n]))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Rick L. Shepherd, Mar 06 2012
STATUS
approved