login
A130872
Number of ways to write 8n - 1 as a sum of 7 (not necessarily distinct) odd squares.
1
1, 1, 1, 2, 2, 2, 4, 4, 3, 5, 5, 5, 7, 7, 6, 9, 10, 8, 11, 11, 10, 15, 14, 12, 16, 17, 15, 19, 19, 17, 22, 24, 20, 25, 27, 23, 30, 29, 26, 32, 34, 30, 36, 38, 33, 40, 43, 37, 44, 47, 41, 50, 52, 45, 53, 55, 50, 58, 62, 54, 63, 70, 59, 68, 71, 64, 75, 79, 70, 79, 85, 77, 85, 89, 81
OFFSET
1,4
COMMENTS
Since all odd squares are congruent to 1 mod 8, it is not possible to express any number congruent to 7 mod 8 as a sum of fewer than 7 odd squares.
LINKS
EXAMPLE
a(2) = 1 because 15 = 9 + 1 + 1 + 1 + 1 + 1 + 1 is the only such representation.
a(4) = 2 because 31 = 25 + 1 + 1 + 1 + 1 + 1 + 1 = 9 + 9 + 9 + 1 + 1 + 1 + 1.
MAPLE
A130872recur := proc(n, jmin, N) local a, s ; if N =1 then if n mod 2 = 1 and issqr(n) and n>=jmin^2 then RETURN(1) ; else RETURN(0) ; fi ; else a := 0 ; for s from 2*floor(jmin/2)+1 to floor(sqrt(n)) by 2 do a := a+A130872recur(n-s^2, s, N-1) ; od ; RETURN(a) ; fi ; end: A130872 := proc(n) option remember: A130872recur(8*n-1, 1, 7) ; end: seq(A130872(n), n=1..100); # R. J. Mathar, Aug 02 2007
# second Maple program:
b:= proc(n, i) option remember; convert(series(`if`(n=0, 1, `if`(i<1, 0,
expand(add(b(n-i^2*j, i-2)*x^j, j=0..min(7, n/i^2))))), x, 8), polynom)
end:
a:= n-> coeff(b(8*n-1, (t-> `if`(t::odd, t, t-1))(isqrt(8*n-1))), x, 7):
seq(a(n), n=1..100); # Alois P. Heinz, Jan 27 2024
MATHEMATICA
a[n_] := IntegerPartitions[8 n - 1, {7}, Select[Range[1, 8 n - 1, 2], IntegerQ[Sqrt[#]]&]] // Length;
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 27 2024 *)
CROSSREFS
Sequence in context: A216326 A101909 A215676 * A087627 A195051 A219654
KEYWORD
nonn
AUTHOR
Joel B. Lewis, Jul 24 2007
EXTENSIONS
More terms from R. J. Mathar, Aug 02 2007
STATUS
approved