OFFSET
0,2
COMMENTS
For all pair of relatively prime numbers k, m this sequence is multiplicative with a factor of 8: a(k*m) = 8*a(k)*a(m). - Christopher Heiling, Apr 02 2017
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000 (terms n = 1..150 from Christopher Heiling)
FORMULA
a(n) = 8*sigma(n^2) if n is odd else 24*sigma(m(n^2)), where sigma(n) = A000203(n) and m(n) = A000265(n) is the largest odd divisor of n. - Peter Bala, Jan 15 2016
a(p^(k+1)) = 8*(p^2 *a(p^k)+p+1) for p prime. In particular a(p) = 8*(p^2+p+1). - Christopher Heiling, Apr 02 2017
EXAMPLE
For n = 2 the a(n) = 24 solutions of x^2 + y^2 + z^2 + t^2 = 2^2 are:
{x,y,z,t} = {{0,0,0,2};{0,0,0,-2};{0,0,2,0};{0,0,-2,0};{0,2,0,0};{0,-2,0,0};{2,0,0,0};{-2,0,0,0};{1,1,1,1};{1,1,1,-1};{1,1,-1,1};{1,-1,1,1};{-1,1,1,1};{1,1,-1,-1};{1,-1,1,-1};{-1,1,1,-1};{1,-1,-1,1};{-1,1,-1,1};{1,-1,-1,-1};{-1,1,-1,-1};{-1,-1,1,-1};{-1,-1,1,-1};{-1,-1,-1,1};{-1,-1,-1,-1}}.
MAPLE
terms := 42:
(add(q^(m^2), m = -terms..terms))^4:
seq(coeff(%, q, n^2), n = 0..terms); # Peter Bala, Jan 15 2016
MATHEMATICA
a[n_] := SquaresR[4, n^2];
Table[a[n], {n, 0, 50}] (* Jean-François Alcover, May 18 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Christopher Heiling, Jan 13 2016
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, Mar 10 2023
STATUS
approved