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

A043089
Every string of 2 consecutive base-3 digits contains exactly 2 distinct numbers.
9
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,3
COMMENTS
Essentially the same as A031941. - R. J. Mathar, Oct 20 2008
LINKS
MATHEMATICA
Select[Range[0, 200], FreeQ[Differences[IntegerDigits[#, 3]], 0]&] (* Harvey P. Dale, Feb 25 2022 *)
PROG
(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
CROSSREFS
Cf. A031941.
Sequence in context: A240101 A032892 A031941 * A088952 A303541 A293523
KEYWORD
nonn,base
STATUS
approved