login
Triangle read by rows giving numerators of the Fourier expansion of cos^n(x).
0

%I #29 Aug 01 2017 05:32:31

%S 1,0,1,1,0,1,0,3,0,1,3,0,4,0,1,0,10,0,5,0,1,10,0,15,0,6,0,1,0,35,0,21,

%T 0,7,0,1,35,0,56,0,28,0,8,0,1,0,126,0,84,0,36,0,9,0,1,126,0,210,0,120,

%U 0,45,0,10,0,1,0,462,0,330,0,165,0,55,0,11,0,1,462,0,792,0,495,0,220,0,66,0,12,0,1

%N Triangle read by rows giving numerators of the Fourier expansion of cos^n(x).

%C Doubling the initial term of each line and dropping the 0's transforms this triangle to the right half of Pascal's triangle (A007318).

%C Row sums are A011782. - _Omar E. Pol_, May 02 2017

%F cos^n(x) = (1/2^(n-1)) * Sum_{k=0..n} T(n,k) * cos(k*x).

%F T(n,k) = T(n-1,k-1) + T(n-1,k+1) if k != 1, T(n,1) = 2*T(n-1,0) + T(n-1,2), T(n,k) = 0 if k < 0 or k > n.

%e Triangle begins:

%e 1;

%e 0, 1;

%e 1, 0, 1;

%e 0, 3, 0, 1;

%e 3, 0, 4, 0, 1;

%e 0, 10, 0, 5, 0, 1;

%e 10, 0, 15, 0, 6, 0, 1;

%e 0, 35, 0, 21, 0, 7, 0, 1;

%e 35, 0, 56, 0, 28, 0, 8, 0, 1;

%e 0, 126, 0, 84, 0, 36, 0, 9, 0, 1;

%e 126, 0, 210, 0, 120, 0, 45, 0, 10, 0, 1;

%e 0, 462, 0, 330, 0, 165, 0, 55, 0, 11, 0, 1;

%e 462, 0, 792, 0, 495, 0, 220, 0, 66, 0, 12, 0, 1;

%e ...

%t row[n_] := If[n==0, {1}, 2^(n-1)*TrigReduce[Cos[x]^n] /. Cos[Times[k_., x]] -> x^k // CoefficientList[#, x]&]; Table[row[n], {n, 0, 12}] // Flatten

%t (* Second program: *)

%t T[n_, n_] = 1; T[n_, k_] /; k == n-1 || k>n = 0; T[n_, 1] := 2 T[n-1, 0] + T[n-1, 2]; T[n_, 0] := T[n-1, 1]; T[n_, k_] /; 1 < k <= n := T[n, k] = T[n-1, k-1] + T[n-1, k+1]; T[_, _] = 0; Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, May 02 2017 *)

%Y Cf. A007318, A100257 (same sequence with rows reversed).

%K nonn,tabl

%O 0,8

%A _Landry Salle_, May 02 2017