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.

A043089 Every string of 2 consecutive base-3 digits contains exactly 2 distinct numbers.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 10, 11, 15, 16, 19, 20, 21, 23, 30, 32, 33, 34, 46, 47, 48, 50, 57, 59, 60, 61, 64, 65, 69, 70, 91, 92, 96, 97, 100, 101, 102, 104, 138, 140, 141, 142, 145, 146, 150, 151, 172, 173, 177, 178, 181, 182, 183, 185, 192
Offset: 0

Views

Author

Keywords

Comments

Essentially the same as A031941. - R. J. Mathar, Oct 20 2008

Crossrefs

Cf. A031941.

Programs

  • Mathematica
    Select[Range[0,200],FreeQ[Differences[IntegerDigits[#,3]],0]&] (* Harvey P. Dale, Feb 25 2022 *)
  • PARI
    a(n, base=3) = { for (b=0, oo, if (n <= (base-1)*2^b, my (v=ceil(n/2^b), p=(n-1)%(2^b)); while (b>0, v=base*v+vecsort([(v-1)%base, (v+1)%base])[1+bittest(p,b--)];); return (v), n -= (base-1)*2^b);); } \\ Rémy Sigrist, Sep 15 2022