login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of distinct sums i^3 + j^3 for 1<=i<=j<=n.
5

%I #18 May 14 2024 16:21:31

%S 1,3,6,10,15,21,28,36,45,55,66,77,90,104,119,134,151,169,188,208,229,

%T 251,274,297,322,348,374,402,431,461,492,523,556,588,623,658,695,733,

%U 771,810,851,893,936,980,1025,1071,1118,1164,1213,1263,1313,1365,1417

%N Number of distinct sums i^3 + j^3 for 1<=i<=j<=n.

%H Seiichi Manyama, <a href="/A061791/b061791.txt">Table of n, a(n) for n = 1..1000</a>

%e If the {s+t} sums are generated by addition 2 terms of an S set consisting of n different entries, then at least 1, at most n(n+1)/2=A000217(n) distinct values can be obtained. The set of first n cubes gives results falling between these two extremes. E.g. S={1,8,27,...,2744,3375} provides 119 different sums of two, not necessarily different cubes:{2,9,....,6750}. Only a single sum occurs more than once: 1729(Ramanujan): 1729=1+1728=729+1000.

%t f[x_] := x^3 t=Table[Length[Union[Flatten[Table[f[u]+f[w], {w, 1, m}, {u, 1, m}]]]], {m, 1, 75}]

%o (Ruby)

%o def A(n)

%o h = {}

%o (1..n).each{|i|

%o (i..n).each{|j|

%o k = i * i * i + j * j * j

%o if h.has_key?(k)

%o h[k] += 1

%o else

%o h[k] = 1

%o end

%o }

%o }

%o h.size

%o end

%o def A061791(n)

%o (1..n).map{|i| A(i)}

%o end

%o p A061791(60) # _Seiichi Manyama_, May 14 2024

%Y Cf. A000217, A061798.

%K nonn

%O 1,2

%A _Labos Elemer_, Jun 22 2001