cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A337760 Irregular triangle where T(n,k) are the coefficients of expansion 2^(n-1) Product_{k=1..n} sin(k*t) = Sum_{k=1..n*(n+1)/2} T(n,k)*cos(k*t) for even n and 2^(n-1) Product_{k=1..n} sin(k*t) = Sum_{k=1..n*(n+1)/2} T(n,k)*sin(k*t) for odd n.

Original entry on oeis.org

0, 1, 0, 1, 0, -1, 0, 0, 1, 0, 1, 0, -1, 1, 0, 0, 0, 0, 0, -1, 0, -1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, -1, 0, -1, 0, 1, 0, 1, 0, 1, 0, 0, 0, -2, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 0, -1, 0, -1, 0, 0, 0, -1, 0, 0
Offset: 1

Views

Author

Gevorg Hmayakyan, Sep 18 2020

Keywords

Comments

This coefficients appear in Euler totient function exact formula.

Examples

			sin(t) = sin(t),
2*sin(t)*sin(2*t) = cos(t)-cos(3*t),
4*sin(t)*sin(2*t)*sin(3*t) = sin(2*t)+sin(4*t)-sin(6*t),
8*sin(t)*sin(2*t)*sin(3*t)*sin(4*t) = 1-cos(6*t)-cos(8*t)+cos(10*t),
...
and corresponding table is:
0, 1
0, 1, 0, -1
0, 0, 1,  0, 1, 0, -1
1, 0, 0,  0, 0, 0, -1,  0, -1, 0, 1
0, 1, 0,  1, 0, 1,  0,  0,  0, 0, 0, -1, 0, -1, 0, 1
0, 1, 0,  1, 0, 0,  0, -2,  0, 0, 0, -1, 0,  0, 0, 0, 0, 1, 0, 1, 0, -1
...
		

Programs

  • Maple
    an := proc (n, r) option remember;
    if n < 0 or r < 0 then
    0
    elif n = 1 then
    if r = 1 then
    1
    else
    0
    end if;
    elif r=0 and n mod 2 = 0 then
    procname(n-1, n-r)
    else
    procname(n-1, n-r)+(-1)^n*(procname(n-1, n+r)-procname(n-1, r-n))
    end if
    end proc
  • Mathematica
    Table[Expand[2^(n-1)*TrigReduce[Product[Sin[k*t],{k,1,n}]]],{n,1,10}]

Formula

T(1, 1) = 1,
T(n, r) = 0 if r < 0 or r > n*(n+1)/2,
T(n, 0) = T(n - 1, n) if n is even,
T(n, 0) = 0 if n is odd,
T(n, r) = T(n - 1, n - r) + (-1)^n*(T(n - 1, n + r) - T(n - 1, r - n)).