A257649 Squares that are the concatenation of two integers (without leading zeros) the sum of which is also a square.
36, 81, 169, 196, 324, 361, 576, 729, 841, 1156, 1521, 1681, 1764, 2809, 3249, 3481, 4356, 5625, 6084, 6241, 6724, 7396, 7569, 7744, 7921, 8281, 9216, 12321, 12544, 12769, 12996, 13689, 15129, 16384, 17424, 18769, 19881, 24964, 25600, 31684, 32041, 34596, 36864, 38416, 39601
Offset: 1
Examples
36 = 6^2 and 3 + 6 = 9 = 3^2.
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..10000 (first 909 terms from Reiner Moewald)
Crossrefs
Subsequence of A052041.
Programs
-
Mathematica
f[n_] := Block[{a, b, c, k = 1, idn = IntegerDigits@ n, lng, lst = {}}, lng = Length@ idn; While[k < lng, a = FromDigits[ Take[idn, {1, k}]]; b = FromDigits[ Take[idn, {k + 1, lng}]]; c = a*10^(lng - k) + b; If[b > 0 && Floor[1 + Log10@ b] == lng - k && IntegerQ@ Sqrt[a + b], AppendTo[lst, c]]; k++]; Length@ lst]; k = 1; lst = {}; While[k < 201, If[ f[k^2] > 0, AppendTo[lst, k^2]]; k++]; lst (* Robert G. Wilson v, Aug 06 2015 *) ctiQ[n_]:=AnyTrue[Total/@Select[Table[FromDigits/@TakeDrop[IntegerDigits[n],d],{d,IntegerLength[ n]-1}],IntegerLength[#[[1]]]+IntegerLength[#[[2]]] ==IntegerLength[ n]&],IntegerQ[ Sqrt[#]]&]; Select[Range[200]^2,ctiQ] (* Harvey P. Dale, Jun 04 2023 *)
-
Python
import math print("Start") list =[] for i in range(1,1000): a = i*i b = str(a) l = len(b) for j in range(1, l): a_1 = b[:j] a_2 = b[j:] c = int(a_1)+int(a_2) sqrt_c = int(math.sqrt(int(c))) if (sqrt_c * sqrt_c == c) and (int(a_2[:1]) > 0): if not a in list: list.append(a) print(list) print("End")
Comments