OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..2000
MAPLE
N:= 100: # to get a(0)..a(N)
A:= Array(0..N, -1):
p:= 1: A[0]:= 0:
count:= 1:
for k from 1 while count <= N do
p:= 3*p;
m:= numboccur(0, convert(p, base, 10));
if m <= N and A[m] < 0 then A[m]:= k; count:= count+1 fi
od:
seq(A[i], i=0..N); # Robert Israel, Dec 21 2016
MATHEMATICA
a = {}; Do[k = 1; While[ Count[ IntegerDigits[3^k], 0] != n, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
Module[{l3=Table[{n, DigitCount[3^n, 10, 0]}, {n, 900}]}, Transpose[Table[ SelectFirst[ l3, #[[2]]==i&], {i, 0, 50}]][[1]]] (* Harvey P. Dale, Dec 08 2014 *)
PROG
(PARI) A063555(n)=for(k=0, oo, #select(d->!d, digits(3^k))==n&&return(k)) \\ M. F. Hasler, Jun 14 2018
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Aug 10 2001
EXTENSIONS
a(0) corrected by Zak Seidov, Jun 14 2018
STATUS
approved