cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A024670 Numbers that are sums of 2 distinct positive cubes.

This page as a plain text file.
%I A024670 #56 Jul 02 2024 08:21:52
%S A024670 9,28,35,65,72,91,126,133,152,189,217,224,243,280,341,344,351,370,407,
%T A024670 468,513,520,539,559,576,637,728,730,737,756,793,854,855,945,1001,
%U A024670 1008,1027,1064,1072,1125,1216,1241,1332,1339,1343,1358,1395,1456,1512,1547,1674
%N A024670 Numbers that are sums of 2 distinct positive cubes.
%C A024670 This sequence contains no primes since x^3+y^3=(x^2-x*y+y^2)*(x+y). - _M. F. Hasler_, Apr 12 2008
%C A024670 There are no terms == 3, 4, 5 or 6 mod 9. - _Robert Israel_, Oct 07 2014
%C A024670 a(n) mod 2: {1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,0,1,0,1,0,1,1,1,0, ...} - _Daniel Forgues_, Sep 27 2018
%H A024670 Chai Wah Wu, <a href="/A024670/b024670.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..902 from M. F. Hasler)
%H A024670 <a href="/index/Su#ssq">Index to sequences related to sums of cubes</a>
%e A024670 9 is in the sequence since 2^3 + 1^3 = 9.
%e A024670 35 is in the sequence since 3^3 + 2^3 = 35.
%p A024670 N:= 10000: # to get all terms <= N
%p A024670 S:= select(`<=`,{seq(seq(i^3 + j^3, j = 1 .. i-1), i = 2 .. floor(N^(1/3)))},N);
%p A024670 # if using Maple 11 or earlier, uncomment the next line
%p A024670 # sort(convert(S,list));
%p A024670 # _Robert Israel_, Oct 07 2014
%t A024670 lst={};Do[Do[x=a^3;Do[y=b^3;If[x+y==n,AppendTo[lst,n]],{b,Floor[(n-x)^(1/3)],a+1,-1}],{a,Floor[n^(1/3)],1,-1}],{n,6!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Jan 22 2009 *)
%t A024670 Select[Range@ 1700, Total@ Boole@ Map[And[! MemberQ[#, 0], UnsameQ @@ #] &, PowersRepresentations[#, 2, 3]] > 0 &] (* _Michael De Vlieger_, May 13 2017 *)
%o A024670 (PARI) isA024670(n)=for( i=ceil(sqrtn( n\2+1,3)),sqrtn(n-.5,3), isA000578(n-i^3) & return(1)) /* One could also use "for( i=2,sqrtn( n\2-1,3),...)" but this is much slower since there are less cubes in [n/2,n] than in [1,n/2]. Replacing the -1 here by +.5 would yield A003325, allowing for a(n)=x^3+x^3. Replacing -1 by 0 may miss some a(n) of this form due to rounding errors. - _M. F. Hasler_, Apr 12 2008 */
%o A024670 (Python)
%o A024670 from itertools import count, takewhile
%o A024670 def aupto(limit):
%o A024670     cbs = list(takewhile(lambda x: x <= limit, (i**3 for i in count(1))))
%o A024670     sms = set(c+d for i, c in enumerate(cbs) for d in cbs[i+1:])
%o A024670     return sorted(s for s in sms if s <= limit)
%o A024670 print(aupto(1674)) # _Michael S. Branicky_, Sep 28 2021
%Y A024670 See also: Sums of 2 positive cubes (not necessarily distinct): A003325. Sums of 3 distinct positive cubes: A024975. Sums of distinct positive cubes: A003997. Sums of 2 distinct nonnegative cubes: A114090. Sums of 2 nonnegative cubes: A004999. Sums of 2 distinct positive squares: A004431. Cubes: A000578.
%Y A024670 Cf. A373971 (characteristic function).
%Y A024670 Indices of nonzero terms in A025468.
%K A024670 nonn
%O A024670 1,1
%A A024670 _Clark Kimberling_
%E A024670 Name edited by _Zak Seidov_, May 31 2011