OFFSET
0,3
COMMENTS
Essentially the same as A031941. - R. J. Mathar, Oct 20 2008
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
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
KEYWORD
nonn,base
AUTHOR
STATUS
approved