login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 26 19:53 EDT 2024. Contains 372004 sequences. (Running on oeis4.)