login
Numbers that are the sum of the squares of two of their distinct divisors.
2

%I #25 Feb 01 2021 19:21:54

%S 20,80,90,180,272,320,360,468,500,650,720,810,980,1088,1280,1332,1440,

%T 1620,1872,2000,2250,2420,2448,2450,2600,2880,2900,3240,3380,3600,

%U 3920,4160,4212,4352,4410,4500,5120,5328,5760,5780,5850,6480,6642,6800,7220,7290,7488,7650

%N Numbers that are the sum of the squares of two of their distinct divisors.

%H Chai Wah Wu, <a href="/A337988/b337988.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>

%e 20 = 2^2 + 4^2, so 20 is in the sequence.

%t Select[Range[10^4], 1 == Catch@ Do[Do[If[#2[[i]]^2 + #2[[j]]^2 == #1, Throw[1]], {j, i + 1, #3}], {i, #3}] & @@ {#, Divisors[#], DivisorSigma[0, #]} &] (* _Michael De Vlieger_, Oct 10 2020 *)

%o (PARI) isok(m) = {my(d=divisors(m)); for (i=2, #d, for (j=1, i-1, if (d[i]^2+d[j]^2 == m, return (1));););} \\ _Michel Marcus_, Oct 07 2020

%o (Python)

%o from sympy import divisors, integer_nthroot

%o A337988_list = []

%o for n in range(1,10**6):

%o for d in divisors(n):

%o if 2*d*d >= n:

%o break

%o a, b = integer_nthroot(n-d*d,2)

%o if b and n % a == 0:

%o A337988_list.append(n)

%o break # _Chai Wah Wu_, Oct 30 2020

%Y Cf. A000404.

%K nonn

%O 1,1

%A _Wesley Ivan Hurt_, Oct 06 2020

%E More terms from _Michel Marcus_, Oct 07 2020