login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers whose square is a concatenation of two nonzero squares.
7

%I #26 Jul 13 2021 02:38:53

%S 7,13,19,35,38,41,57,65,70,125,130,190,205,223,253,285,305,350,380,

%T 410,475,487,570,650,700,721,905,975,985,1012,1201,1250,1265,1300,

%U 1301,1442,1518,1771,1900,2024,2050,2163,2225,2230,2277,2402,2435,2530,2850

%N Numbers whose square is a concatenation of two nonzero squares.

%C Leading zeros not allowed, trailing zeros are.

%C This means that, e.g., 95 is not in the sequence although 95^2 = 9025 could be seen as concatenation of 9 and 025 = 5^2. - _M. F. Hasler_, Jan 25 2016

%H Giovanni Resta, <a href="/A048375/b048375.txt">Table of n, a(n) for n = 1..3000</a>

%F a(n) = sqrt(A039686(n)). - _M. F. Hasler_, Jan 25 2016

%e 1771^2 = 3136441 = 3136_441 and 3136 = 56^2, 441 = 21^2.

%t squareQ[n_] := IntegerQ[Sqrt[n]]; okQ[n_] := MatchQ[IntegerDigits[n^2], {a__ /; squareQ[FromDigits[{a}]], b__ /; First[{b}] > 0 && squareQ[FromDigits[{b}]]}]; Select[Range[3000], okQ] (* _Jean-François Alcover_, Oct 20 2011, updated Dec 13 2016 *)

%o (PARI) is_A048375(n)={my(p=100^valuation(n,10));n*=n;while(n>p*=10,issquare(n%p)&&issquare(n\p)&&n%p*10>=p&&return(1))} \\ _M. F. Hasler_, Jan 25 2016

%o (Python)

%o from math import isqrt

%o def issquare(n): return isqrt(n)**2 == n

%o def ok(n):

%o d = str(n)

%o for i in range(1, len(d)):

%o if d[i] != '0' and issquare(int(d[:i])) and issquare(int(d[i:])):

%o return True

%o return False

%o print([r for r in range(2851) if ok(r*r)]) # _Michael S. Branicky_, Jul 13 2021

%Y Cf. A039686, A048646.

%K nonn,easy,nice,base

%O 1,1

%A _Patrick De Geest_, Mar 15 1999