OFFSET
2,1
COMMENTS
If the function zeros(n,b) returns the number of zeros in the numbers 1 through n in base b, then:
zeros(2,2) = zeros_in(10) = 1.
zeros(4,2) = zeros_in(10,100) = 3.
zeros(5,2) = zeros_in(10,100,101) = 4.
zeros(6,2) = zeros_in(10,100,101,110) = 5.
zeros(8,2) = zeros_in(10,100,101,110,1000) = 8.
zeros(9,2) = zeros_in(10,100,101,110,1000,1001) = 10.
Therefore 9 < zeros(9,2) and 9 is the first entry in the list.
LINKS
Anthony Sand, Table of n, a(n) for n = 2..100
EXAMPLE
9 < zero(9,base=2) = 10.
87 < zero(87,3) = 88.
1068 < zero(1068,4) = 1069.
100559404366 < zero(100559404366,10) = 100559404367.
MATHEMATICA
a245491[n_Integer] := Module[{x = 0, z = 0},
While[x >= z, x++; z += Count[IntegerDigits[x, n], 0]]; x]; Map[a245491, Range[2, 12]] (* Michael De Vlieger, Aug 06 2014 *)
PROG
(PARI) /* formula for calculating n such that zero(n) > n, zero(n-1) <= (n-1) */
{estimate(x, b) = m1=b; est=x\b; nn=est; while(nn>0, d=nn%b; m2 = nn\b; if(d==0, est+=(x%m1)+1; if(m2>0, m2--)); est+=m1*m2; m1*=b; nn=nn\b); return(est)}
{bmin=2; bmx=20; for(bs=bmin, bmx, ni=bs^bs; n=bs+1; ez1=0; ez2=0; until(ez1>n && ez2<=n-1, ez = estimate(n, bs); if(n>=ez, n+=ni, n-=ni; if(ni>1, ni=ni\bs)); ez1 = estimate(n, bs); ez2 = estimate(n-1, bs)); print1(n, ", ")) } \\ Anthony Sand, Aug 11 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Anthony Sand, Jul 24 2014
STATUS
approved
