This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A370004 #18 May 26 2025 11:08:26 %S A370004 1,11,2,13,104,14,3,15,108,16,11,17,4,39,18,77,760,19,52,117,5,118,34, %T A370004 21,120,121,22,41,123,23,6,125,12,24,42,128,504,25,352,130,16,26,7, %U A370004 133,377,27,322,135,136,44,26,393,24,747,139,29,8,141,108,142,30,143,22,144,380,31,606,146,1064,147,32 %N A370004 Least k>0 such that the decimal expansion of k^2 contains k+n as a substring. %C A370004 This sequence is defined for all n. Proof: Given n, consider k = 10^x + n where 10^x > n^2. Since k^2 = (k+n) * 10^x + n^2, k^2 contains k+n as a substring. Furthermore, x = ceiling(log_10(1+n^2)) satisfies the inequality, therefore a(n) <= 10^ceiling(log_10(1+n^2)) + n. - _Jason Yuen_, Feb 26 2024 %H A370004 Michael S. Branicky, <a href="/A370004/b370004.txt">Table of n, a(n) for n = 0..10000</a> %e A370004 a(3) = 13 because 13 is the least positive integer such that 13^2 = 169 contains 13 + 3 = 16 as a substring. %e A370004 a(4) = 104 because 104 is the least positive integer such that 104^2 = 10816 contains 104 + 4 = 108 as a substring. %t A370004 Table[k=1;While[!StringContainsQ[ToString[k^2],ToString[k+n]],k++];k,{n,0,70}] %t A370004 lks[n_]:=Module[{k=1},While[SequenceCount[IntegerDigits[k^2],IntegerDigits[k+n]]==0,k++];k]; Array[lks,80,0] (* _Harvey P. Dale_, May 26 2025 *) %o A370004 (PARI) a(n) = my(k=1); while (#strsplit(Str(k^2), Str(k+n))<2, k++); k; \\ _Michel Marcus_, Feb 07 2024 %o A370004 (Python) %o A370004 from itertools import count %o A370004 def a(n): return next(k for k in count(1) if str(k+n) in str(k*k)) %o A370004 print([a(n) for n in range(71)]) # _Michael S. Branicky_, Feb 07 2024 %Y A370004 Cf. A000290, A018834. %K A370004 nonn,base %O A370004 0,2 %A A370004 _Giorgos Kalogeropoulos_, Feb 07 2024