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.

A306105 Numbers with digits in {0,1,2} such that every other digit is strictly less than its neighbors.

Original entry on oeis.org

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
Offset: 1

Views

Author

M. F. Hasler, Oct 05 2018

Keywords

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.

Crossrefs

Cf. A306106 .. A306111 and A297147: analog for bases 3..9 and 10.
Cf. A000045 (Fibonacci), A000071(n) = Sum(k=0..n-2,A45(k)) = A000045(n)-1.
Cf. A032858 and A032859 .. A032865 for other bases 3..10.

Programs

  • 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}

Formula

a(n) = A007089(A032858(n)).