login
Complement of A031980.
3

%I #10 Sep 08 2022 08:45:35

%S 9,28,35,65,72,91,126,133,152,189,217,224,243,280,341,344,351,370,407,

%T 468,513,520,539,559,576,637,728,855,1001,1008,1027,1064,1125,1216,

%U 1332,1339,1343,1358,1395,1456,1512,1547,1674,1729,1736,1755,1792,1843,1853

%N Complement of A031980.

%C Subsequence of A024670; A141806 gives the terms of A024670 that are not in this sequence.

%C Not a supersequence of A001235; 7094269 is the smallest number that is in A001235 but not in this sequence (see third example below), the next number is 11261376.

%H Klaus Brockhaus, <a href="/A141805/b141805.txt">Table of n, a(n) for n = 1..24834</a>

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

%e 9 is the sum of two distinct nonzero cubes in exactly one way: 9 = 1^3 + 2^3. 9 is not in A031980 because 1 and 2 are earlier terms of A031980. Therefore 9 is a term of this sequence.

%e 1729 is the sum of two distinct nonzero cubes in exactly two ways: 1729 = 9^3 + 10^3 = 1^3 + 12^3. 1729 is not in A031980 because 1 and 12 are earlier terms of A031980. Therefore 1729 is a term of this sequence.

%e 7094269 is the sum of two distinct nonzero cubes in exactly two ways: 7094269 = 70^3 + 189^3 = 133^3 + 168^3. 7094269 is in A031980 because it not the sum of cubes of two earlier terms of A031980; in the first case 189 and in the second case 133 is not a term of A031980. Therefore 7094269 is not a term of this sequence.

%t max = 2000; A031980 = {1}; Do[ m = Ceiling[(n - 1)^(1/3)]; s = Select[ A031980, # <= m &]; ls = Length[s]; sumOfCubes = Union[Flatten[ Table[s[[i]]^3 + s[[j]]^3, {i, 1, ls}, {j, i + 1, ls}]]]; If[FreeQ[sumOfCubes, n], AppendTo[ A031980, n] ], {n, 2, max}]; Complement[Range[max], A031980] (* _Jean-François Alcover_, Sep 03 2013 *)

%o (Magma) m:=1853; a:=[]; a2:={}; for n in [1..m] do p:=1; u:= a2 join { x: x in a }; while p in u do p:=p+1; end while; if p gt m then break; end if; a2:=a2 join { x^3 + p^3: x in a | x^3 + p^3 le m }; Append(~a,p); end for; print a2;

%Y Cf. A141806, A031980 (smallest number not occurring earlier and not the sum of cubes of two distinct earlier terms), A024670 (sums of cubes of two distinct positive integers), A001235 (sums of two cubes in more than one way).

%K nonn

%O 1,1

%A _Klaus Brockhaus_, Jul 16 2008