A318609
a(1) = 2, a(2) = 4, a(3) = 6; for n > 3, a(n) = 3*a(n-1) - 3*a(n-2) + 9*a(n-3).
Original entry on oeis.org
2, 4, 6, 24, 90, 252, 702, 2160, 6642, 19764, 58806, 176904, 532170, 1595052, 4780782, 14346720, 43053282, 129146724, 387400806, 1162241784, 3486843450, 10460412252, 31380882462, 94143001680, 282430067922, 847289140884, 2541864234006, 7625595890664, 22876797237930
Offset: 1
a(5) = 90 since M^5 * [1, 0, 0]^T = [81, 90, 72]^T.
A101990 gives the number of solutions to Sum_{i=1..n} x_i^2 == 0 (mod 3);
A318610 gives the number of solutions to Sum_{i=1..n} x_i^2 == 2 (mod 3).
-
I:=[2,4,6]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+9*Self(n-3): n in [1..30]]; // Jianing Song, Sep 05 2018
-
LinearRecurrence[{3, -3, 9}, {2, 4, 6}, 30] (* Jianing Song, Sep 05 2018 *)
-
Vec(2*x*(1-x)/((1-3*x)*(1+3*x^2)) + O(x^40))
-
a(n) = ([1, 0, 2 ; 2, 1, 0 ; 0, 2, 1]^n*mattranspose([1, 0, 0]))[2]; \\ Michel Marcus, Dec 20 2019
A318610
a(1) = 0, a(2) = 4, a(3) = 12; for n > 3, a(n) = 3*a(n-1) - 3*a(n-2) + 9*a(n-3).
Original entry on oeis.org
0, 4, 12, 24, 72, 252, 756, 2160, 6480, 19764, 59292, 176904, 530712, 1595052, 4785156, 14346720, 43040160, 129146724, 387440172, 1162241784, 3486725352, 10460412252, 31381236756, 94143001680, 282429005040, 847289140884, 2541867422652, 7625595890664, 22876787671992
Offset: 1
a(5) = 72 since M^5 * [1, 0, 0]^T = [81, 90, 72]^T.
A101990 gives the number of solutions to Sum_{i=1..n} x_i^2 == 0 (mod 3);
A318609 gives the number of solutions to Sum_{i=1..n} x_i^2 == 1 (mod 3).
-
I:=[0,4,12]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+9*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Sep 04 2018
-
LinearRecurrence[{3, -3, 9}, {0, 4, 12}, 30] (* Vincenzo Librandi, Sep 04 2018 *)
-
concat([0], Vec(4*x^2/((1-3*x)*(1+3*x^2)) + O(x^40)))
-
a(n) = ([1, 0, 2 ; 2, 1, 0 ; 0, 2, 1]^n*mattranspose([1, 0, 0]))[3]; \\ Michel Marcus, Dec 20 2019
A330619
Array read by rows: T(n,k) is the number of solutions to the equation Sum_{i=1..n} x_i^2 == k (mod 4) with x_i in 0..3, where n >= 0 and 0 <= k <= 3.
Original entry on oeis.org
1, 0, 0, 0, 2, 2, 0, 0, 4, 8, 4, 0, 8, 24, 24, 8, 32, 64, 96, 64, 192, 192, 320, 320, 1024, 768, 1024, 1280, 4608, 3584, 3584, 4608, 18432, 16384, 14336, 16384, 69632, 69632, 61440, 61440, 262144, 278528, 262144, 245760, 1015808, 1081344, 1081344, 1015808, 4063232, 4194304, 4325376, 4194304
Offset: 0
Array T(n,k) (with rows n >= 0 and columns 0 <= k <= 3) begins as follows:
1, 0, 0, 0;
2, 2, 0, 0;
4, 8, 4, 0;
8, 24, 24, 8;
32, 64, 96, 64;
192, 192, 320, 320;
1024, 768, 1024, 1280;
4608, 3584, 3584, 4608;
...
T(n=2,k=0) = 4 because we have the following solutions (x_1, x_2) to the equation x_1^2 + x_2^2 == 0 (mod 4) (with x_1, x_2 in 0..3): (0,0), (0,2), (2,0), and (2,2).
T(n=2,k=1) = 8 because we have the following solutions (x_1, x_2) to the equation x_1^2 + x_2^2 == 1 (mod 4) (with x_1, x_2 in 0..3): (0,1), (0,3), (1,0), (1,2), (2,1), (2,3), (3,0), and (3,2).
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 4) (with x_1, x_2 in 0..3): (1,1), (1,3), (3,1), and (3,3).
T(n=2,k=3) = 0 because we have no solutions (x_1, x_2) to the equation x_1^2 + x_2^2 == 3 (mod 4) (with x_1, x_2 in 0..3).
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,8,0,0,0,-24,0,0,0,32).
-
with(LinearAlgebra);
v := proc(n) local M, v0;
M := Matrix([[2, 0, 0, 2], [2, 2, 0, 0], [0, 2, 2, 0], [0, 0, 2, 2]]);
v0 := Matrix([[1], [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 .. 4), n = 0 .. 10);
-
a(n) = ([2,0,0,2; 2,2,0,0; 0,2,2,0; 0,0,2,2]^n*mattranspose([1, 0, 0, 0]));
for(n=0, 30, print1(a(n), ", ")); /* after Michel Marcus's program for A101990 */
-
Vec((1 - 2*x^4 + 2*x^5)*(1 - 4*x^4 + 4*x^8 + 4*x^10) / ((1 - 2*x^2)*(1 + 2*x^2)*(1 - 4*x^4 + 8*x^8)) + O(x^50)) \\ Colin Barker, Dec 21 2019
Showing 1-3 of 3 results.
Comments