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
Rick L. Shepherd, Table of n, a(n) for n = 1..10000
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*/
for(n=1, 10000, write("b209355.txt", n, " ", A209355[n]))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Rick L. Shepherd, Mar 06 2012
STATUS
approved