%I #27 Apr 17 2018 14:48:27
%S 1,3,119,527,935,3591,3692,6887,12319,47959,65151,97767,99116,202895,
%T 237900,373319,438311,699407,734111,851927,957551,1032156,1064124,
%U 1437599,1443959,2858687,3509231,3699311,4984199,7237415
%N Numbers n such that sum of divisors, sigma(n), and sum of the proper divisors, sigma(n)-n, are both square.
%C The only prime in this sequence is 3. All prime numbers have the square 1 as the sum of their proper divisors. But since 3 is the only prime of the form n^2 - 1, it is the only prime that satisfies the first condition for inclusion in this sequence.
%H Donovan Johnson, <a href="/A176996/b176996.txt">Table of n, a(n) for n = 1..300</a>
%H Antonio Roldan Martinez, <a href="http://hojaynumeros.blogspot.com/2010/12/la-suma-de-sus-divisores-es-cuadrado.html">La suma de sus divisores es cuadrado perfecto</a>
%F Intersection of A006532 and A073040.
%e 119 has divisors 1, 7, 17, 119; it is in the list because 1+7+17+119 = 144 = 12^2 and 1+7+17 = 25 = 5^2.
%t Intersection[Select[Range[10^5], IntegerQ[Sqrt[-# + Plus@@Divisors[#]]] &], Select[Range[10^5], IntegerQ[Sqrt[Plus@@Divisors[#]]] &]] (* _Alonso del Arte_, Dec 08 2010 *)
%t t = {}; Do[If[And @@ IntegerQ /@ Sqrt[{x = DivisorSigma[1, n], x - n}], AppendTo[t, n]], {n, 10^6}]; t (* _Jayanta Basu_, Jul 27 2013 *)
%t sdQ[n_]:=Module[{d=DivisorSigma[1,n]},AllTrue[{Sqrt[d],Sqrt[d-n]}, IntegerQ]]; Select[Range[73*10^5],sdQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Apr 17 2018 *)
%o (Sage) is_A176996 = lambda n: is_square(sigma(n)) and is_square(sigma(n)-n) # _D. S. McNeil_, Dec 09 2010
%Y Cf. A006532, which considers all divisors; A048699, which for nonprime numbers considers all divisors except the number itself; A073040, which is the union of A048699 and the prime numbers (A000040).
%K nonn
%O 1,2
%A _Claudio Meller_, Dec 08 2010