login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A062689
Smallest square that contains the digits of n in its exact middle.
1
0, 1, 121, 12321, 4, 256, 169, 576, 289, 9, 8100, 2116, 361201, 3136, 181476, 1156, 16, 101761, 5184, 281961, 2209, 9216, 1225, 182329, 3249, 25, 292681, 192721, 8281, 1296, 2304, 183184, 5329, 343396, 203401, 4356, 36, 223729, 173889, 7396, 2401
OFFSET
0,3
LINKS
EXAMPLE
8100 is the smallest square that contains 10 in its exact center.
PROG
(Python)
def centered(s, t):
q, r = divmod(len(t)-len(s), 2)
return r == 0 and t[q:].startswith(s)
def a(n):
k, target = 0, str(n)
while not centered(target, str(k**2)): k += 1
return k**2
print([a(n) for n in range(43)]) # Michael S. Branicky, Feb 16 2022
CROSSREFS
Cf. A062690.
Sequence in context: A006061 A079215 A137466 * A057139 A321687 A002477
KEYWORD
base,easy,nonn
AUTHOR
Erich Friedman, Jul 04 2001
EXTENSIONS
Corrected and extended by Harvey P. Dale, Jul 21 2001
a(40) from Bernard Schott, Feb 16 2022
STATUS
approved