A330607 Array read by rows: T(n,k) is the number of solutions to the equation Sum_{i=1..n} x_i^2 == k (mod 5) with x_i in 0..4, where n >= 0 and 0 <= k <= 4.
1, 0, 0, 0, 0, 1, 2, 0, 0, 2, 9, 4, 4, 4, 4, 25, 30, 20, 20, 30, 145, 120, 120, 120, 120, 625, 650, 600, 600, 650, 3225, 3100, 3100, 3100, 3100, 15625, 15750, 15500, 15500, 15750, 78625, 78000, 78000, 78000, 78000, 390625, 391250, 390000, 390000, 391250, 1955625, 1952500, 1952500, 1952500, 1952500
Offset: 0
Examples
Array T(n,k) (with rows n >= 0 and columns 0 <= k <= 4) begins as follows: 1, 0, 0, 0, 0; 1, 2, 0, 0, 2; 9, 4, 4, 4, 4; 25, 30, 20, 20, 30; 145, 120, 120, 120, 120; 625, 650, 600, 600, 650; 3225, 3100, 3100, 3100, 3100; ... T(n=2,k=0) = 9 because we have the following solutions (x_1, x_2) to the equation x_1^2 + x_2^2 == 0 (mod 5) (with x_1, x_2 in 0..4): (0,0), (1,2), (1,3), (2,1), (2,4), (3,1), (3,4), (4,2), and (4,3). T(n=2,k=1) = 4 because we have the following solutions (x_1, x_2) to the equation x_1^2 + x_2^2 == 1 (mod 5) (with x_1, x_2 in 0..4): (0,1), (0,4), (1,0), and (4,0). T(n=2,k=2) = 4 because we have the following solutions (x_1, x_2) to the equation x_1^2 + x_2^2 == 2 (mod 5) (with x_1, x_2 in 0..4): (1,1), (1,4), (4,1), and (4,4). T(n=2,k=3) = 4 because we have the following solutions (x_1, x_2) to the equation x_1^2 + x_2^2 == 3 (mod 5) (with x_1, x_2 in 0..4): (2,2), (2,3), (3,2), and (3,3). T(n=2,k=4) = 4 because we have the following solutions (x_1, x_2) to the equation x_1^2 + x_2^2 == 4 (mod 5) (with x_1, x_2 in 0..4): (0,2), (0,3), (2,0), and (3,0).
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,5,0,0,0,0,5,0,0,0,0,-25).
Programs
-
Maple
with(LinearAlgebra); v := proc(n) local M, v0; M := Matrix([[1, 2, 0, 0, 2], [2, 1, 2, 0, 0], [0, 2, 1, 2, 0], [0, 0, 2, 1, 2], [2, 0, 0, 2, 1]]); v0 := Matrix([[1], [0], [0], [0], [0]]); if n = 0 then v0; else MatrixMatrixMultiply(MatrixPower(M, n), v0); end if; end proc; seq(seq(v(n)[k, 1], k = 1 .. 5), n = 0 .. 10);
-
PARI
Vec((1 - 4*x^5 + 2*x^6 + 2*x^9 - x^10 - 6*x^11 + 4*x^12 + 4*x^13 - 6*x^14) / ((1 - 5*x^5)*(1 - 5*x^10)) + O(x^50)) \\ Colin Barker, Dec 21 2019
Formula
T(n,k) = 5*T(n-1,k) + 5*T(n-2,k) - 25*T(n-3,k) for n >= 3 with initial conditions for T(0,k), T(1,k), and T(2,k) (for each value of k in 0..4) given in the example below.
T(n,k) = 5*T(n-2,k) + 4*5^(n-2) for n >= 2.
T(n,k=1) = T(n,k=4) and T(n,k=2) = T(n,k=3).
T(n,k) ~ 5^(n-1) for each k in 0..4.
Sum_{k = 0..4} T(n,k) = 5^n.
v(n+1) = M*v(n) and v(n) = M^n * [1,0,0,0,0]' for n >= 0, where M = [[1,2,0,0,2], [2,1,2,0,0], [0,2,1,2,0], [0,0,2,1,2], [2,0,0,2,1]] and v(n) = [T(n,0), T(n,1), T(n,2), T(n,3), T(n,4)]'.
From Colin Barker, Dec 21 2019: (Start)
If we consider the array as a single sequence (a(n): n >= 1), then:
G.f.: (1 - 4*x^5 + 2*x^6 + 2*x^9 - x^10 - 6*x^11 + 4*x^12 + 4*x^13 - 6*x^14) / ((1 - 5*x^5)*(1 - 5*x^10)).
a(n) = 5*a(n-5) + 5*a(n-10) - 25*a(n-15) for n > 14. (End)
Comments