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.

Original entry on oeis.org

0, 10, 22, 21, 35, 57, 55, 54, 107, 137, 126, 170, 188, 159, 191, 225, 259, 297, 262, 253, 340, 296, 380, 369, 403, 395, 383, 407, 429, 514, 446, 486, 431, 545, 589, 510, 546, 542, 666, 733, 540, 621, 709, 715, 549, 694, 804, 820, 847, 865, 710
Offset: 0

Views

Author

Robert G. Wilson v, Aug 10 2001

Keywords

Crossrefs

Cf. A000244.
Cf. A031146 (analog for 2^k), A063575 (analog for 4^k).

Programs

  • 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 *)
  • PARI
    A063555(n)=for(k=0,oo,#select(d->!d,digits(3^k))==n&&return(k)) \\ M. F. Hasler, Jun 14 2018

Extensions

a(0) corrected by Zak Seidov, Jun 14 2018