|
|
A104265
|
|
Smallest n-digit square with no zero digits.
|
|
4
|
|
|
1, 16, 121, 1156, 11236, 111556, 1115136, 11115556, 111112681, 1111155556, 11111478921, 111111555556, 1111118377216, 11111115555556, 111111226346761, 1111111155555556, 11111112515384644, 111111111555555556, 1111111112398242916, 11111111115555555556, 111111111113333185156, 1111111111155555555556
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(n) >= (10^n-1)/9.
a(2n) = (10^n+2)^2/9 = A102807(n). Proof: the smallest 2n-digit number without zero digits is (10^(2n)-1)/9. ((10^n-1)/3)^2 = (10^(2n)-2*10^n+1)/9 < (10^(2n)-1)/9 for n >= 1. Thus a(2n) > ((10^n-1)/3)^2. The next square is ((10^n+2)/3)^2 = (10^(2n)-1)/9 + 4*(10^(n)-1)/9 + 1, i.e. it is n 1's followed by n-1 5's followed by the digit 6, and has no zero digits.
(End)
|
|
EXAMPLE
|
a(3) = Min{121, 144, 169, 196, ....} = 121.
|
|
MATHEMATICA
|
f[n_] := Block[{k = Ceiling[ Sqrt[10^n]]}, While[ Union[ IntegerDigits[ k^2]][[1]] == 0, k++ ]; k^2]; Table[ f[n], {n, 0, 20}] (* Robert G. Wilson v, Mar 02 2005 *)
snds[n_]:=Module[{c=Ceiling[Sqrt[FromDigits[Join[PadRight[{}, n-1, 1], {0}]]]]^2}, While[DigitCount[c, 10, 0]>0, c=(1+Sqrt[c])^2]; c]; Array[ snds, 22] (* Harvey P. Dale, Jun 12 2020 *)
|
|
PROG
|
(Python)
from sympy import integer_nthroot
m, a = integer_nthroot((10**n-1)//9, 2)
if not a:
m += 1
k = m**2
while '0' in str(k):
m += 1
k += 2*m-1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|