A343536 Positive numbers k such that the decimal expansion of k^2 appears in the concatenation of the first k positive integers.
1, 428, 573, 725, 727, 738, 846, 7810, 8093, 28023, 36354, 36365, 36464, 63636, 254544, 277851, 297422, 326734, 673267, 673368, 2889810, 4545454, 4545465, 5454547, 5454646, 24275425, 29411775, 47058823, 52941178, 94117748, 146407310, 263157795, 267735365, 285714186
Offset: 1
Examples
428^2 = 183184, which appears in the concatenation of the first 428 positive integers at 183,184, i.e., (183184), so 428 is a term. 725^2 = 525625, which appears in the concatenation of the first 725 positive integers at 255,256,257, i.e., 25(525625)7, so 725 is a term.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..116
Programs
-
Java
public class Oeis2 { public static void main(String[] args) { StringBuilder str = new StringBuilder(); long n = 1; while (true) { str.append(n); if (str.indexOf(String.valueOf(n * n)) >= 0) { System.out.print(n + ", "); } n++; } } }
-
Mathematica
Select[Range@1000,StringContainsQ[""<>ToString/@Range@#,ToString[#^2]]&] (* Giorgos Kalogeropoulos, Apr 24 2021 *) Select[Range[68*10^4],SequenceCount[Flatten[IntegerDigits/@Range[#]],IntegerDigits[#^2]]>0&] (* The program generates the first 20 terms of the sequence. *) (* Harvey P. Dale, Jul 06 2025 *)
-
PARI
f(n) = my(s=""); for(k=1, n, s=Str(s, k)); s; \\ from A007908 isok(k) = #strsplit(f(k), Str(k^2)) > 1; \\ Michel Marcus, May 02 2021
-
Python
A343536_list, k, s = [], 1, '1' while k < 10**6: if str(k**2) in s: A343536_list.append(k) k += 1 s += str(k) # Chai Wah Wu, Jun 06 2021
Extensions
More terms from Jinyuan Wang, Apr 30 2021
Comments