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.

Previous Showing 11-15 of 15 results.

A301703 a(n) is the number of positive coefficients of the polynomial (x-1)*(x^2-1)*...*(x^n-1).

Original entry on oeis.org

1, 2, 3, 3, 6, 6, 9, 13, 16, 18, 21, 27, 34, 32, 42, 47, 54, 62, 73, 79, 85, 96, 104, 113, 123, 140, 150, 171, 174, 190, 200, 211, 234, 240, 263, 275, 301, 304, 322, 351, 368, 396, 413, 455, 451, 470, 487, 499, 531, 540, 592, 585, 631, 630, 687, 691, 734, 774, 793, 863
Offset: 1

Views

Author

Ovidiu Bagdasar, Mar 25 2018

Keywords

Examples

			Denote P_n(x) = (x-1)...(x^n-1).
P_1(x) = x-1, hence a(1)=1.
P_2(x) = (x-1)*(x^2-1) = x^3-x^2-x+1, hence a(2)=2;
P_3(x) = (x-1)*(x^2-1)*(x^3-1) = x^6-x^5-x^4+x^2+x-1, hence a(3)=3;
P_4(x) = (x-1)*(x^2-1)*(x^3-1)*(x^4-1) = x^10 - x^9 - x^8+2x^5-x^2-x+1, hence a(4)=3.
		

Crossrefs

Cf. A231599: a(n) is the number of positive coefficients in row n.

Programs

  • Maple
    a:= n-> nops(select(x-> x>0, [(p-> seq(coeff(p, x, i),
          i=0..degree(p)))(expand(mul(x^i-1, i=1..n)))])):
    seq(a(n), n=1..60);  # Alois P. Heinz, Mar 29 2019
  • Mathematica
    Table[Count[CoefficientList[Expand[Times@@(x^Range[n]-1)],x],?(#>0&)],{n,60}] (* _Harvey P. Dale, Feb 10 2019 *)
  • PARI
    a(n) = #select(x->(x>0), Vec((prod(k=1, n, (x^k-1))))); \\ Michel Marcus, Apr 02 2018

A301704 a(n) is the number of negative coefficients of polynomial (x-1)*(x^2-1)*...*(x^n-1).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 21, 26, 34, 32, 42, 50, 54, 64, 73, 82, 85, 96, 104, 116, 123, 134, 150, 162, 174, 182, 200, 216, 234, 252, 263, 286, 301, 322, 322, 340, 368, 376, 413, 414, 451, 460, 487, 518, 531, 580, 592, 638, 631, 684, 687, 728, 734, 744, 793, 800, 859, 854, 917, 936, 977, 1000, 1037, 1088, 1108, 1166
Offset: 1

Views

Author

Ovidiu Bagdasar, Mar 25 2018

Keywords

Examples

			Denote P_n(x) = (x-1)...(x^n-1).
P_1(x) = x-1, hence a(1)=1.
P_2(x) = (x-1)*(x^2-1) = x^3-x^2-x+1, hence a(2)=2;
P_3(x) = (x-1)*(x^2-1)*(x^3-1) = x^6-x^5-x^4+x^2+x-1, hence a(3)=3;
P_4(x) = (x-1)*(x^2-1)*(x^3-1)*(x^4-1) = x^10 - x^9 - x^8+2x^5-x^2-x+1, hence a(4)=4.
		

Crossrefs

Cf. A231599: Row n represents coefficients of (-1)^n*P_n(x).

Programs

  • Maple
    a:= n-> add(`if`(i<0, 1, 0), i=[(p-> seq(coeff(p, x, i),
             i=0..degree(p)))(expand(mul(x^i-1, i=1..n)))]):
    seq(a(n), n=1..70);  # Alois P. Heinz, Mar 29 2019
  • Mathematica
    Rest@ Array[Count[CoefficientList[Times @@ Array[x^# - 1 &, # - 1], x], ?(# < 0 &)] &, 71] (* _Michael De Vlieger, Mar 29 2019 *)
  • PARI
    a(n) = #select(x->(x<0), Vec((prod(k=1, n, (x^k-1))))); \\ Michel Marcus, Apr 02 2018

Extensions

Missing term 414 inserted by Alois P. Heinz, Mar 29 2019

A301705 a(n) is the number of zero coefficients of the polynomial (x-1)*(x^2-1)*...*(x^n-1) below the leading coefficient.

Original entry on oeis.org

0, 0, 1, 4, 4, 8, 11, 12, 14, 20, 25, 26, 24, 42, 37, 40, 46, 46, 45, 50, 62, 62, 69, 72, 80, 78, 79, 74, 88, 94, 97, 102, 94, 104, 105, 106, 102, 116, 137, 130, 126, 132, 121, 122, 134, 152, 155, 160, 164, 156, 143, 156, 170, 172, 167, 178, 186, 194, 185, 168, 174, 176, 183, 182, 192, 194, 205, 196, 200, 188
Offset: 1

Views

Author

Ovidiu Bagdasar, Mar 25 2018

Keywords

Examples

			Denote P_n(x) = (x-1)...(x^n-1).
P_1(x) = x-1, hence a(1)=0.
P_2(x) = (x-1)*(x^2-1) = x^3-x^2-x+1, hence a(2)=0;
P_3(x) = (x-1)*(x^2-1)*(x^3-1) = x^6-x^5-x^4+x^2+x-1, hence a(3)=1;
P_4(x) = (x-1)*(x^2-1)*(x^3-1)*(x^4-1) = x^10 - x^9 - x^8+2x^5-x^2-x+1, hence a(4)=4.
		

Crossrefs

Programs

  • Maple
    a:= n-> add(`if`(i=0, 1, 0), i=[(p-> seq(coeff(p, x, i),
             i=0..degree(p)))(expand(mul(x^i-1, i=1..n)))]):
    seq(a(n), n=1..70);  # Alois P. Heinz, Mar 29 2019
  • Mathematica
    Rest@ Array[Count[CoefficientList[Times @@ Array[x^# - 1 &, # - 1], x], ?(# == 0 &)] &, 71] (* _Michael De Vlieger, Mar 29 2019 *)
  • PARI
    a(n) = #select(x->(x==0), Vec((prod(k=1, n, (x^k-1))))); \\ Michel Marcus, Apr 02 2018

Formula

a(n) = 1+n(n+1)/2-A086781(n).

A282938 Recursive 2-parameter sequence allowing calculation of the Möbius function (not the same as A266378).

Original entry on oeis.org

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

Views

Author

Gevorg Hmayakyan, Feb 25 2017

Keywords

Comments

The a(n,m) forms a table where each row has (n-1)*(n-2)/2+1 = A000124(n-2) elements.
The index of the first row is n=1 and the index of the first column is m=0.
The right diagonal a(n, A000217(n-2)) = A008683(n), Möbius numbers, for n>=1.

Examples

			The first few rows starting from 1 follow:
  1
  -1
  1, -1
  -1, 2, -1, 0
  1, -2, 1, 0, -1, 2, -1
  -1, 3, -2, -1, 1, -1, 1, 1, 0, -2, 1
  1, -2, 1, 0, -1, 1, -1, 3, -1, 0, -1, -2, 1, 1, 1, -1
  -1, 3, -2, -1, 1, -1, 2, -2, 1, 1, 0, 0, -1, -3, 2, 2, 0, 0, -2, 1, 0, 0
		

Crossrefs

Programs

  • Mathematica
    nu[n_]:=(n-1)*(n-2)/2
    U[n_, m_] := U[n, m] = If[n > 1, U[n - 1, m - n + 1] - U[n - 1, m], 0]
    U[1, m_] := U[1, m] = If[m == 0, 1, 0]
    a[n_, m_] := a[n, m] = If[(m < 0) || (nu[n] < m), 0, a[n - 1, m - n + 1] - a[n - 1, m] - a[n - 1, nu[n - 1]]*U[n - 1, m - 1]]
    a[1, m_] := a[1, m] = If[m == 0, 1, 0]
    Table[Table[a[n, m], {m, 0, nu[n]}], {n, 1, 30}]
    Table[a[n, nu[n]], {n, 1, 50}]

Formula

a(n,m) = a(n-1, m-n+1) - a(n-1, m) - a(n-1, nu(n-1))*U(n-1, m-1),
where U(n,m) are coefficients of A231599, nu(n)=(n-1)*(n-2)/2, a(1,0)=1, a(n,m)=0 if m<0 and m>nu(n).
Möbius(n) = a(n,nu(n)).

A380385 Triangle read by rows. T(1, 1) = 1, T(n, k) = [n >= k](Sum_{i=1..k-1} T[n - i, k - 1] - Sum_{i=1..n-1} T[n - i, k]).

Original entry on oeis.org

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

Views

Author

Mats Granvik, Jan 23 2025

Keywords

Comments

For n >= 1 the row sum of row n appears to be -A010815(n). See the Mathematica program for exact formulation of the recurrence.

Examples

			{
{1},
{0,  1},
{0, -1,  1},
{0,  0, -1,  1},
{0,  0, -1, -1,  1},
{0,  0,  1, -1, -1,  1},
{0,  0,  0,  0, -1, -1,  1},
{0,  0,  0,  1,  0, -1, -1,  1},
{0,  0,  0,  1,  0,  0, -1, -1,  1},
{0,  0,  0, -1,  2,  0,  0, -1, -1,  1},
{0,  0,  0,  0,  0,  1,  0,  0, -1, -1,  1},
{0,  0,  0,  0,  0,  1,  1,  0,  0, -1, -1,  1}
}
		

Crossrefs

Programs

  • Mathematica
    nn = 12; t[n_, 1] = If[n == 1, 1, 0]; t[n_, k_] := t[n, k] = If[n >= k, Sum[t[n - i, k - 1], {i, 1, k - 1}] - Sum[t[n - i, k], {i, 1, n - 1}], 0]; Table[Table[t[n, k], {k, 1, n}], {n, 1, nn}]; Flatten[%]
    nn = 12; Table[Table[If[n == k, 1, Coefficient[Product[(1 - x^i), {i, k - 1}], x^(n - k)]], {k, 1, n}], {n, 1, nn}] // Flatten (* Conjectured after A231599. - Mats Granvik, Jan 25 2025 *)
Previous Showing 11-15 of 15 results.