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.

A063555 Smallest k such that 3^k has exactly n 0's in its decimal representation.

This page as a plain text file.
%I A063555 #24 Jun 15 2018 08:23:21
%S A063555 0,10,22,21,35,57,55,54,107,137,126,170,188,159,191,225,259,297,262,
%T A063555 253,340,296,380,369,403,395,383,407,429,514,446,486,431,545,589,510,
%U A063555 546,542,666,733,540,621,709,715,549,694,804,820,847,865,710
%N A063555 Smallest k such that 3^k has exactly n 0's in its decimal representation.
%H A063555 Robert Israel, <a href="/A063555/b063555.txt">Table of n, a(n) for n = 0..2000</a>
%p A063555 N:= 100: # to get a(0)..a(N)
%p A063555 A:= Array(0..N,-1):
%p A063555 p:= 1: A[0]:= 0:
%p A063555 count:= 1:
%p A063555 for k from 1 while count <= N do
%p A063555   p:= 3*p;
%p A063555   m:= numboccur(0, convert(p,base,10));
%p A063555   if m <= N and A[m] < 0 then A[m]:= k; count:= count+1 fi
%p A063555 od:
%p A063555 seq(A[i],i=0..N); # _Robert Israel_, Dec 21 2016
%t A063555 a = {}; Do[k = 1; While[ Count[ IntegerDigits[3^k], 0] != n, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
%t A063555 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 *)
%o A063555 (PARI) A063555(n)=for(k=0,oo,#select(d->!d,digits(3^k))==n&&return(k)) \\ _M. F. Hasler_, Jun 14 2018
%Y A063555 Cf. A000244.
%Y A063555 Cf. A031146 (analog for 2^k), A063575 (analog for 4^k).
%K A063555 base,nonn
%O A063555 0,2
%A A063555 _Robert G. Wilson v_, Aug 10 2001
%E A063555 a(0) corrected by _Zak Seidov_, Jun 14 2018