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.

A104266 Largest n-digit square with no zero digits.

Original entry on oeis.org

9, 81, 961, 9216, 99856, 978121, 9998244, 99321156, 999887641, 9978811236, 99999515529, 999332111556, 9999995824729, 99978881115136, 999999961946176, 9999333211115556, 99999999356895225, 999978918111112681, 9999999986285964964, 99999333321111155556
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 26 2005

Keywords

Comments

See Formula section for exact formula for terms whose index n is divisible by 4, and upper bounds for other cases; see Links for additional information on those other cases. - Jon E. Schoenfield, Mar 30 2015

Examples

			a(3) = Max{...., 729, 784, 841, 961} = 961.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local r;
      r:= floor(sqrt(10^n));
      while has(convert(r^2,base,10),0) do r:= r-1 od:
    r^2
    end proc:
    seq(f(n),n=1..24); # Robert Israel, Mar 29 2015
  • Mathematica
    f[n_] := Block[{k = Floor[ Sqrt[10^n]]}, While[ Union[ IntegerDigits[ k^2]][[1]] == 0, k-- ]; k^2]; Table[ f[n], {n, 18}] (* Robert G. Wilson v, Mar 03 2005 *)
  • PARI
    a(n)=k=floor(sqrt(10^n));while(k,if(type(k)=="t_INT"&&vecmin(digits(k^2)), return(k^2));k--)
    vector(20,n,a(n)) \\ Derek Orr, Mar 29 2015

Formula

From Jon E. Schoenfield, Mar 31 2015: (Start)
If n is divisible by 4, then a(n) = (10^(n/2) - ceiling(10^(n/4)/3))^2;
otherwise, if n is even, then a(n) < 10^(n) * (1 - (10^-((n-2)/4))* 2 / sqrt(90/1.000000000001026)) (see Links for derivation), except that a(2) = 81.
If n is odd, then a(n) ~ (floor(10^(n/2)))^2. (Although (floor(10*(n/2)))^2 gives an obvious upper bound for a(n) for all n, it seems to be a much tighter upper bound for odd values of n.) (End)

Extensions

More terms from Robert G. Wilson v, Mar 03 2005
More terms from Jon E. Schoenfield, Mar 29 2015