Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #25 Jan 15 2018 15:32:48
%S 9,17,18,25,26,27,29,33,34,36,38,45,49,51,53,57,59,61,62,68,69,72,73,
%T 75,77,82,83,85,94,97,100,102,104,105,106,107,108,109,116,118,123,130,
%U 132,136,138,139,141,144,147,152,154,155,157,158,165,177,180,187
%N Numbers that are the sum of three squares (square 0 allowed) in exactly two ways.
%C These are the numbers for which A000164(a(n)) = 2.
%C a(n) is the n-th largest number which has a representation as sum of three integer squares (square 0 allowed), in exactly two ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity for a(n) with order and signs taken into account is A005875(a(n)).
%C This sequence is a proper subsequence of A000378.
%H Alois P. Heinz, <a href="/A224442/b224442.txt">Table of n, a(n) for n = 1..1000</a>
%F This sequence gives the increasingly ordered elements of the set {m integer | m = a^2 + b^2 + c^2, a, b and c integers with 0 <= a <= b <= c, and m has exactly two such representation}.
%F The sequence gives the increasingly ordered members of the set {m integer | A000164(m) = 2, m >= 0}.
%e a(1) = 9 = 0^2 + 0^2 + 3^2 = 1^2 + 2^2 + 2^2, and 9 is the smallest number m with A000164(m) = 2 for m >= 0. The multiplicity with order and signs taken into account is 2*3 + 8*3 = 30 = A005875(9).
%e The two representations [a,b,c] for a(n), n = 1, ..., 10, are
%e n=1, 9 = [0, 0, 3], [1, 2, 2],
%e n=2, 17 = [0, 1, 4], [2, 2, 3],
%e n=3, 18 = [0, 3, 3], [1, 1, 4],
%e n=4, 25 = [0, 0, 5], [0, 3, 4],
%e n=5, 26 = [0, 1, 5], [1, 3, 4],
%e n=6, 27 = [1, 1, 5], [3, 3, 3],
%e n=7, 29 = [0, 2, 5], [2, 3, 4],
%e n=8, 33 = [1, 4, 4], [2, 2, 5],
%e n=9, 34 = [0, 3, 5], [3, 3, 4],
%e n=10, 36 = [0, 0, 6], [2, 4, 4].
%p b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(t*i^2<n, 0,
%p `if`(b(n, i-1, t)>2, 3, min(3, b(n, i-1, t)+
%p `if`(i^2>n, 0, b(n-i^2, i, t-1))))))
%p end:
%p a:= proc(n) option remember; local k;
%p for k from 1 +`if`(n=1, 0, a(n-1))
%p while b(k, isqrt(k), 3)<>2 do od; k
%p end:
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Apr 09 2013
%t Select[ Range[0, 200], Length[ PowersRepresentations[#, 3, 2]] == 2 &] (* _Jean-François Alcover_, Apr 09 2013 *)
%Y Cf. A000164, A005875, A000378, A094942 (one way), A224443 (three ways).
%K nonn
%O 1,1
%A _Wolfdieter Lang_, Apr 08 2013