|
|
A306105
|
|
Numbers with digits in {0,1,2} such that every other digit is strictly less than its neighbors.
|
|
7
|
|
|
0, 1, 2, 10, 20, 21, 101, 102, 201, 202, 212, 1010, 1020, 1021, 2010, 2020, 2021, 2120, 2121, 10101, 10102, 10201, 10202, 10212, 20101, 20102, 20201, 20202, 20212, 21201, 21202, 21212, 101010, 101020, 101021, 102010, 102020, 102021, 102120, 102121
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Terms of A032858 written in base 3.
There are A000045(n+2) terms with n digits (where 0 is taken to have no digits), so the first term with n digits is at index A000071(n+3). See A032858 for the proof.
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(PARI) {A=[0, 1, 2]; F=[1, 1]; for(n=0, 4, F=[F[2], vecsum(F)]; for(k=1, 3, T=max(k*10, 21)*10^n; A=concat(A, apply(t->t+T, A[F[2]-1+if(k>2, F*[2, -1]~)..vecsum(F)-2])))); A}
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|