OFFSET
1,2
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..8190
Eric Weisstein's World of Mathematics, Ternary
Eric Weisstein's World of Mathematics, Repdigit
MATHEMATICA
not[n_]:=Module[{c=DigitCount[n, 3]}, c[[1]]==0||c[[2]]==0]; Select[ Range[ 250], not] (* Harvey P. Dale, Dec 15 2012 *)
PROG
(PARI) is(n, base=3) = #Set(select(sign, digits(n, base)))==1 \\ Rémy Sigrist, Mar 28 2020
(PARI) a(n, base=3) = { for (w=0, oo, if (n<=(base-1)*2^w, my (d=1+(n-1)\2^w, k=2^w+(n-1)%(2^w)); return (d*fromdigits(binary(k), base)), n -= (base-1)*2^w)) } \\ Rémy Sigrist, Mar 28 2020
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Reinhard Zumkeller, Nov 26 2006
STATUS
approved