|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|