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!)
A109688 Smallest square that contains exactly n occurrences of the string n. 1
1, 1, 225, 343396, 44944, 505575225, 4666665969, 77770707876, 388888184881, 9499999990849, 1010101019780101025109910101001, 1101191170117113111111301111961124, 121214127521273511212121212512121241, 135131321313113136131313387213513731136 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Occurrences are counted without overlap, so 1111 has two occurrences of 11, not 3. - Michael S. Branicky, Aug 12 2023
LINKS
EXAMPLE
a(2)=225=15^2 since this is the first square that contains two 2's.
MATHEMATICA
With[{sqs=Range[0, 3100000]^2}, Flatten[Table[Select[sqs, DigitCount[#, 10, n] == n&, 1], {n, 9}]]] (* Harvey P. Dale, May 04 2012 *)
PROG
(Python)
from math import isqrt
def a(n):
sn = str(n)
k = 1 if n == 0 else isqrt(int(sn*n))
while True:
if str(k*k).count(sn) == n:
return k*k
k += 1
print([a(n) for n in range(10)]) # Michael S. Branicky, Feb 02 2022
CROSSREFS
Sequence in context: A171109 A239478 A304314 * A195277 A319944 A013757
KEYWORD
nonn,base
AUTHOR
Erich Friedman, Aug 07 2005
EXTENSIONS
Corrected and extended by Giovanni Resta, Apr 05 2006
a(10) and beyond from Bert Dobbelaere, Sep 05 2023
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 July 23 15:46 EDT 2024. Contains 374552 sequences. (Running on oeis4.)