OFFSET
1,2
COMMENTS
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.
LINKS
Donovan Johnson, Table of n, a(n) for n = 1..300
Antonio Roldan Martinez, La suma de sus divisores es cuadrado perfecto
EXAMPLE
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.
MATHEMATICA
Intersection[Select[Range[10^5], IntegerQ[Sqrt[-# + Plus@@Divisors[#]]] &], Select[Range[10^5], IntegerQ[Sqrt[Plus@@Divisors[#]]] &]] (* Alonso del Arte, Dec 08 2010 *)
t = {}; Do[If[And @@ IntegerQ /@ Sqrt[{x = DivisorSigma[1, n], x - n}], AppendTo[t, n]], {n, 10^6}]; t (* Jayanta Basu, Jul 27 2013 *)
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 *)
PROG
(Sage) is_A176996 = lambda n: is_square(sigma(n)) and is_square(sigma(n)-n) # D. S. McNeil, Dec 09 2010
CROSSREFS
KEYWORD
nonn
AUTHOR
Claudio Meller, Dec 08 2010
STATUS
approved