login

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

Number of solutions to +-1^3 +- 2^3 +- 3^3 +- ... +- n^3 = n.
5

%I #12 Jan 28 2022 20:22:50

%S 1,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,2,4,0,0,83,69,0,0,353,414,0,0,7800,

%T 12496,0,0,48162,56870,0,0,733392,1253467,0,0,4892337,10022277,0,0,

%U 45859303,149422926,0,0,623257759,1339056922,0,0,7453502893,13446831198

%N Number of solutions to +-1^3 +- 2^3 +- 3^3 +- ... +- n^3 = n.

%F a(n) = [x^n] Product_{k=1..n} (x^(k^3) + 1/x^(k^3)).

%o (Python)

%o from functools import lru_cache

%o @lru_cache(maxsize=None)

%o def b(n, i):

%o if n > (i*(i+1)//2)**2: return 0

%o if i == 0: return 1

%o return b(n+i**3, i-1) + b(abs(n-i**3), i-1)

%o def a(n): return b(n, n)

%o print([a(n) for n in range(54)]) # _Michael S. Branicky_, Jan 28 2022

%Y Cf. A063890, A158118, A348165.

%K nonn

%O 0,17

%A _Ilya Gutkovskiy_, Jan 28 2022