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.

A124222 Triangular array read by rows, with shape sequence A002865, generated from A123682.

Original entry on oeis.org

1, 1, 3, 5, 0, 9, 2, 13, 7, 1, 0, 19, 18, 4, 2, 25, 36, 12, 10, 0, 2, 0, 33, 64, 26, 32, 2, 11, 2, 1, 41, 103, 49, 78, 7, 40, 13, 6, 1, 0, 3, 0
Offset: 1

Views

Author

Alford Arnold, Oct 19 2006

Keywords

Comments

The shape sequence for A124222 is essentially A002865 since its columns are based on source partitions (1,22,33,222,44,332,2222,333,...). The row sum sequence for A124222 is essentially A001045.

Examples

			The array begins
1
1
3
5 0
9 2
13 7 1 0
19 18 4 2
25 36 12 10 0 2 0
33 64 26 32 2 11 2 1
41 103 49 78 7 40 13 6 1 0 3 0
		

Crossrefs

Cf. A001045 (row sums), A002865, A099392, A123682, A123683.

A132892 Square array T(m,n) read by antidiagonals; T(m,n) is the number of equivalence classes in the set of sequences of n nonnegative integers that sum to m, generated by the equivalence relation defined in the following manner: we write a sequence in the form a[1]0a[2]0...0a[p], where each a[i] is a (possibly empty) sequence of positive integers; two sequences in this form, a[1]0a[2]0...0a[p] and b[1]0b[2]0...0b[q] are said to be equivalent if p=q and b[1],b[2],...,b[q] is a cyclic permutation of a[1],a[2],...a[p].

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 5, 3, 1, 1, 5, 9, 7, 4, 1, 1, 6, 13, 14, 10, 4, 1, 1, 7, 19, 25, 22, 12, 5, 1, 1, 8, 25, 41, 42, 30, 15, 5, 1, 1, 9, 33, 63, 79, 66, 43, 19, 6, 1, 1, 10, 41, 92, 131, 132, 99, 55, 22, 6, 1, 1, 11, 51, 129, 213, 245, 217, 143, 73, 26, 7, 1, 1, 12, 61, 175, 325, 428, 429, 335, 201, 91, 31, 7, 1
Offset: 1

Views

Author

Emeric Deutsch and Ira M. Gessel, Oct 02 2007

Keywords

Comments

T(n,n) = A000108(n) (the Catalan numbers; see R. P. Stanley, Catalan addendum, problem starting "Equivalence classes of the equivalence relation ..."). T(m,m+1) = A007595(m+1); T(m,m+2) = A003441(m+1); T(m,m+3) = A003444(m+3); T(n+2,n) = A001453(n+1) (Catalan numbers - 1); T(m,1)=1; T(m,2)=m; T(m,3) = A080827(m) = A099392(m+1); T(m,4) = A004006(m).

Examples

			T(2,4) = 3 because we have {2000, 0200, 0020, 0002}, {1100, 0110, 0011} and {1010, 0101, 1001}.
T(4,2) = 4 because we have {40, 04}, {31}, {13} and {22}.
The square array starts:
  1....1.....1.....1......1.....1.....1...
  1....2.....3.....3......4.....4.....5...
  1....3.....5.....7.....10....12....15...
  1....4.....9....14.....22....30....43...
  1....5....13....25.....42....66....99...
		

Crossrefs

Programs

  • Maple
    with(numtheory): T:=proc(m,n) local r, div, N: r:=igcd(m,n+1): div:=divisors(r): N:=nops(div): (sum(phi(div[j])*(binomial((m+n+1)/div[j]-1,(n+1)/div[j]-1) -binomial(m/div[j]-1,(n+1)/div[j]-1)),j=1..N))/(n+1) end proc: for m to 12 do seq(T(m, n),n=1..12) end do; # yields the upper left 12 by 12 block of the infinite matrix T(m,n)
    # second Maple program:
    T:= proc(m, n) uses numtheory; (C-> add(phi(d)*(C((m+n+1)/d-1, (n+1)/d-1)
          -C(m/d-1, (n+1)/d-1))/(n+1), d=divisors(igcd(m, n+1))))(binomial)
        end:
    seq(seq(T(1+d-n, n), n=1..d), d=1..14);  # Alois P. Heinz, Jan 28 2025
  • Mathematica
    T[m_, n_] := Module[{r, div, N}, r = GCD[m, n + 1]; div = Divisors[r]; N = Length[div]; (Sum[EulerPhi[div[[j]]]*(Binomial[(m + n + 1)/div[[j]] - 1, (n + 1)/div[[j]] - 1] - Binomial[m/div[[j]] - 1, (n + 1)/div[[j]] - 1]), {j, 1, N}])/(n + 1)];
    Table[T[m - n + 1, n], {m, 1, 13}, {n, 1, m}] // Flatten (* Jean-François Alcover, Sep 01 2024, after Maple program *)

Formula

T(m,n) = Sum_{d | gcd(m,n+1)} phi(d)*(C((m+n+1)/d-1, (n+1)/d-1) - C(m/d-1, (n+1)/d-1))/(n+1). [corrected by Jason Yuen, Jan 28 2025]

A274323 Number of partitions of n^4 into at most two parts.

Original entry on oeis.org

1, 1, 9, 41, 129, 313, 649, 1201, 2049, 3281, 5001, 7321, 10369, 14281, 19209, 25313, 32769, 41761, 52489, 65161, 80001, 97241, 117129, 139921, 165889, 195313, 228489, 265721, 307329, 353641, 405001, 461761, 524289, 592961, 668169, 750313, 839809, 937081
Offset: 0

Views

Author

Colin Barker, Oct 13 2016

Keywords

Comments

Coefficient of x^(n^4) in 1/((1-x)*(1-x^2)).

Crossrefs

Cf. A099392 (n^2), A274324 (n^3), A274325 (n^5).
Cf. A008619.

Programs

  • PARI
    a(n) = (3+(-1)^n+2*n^4)/4
    
  • PARI
    b(n) = (3+(-1)^n+2*n)/4 \\ the coefficient of x^n in the g.f. 1/((1-x)*(1-x^2))
    vector(50, n, n--; b(n^4))

Formula

G.f.: (1 - 3*x + 10*x^2 + 10*x^3 + 5*x^4 + x^5) / ((1-x)^5*(1+x)).
a(n) = 4*a(n-1) - 5*a(n-2) + 5*a(n-4) - 4*a(n-5) + a(n-6) for n > 5.
a(n) = (3 + (-1)^n + 2*n^4)/4.
a(n) = A008619(n^4).
a(n) = 1 + floor(n^4/2). - Alois P. Heinz, Oct 13 2016
E.g.f.: ((2 + x + 7*x^2 + 6*x^3 + x^4)*cosh(x) + (1 + x + 7*x^2 + 6*x^3 + x^4)*sinh(x))/2. - Stefano Spezia, Mar 17 2024

A288797 Square array a(p,q) = p^2 + q^2 - 2*p - 2*q + 2*gcd(p,q), p >= 1, q >= 1, read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 4, 4, 4, 9, 5, 5, 9, 16, 12, 12, 12, 16, 25, 17, 13, 13, 17, 25, 36, 28, 20, 24, 20, 28, 36, 49, 37, 33, 25, 25, 33, 37, 49, 64, 52, 40, 36, 40, 36, 40, 52, 64, 81, 65, 53, 45, 41, 41, 45, 53, 65, 81, 100, 84, 72, 64, 52, 60, 52, 64, 72, 84, 100
Offset: 1

Views

Author

Luc Rousseau, Jun 16 2017

Keywords

Comments

In the Cartesian plane, let r(p,q) denote the rotation with center origin and angle associated to slope p/q (p: number of units upwards, q: number of units towards the right).
Let R(p,q) be the square of area p^2 + q^2 = R^2, with vertices (0,0), (0,R), (R,R), (R,0).
The natural unit squares (i.e., the (a,a+1) X (b,b+1) Cartesian products, with a and b integers) are transformed by r(p,q) into rotated unit squares.
a(p,q) is the number of rotated unit squares that fully land inside R(p,q).

Examples

			Table begins:
    0   1   4   9  16  25 ...
    1   4   5  12  17  28 ...
    4   5  12  13  20  33 ...
    9  12  13  24  25  36 ...
   16  17  20  25  40  41 ...
   25  28  33  36  41  60 ...
  ... ... ... ... ... ... ...
		

Crossrefs

Programs

  • Mathematica
    A[p_, q_] := p^2 + q^2 - 2*p - 2*q + 2*GCD[p, q];
    (* or, checking without the formula: *)
    okQ[{a_, b_}, p_, q_] := Module[{r2 = p^2 + q^2}, 0 <= a*q - b*p <= r2 && 0 <= a*p + b*q <= r2 && 0 <= a*q - b*p + q <= r2 && 0 <= a*p + b*q + p <= r2 && 0 <= a*q - (b + 1)*p <= r2 && 0 <= a*p + b*q + q <= r2 && 0 <= (a + 1)*q - (b + 1)*p <= r2 && 0 <= a*p + b*q + p + q <= r2];
    A[p_, q_] := Module[{r}, r = Reduce[okQ[{a, b}, p, q], {a, b}, Integers]; If[r[[0]] === And, 1, Length[r]]];
    Flatten[Table[A[p - q + 1, q], {p, 1, 11}, {q, 1, p}]] (* Jean-François Alcover, Jun 17 2017 *)
  • PARI
    a(p,q)=p^2+q^2-2*p-2*q+2*gcd(p,q)
    for(n=2,12,for(p=1,n-1,{q=n-p;print(a(p,q))}))

Formula

a(p,q) = p^2 + q^2 - 2*p - 2*q + 2*gcd(p,q).
a(p,1) = a(1,p) = (p-1)^2 = A000290(p-1).
a(p,p) = 2*p*(p-1) = 4*A000217(p-1).
a(p,p+1) = 2*p*(p-1)+1 = A001844(p-1).
a(p,p+2) = 2*p^2+2*gcd(2,p) = 2*p^2+3+(-1)^(p) = 4*A099392(p-1) = 4*A080827(p).
a(p,p+3) = 2*p^2+2*p+5+4*A079978(p) = 1+4*(1+A143101(p)).
a(p,2*p) = p*(5*p-4) = A051624(p).
a(p,3*p) = 2*p*(5*p-3) = 4*A000566(p).

A328005 Number of distinct coefficients in functional composition of 1 + x + ... + x^(n-1) with itself.

Original entry on oeis.org

0, 1, 2, 4, 8, 13, 19, 25, 33, 41, 51, 61, 73, 85, 99, 113, 129, 145, 163, 181, 201, 221, 243, 265, 289, 313, 339, 365, 393, 421, 451, 481, 513, 545, 579, 613, 649, 685, 723, 761, 801, 841, 883, 925, 969, 1013, 1059, 1105, 1153, 1201, 1251, 1301, 1353, 1405, 1459
Offset: 0

Views

Author

Vladimir Reshetnikov, Oct 01 2019

Keywords

Comments

Sum_{i=0..n-1} x^i = (x^n - 1)/(x - 1).

Examples

			For n = 4, the composition of 1 + x + x^2 + x^3 with itself is 1 + (1 + x + x^2 + x^3) + (1 + x + x^2 + x^3)^2 + (1 + x + x^2 + x^3)^3 = 4 + 6 x + 10 x^2 + 15 x^3 + 15 x^4 + 14 x^5 + 11 x^6 + 6 x^7 + 3 x^8 + x^9 that has 8 distinct coefficients [1, 3, 4, 6, 10, 11, 14, 15], so a(4) = 8.
The first few polynomials p_n(x) are 0, 1, x + 2, x^4 + 2*x^3 + 4*x^2 + 3*x + 3, ... with p_n(1) = A023037(n), n >= 0.
		

Crossrefs

Programs

  • Maple
    f:= n-> unapply(add(x^j, j=0..n-1), x):
    a:= n-> nops({coeffs(expand((f(n)@@2)(x)))} minus {0}):
    seq(a(n), n=0..60);  # Alois P. Heinz, Oct 01 2019
  • Mathematica
    Table[With[{s = Sum[x^k, {k, 0, n - 1}]}, Length[Union[CoefficientList[Expand[s /. x -> s], x]]]], {n, 0, 53}]
  • PARI
    a(n)={my(p=(1-x^n)/(1-x)); #Set(Vec(subst(p,x,p)))} \\ Andrew Howroyd, Oct 01 2019
    
  • SageMath
    def A328005(n):
        R. = PolynomialRing(ZZ)
        q = R(sum(x^k for k in range(n)))
        return len(Set(q.substitute(x=q).list()))
    print([A328005(n) for n in range(55)]) # Peter Luschny, Oct 02 2019

Formula

It appears that a(n) = (2*n^2 + (-1)^n + 3)/4 for n >= 5.
Conjectured g.f.: (x^7 - x^6 - x^5 + 2*x^3 + 1)*x/((x + 1)*(1 - x)^3).
Previous Showing 11-15 of 15 results.