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.
%I A348165 #37 Feb 26 2022 04:56:48 %S A348165 1,1,0,0,1,2,0,0,2,4,0,0,19,29,0,0,127,208,0,0,1121,1917,0,0,10479, %T A348165 19360,0,0,113213,204121,0,0,1290968,2363982,0,0,15303057,28397538,0, %U A348165 0,187446097,351339307,0,0,2355979330,4455357992,0,0,30360404500,57630025172 %N A348165 Number of solutions to +-1^2 +- 2^2 +- 3^2 +- ... +- n^2 = n. %H A348165 Alois P. Heinz, <a href="/A348165/b348165.txt">Table of n, a(n) for n = 0..200</a> %F A348165 a(n) = [x^n] Product_{k=1..n} (x^(k^2) + 1/x^(k^2)). %p A348165 b:= proc(n, i) option remember; (m-> `if`(n>m, 0, `if`(n=m, 1, %p A348165 b(abs(n-i^2), i-1)+b(n+i^2, i-1))))((1+(3+2*i)*i)*i/6) %p A348165 end: %p A348165 a:= n-> `if`(irem(n, 4)>1, 0, b(n$2)): %p A348165 seq(a(n), n=0..50); # _Alois P. Heinz_, Jan 28 2022 %t A348165 b[n_, i_] := b[n, i] = Function[m, If[n > m, 0, If[n == m, 1, b[Abs[n - i^2], i - 1] + b[n + i^2, i - 1]]]][(1 + (3 + 2*i)*i)*i/6]; %t A348165 a[n_] := If[Mod[n, 4] > 1, 0, b[n, n]]; %t A348165 Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Feb 26 2022, after _Alois P. Heinz_ *) %o A348165 (Python) %o A348165 from functools import lru_cache %o A348165 @lru_cache(maxsize=None) %o A348165 def b(n, i): %o A348165 if n > i*(i+1)*(2*i+1)//6: return 0 %o A348165 if i == 0: return 1 %o A348165 return b(n+i**2, i-1) + b(abs(n-i**2), i-1) %o A348165 def a(n): return b(n, n) %o A348165 print([a(n) for n in range(50)]) # _Michael S. Branicky_, Jan 28 2022 %Y A348165 Cf. A063890, A158092, A348892. %K A348165 nonn %O A348165 0,6 %A A348165 _Ilya Gutkovskiy_, Jan 28 2022