[go: up one dir, main page]

login
Search: a048646 -id:a048646
     Sort: relevance | references | number | modified | created      Format: long | short | data
Numbers whose square is a concatenation of two nonzero squares.
+10
7
7, 13, 19, 35, 38, 41, 57, 65, 70, 125, 130, 190, 205, 223, 253, 285, 305, 350, 380, 410, 475, 487, 570, 650, 700, 721, 905, 975, 985, 1012, 1201, 1250, 1265, 1300, 1301, 1442, 1518, 1771, 1900, 2024, 2050, 2163, 2225, 2230, 2277, 2402, 2435, 2530, 2850
OFFSET
1,1
COMMENTS
Leading zeros not allowed, trailing zeros are.
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
LINKS
FORMULA
a(n) = sqrt(A039686(n)). - M. F. Hasler, Jan 25 2016
EXAMPLE
1771^2 = 3136441 = 3136_441 and 3136 = 56^2, 441 = 21^2.
MATHEMATICA
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 *)
PROG
(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
(Python)
from math import isqrt
def issquare(n): return isqrt(n)**2 == n
def ok(n):
d = str(n)
for i in range(1, len(d)):
if d[i] != '0' and issquare(int(d[:i])) and issquare(int(d[i:])):
return True
return False
print([r for r in range(2851) if ok(r*r)]) # Michael S. Branicky, Jul 13 2021
CROSSREFS
KEYWORD
nonn,easy,nice,base
AUTHOR
Patrick De Geest, Mar 15 1999
STATUS
approved
Numbers k such that the decimal digits of k^2 can be partitioned into two or more nonzero squares.
+10
4
7, 12, 13, 19, 21, 35, 37, 38, 41, 44, 57, 65, 70, 107, 108, 112, 119, 120, 121, 125, 129, 130, 190, 191, 204, 205, 209, 210, 212, 223, 253, 285, 305, 306, 315, 342, 343, 345, 350, 369, 370, 379, 380, 408, 410, 413, 440, 441, 475, 487, 501, 538, 570, 642, 650
OFFSET
1,1
LINKS
EXAMPLE
12 is present because 12^2=144 can be partitioned into three squares 1, 4 and 4.
108^2 = 11664 = 1_16_64, 120^2 = 14400 = 1_4_400, so 108 and 120 are in the sequence.
MATHEMATICA
(* This non-optimized program is not suitable to compute a large number of terms. *) split[digits_, pos_] := Module[{pos2}, pos2 = Transpose[{Join[ {1}, Most[pos+1]], pos}]; FromDigits[Take[digits, {#[[1]], #[[2]]}]]& /@ pos2]; sel[n_] := Module[{digits, ip, ip2, accu, nn}, digits = IntegerDigits[n^2]; ip = IntegerPartitions[Length[digits]]; ip2 = Flatten[ Permutations /@ ip, 1]; accu = Accumulate /@ ip2; nn = split[ digits, #]& /@ accu; SelectFirst[nn, Length[#]>1 && Flatten[ IntegerDigits[#] ] == digits && AllTrue[#, #>0 && IntegerQ[Sqrt[#]]&]&] ]; k = 1; Reap[Do[If[(s = sel[n]) != {}, Print["a(", k++, ") = ", n, " ", n^2, " ", s]; Sow[n]], {n, 1, 10^4}]][[2, 1]] (* Jean-François Alcover, Sep 28 2016 *)
PROG
(Haskell)
a048653 n = a048653_list !! (n-1)
a048653_list = filter (f . show . (^ 2)) [1..] where
f zs = g (init $ tail $ inits zs) (tail $ init $ tails zs)
g (xs:xss) (ys:yss)
| h xs = h ys || f ys || g xss yss
| otherwise = g xss yss
where h ds = head ds /= '0' && a010052 (read ds) == 1
g _ _ = False
-- Reinhard Zumkeller, Oct 11 2011
(Python)
from math import isqrt
def issquare(n): return isqrt(n)**2 == n
def ok(n, c):
if n%10 in {2, 3, 7, 8}: return False
if issquare(n) and c > 1: return True
d = str(n)
for i in range(1, len(d)):
if d[i] != '0' and issquare(int(d[:i])) and ok(int(d[i:]), c+1):
return True
return False
def aupto(lim): return [r for r in range(lim+1) if ok(r*r, 1)]
print(aupto(650)) # Michael S. Branicky, Jul 10 2021
CROSSREFS
Cf. A048646, A048375, A010052, A000290; subsequence of A128783.
KEYWORD
base,nice,nonn
AUTHOR
EXTENSIONS
Corrected and extended by Naohiro Nomoto, Sep 01 2001
Definition clarified by Harvey P. Dale, May 09 2021
STATUS
approved
Numbers n such that n^2 is a concatenation of 3 nonzero squares, leading zeros not allowed.
+10
1
12, 21, 37, 44, 107, 108, 120, 129, 191, 204, 209, 210, 223, 306, 315, 342, 343, 345, 370, 408, 413, 440, 501, 642, 696, 804, 955, 959, 982, 995, 1002, 1044, 1063, 1065, 1070, 1080, 1107, 1169, 1200, 1275, 1281, 1290, 1301, 1306, 1315, 1349, 1385, 1503, 1910
OFFSET
1,1
EXAMPLE
a(1) = 12: 12^2 = 144, 1 = 1^2, 4 = 2^2, 4 = 2^2;
a(1500) = 3176900^2 = 100, 9, 2693610000, 100 = 10^2, 9 = 3^2, 2693610000 = 51900^2.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Zak Seidov, Nov 22 2012
STATUS
approved
Primes p such that the decimal digits of p^2 can be partitioned into two or more squares.
+10
1
7, 13, 19, 37, 41, 97, 107, 191, 223, 379, 397, 487, 509, 701, 997, 1049, 1063, 1093, 1201, 1301, 1801, 1907, 2011, 2029, 3019, 3169, 3319, 3371, 3767, 4013, 4451, 5009, 5011, 5081, 5099, 5693, 6037, 6397, 7001, 8009, 9041, 9521, 9619, 9721, 9907, 10007
OFFSET
1,1
COMMENTS
Similar to A048646 except that here zeros are permitted as squares.
LINKS
EXAMPLE
97 is a term because 97 is a prime and 97^2 = 9409 which can be partitioned into 9, 4, 0, and 9, each of which is a square.
MATHEMATICA
tmsQ[n_]:=Total[Boole[AllTrue[Sqrt[#], IntegerQ]&/@Rest[Table[FromDigits/@ TakeList[IntegerDigits[n^2], q], {q, Flatten[Permutations/@ IntegerPartitions[ IntegerLength[ n^2]], 1]}]]]]>0; Select[Prime[ Range[ 3000]], tmsQ]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Harvey P. Dale, May 09 2021
STATUS
approved

Search completed in 0.045 seconds