A104266 Largest n-digit square with no zero digits.
9, 81, 961, 9216, 99856, 978121, 9998244, 99321156, 999887641, 9978811236, 99999515529, 999332111556, 9999995824729, 99978881115136, 999999961946176, 9999333211115556, 99999999356895225, 999978918111112681, 9999999986285964964, 99999333321111155556
Offset: 1
Examples
a(3) = Max{...., 729, 784, 841, 961} = 961.
Links
- Jon E. Schoenfield, Table of n, a(n) for n = 1..100
- Jon E. Schoenfield, Odd-indexed terms with central digits aligned
- Jon E. Schoenfield, Patterns and upper bound for terms for which n mod 4 = 2
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
Comments