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.

Showing 1-10 of 14 results. Next

A104575 Alternating sum of diagonals in A060177.

Original entry on oeis.org

1, -1, -2, -1, -1, 3, 1, 7, 4, 4, 4, 2, -9, -7, -7, -28, -17, -25, -15, -24, -11, -8, 34, 19, 53, 46, 108, 110, 106, 113, 122, 108, 75, 103, -16, -87, -107, -169, -329, -257, -574, -501, -676, -609, -749, -588, -808, -548, -521, -315, -240, 369, 485, 865, 1099, 1738, 2129, 2686, 3088, 3460, 4103, 4011, 4480, 3983
Offset: 0

Views

Author

Vladeta Jovovic, Apr 21 2005

Keywords

Comments

A090794(n) = (A000041(n)-a(n))/2. A092306(n) = (A000041(n)+a(n))/2.

Crossrefs

Convolution inverse of A006951.

Programs

  • Mathematica
    CoefficientList[Series[Product[(1-2x^k)/(1-x^k),{k,70}],{x,0,70}],x] (* Harvey P. Dale, Jan 21 2021 *)
  • PARI
    N=66; x='x+O('x^N); Vec(prod(k=1, N, 1-x^k/(1-x^k))) \\ Seiichi Manyama, Oct 05 2019

Formula

G.f.: Product_{i>0} (1 - 2*x^i)/(1 - x^i).
Euler transform of -A008965(n).

Extensions

a(0)=1 prepended by Seiichi Manyama, Oct 05 2019

A116608 Triangle read by rows: T(n,k) is number of partitions of n having k distinct parts (n>=1, k>=1).

Original entry on oeis.org

1, 2, 2, 1, 3, 2, 2, 5, 4, 6, 1, 2, 11, 2, 4, 13, 5, 3, 17, 10, 4, 22, 15, 1, 2, 27, 25, 2, 6, 29, 37, 5, 2, 37, 52, 10, 4, 44, 67, 20, 4, 44, 97, 30, 1, 5, 55, 117, 52, 2, 2, 59, 154, 77, 5, 6, 68, 184, 117, 10, 2, 71, 235, 162, 20, 6, 81, 277, 227, 36, 4, 82, 338, 309, 58, 1
Offset: 1

Views

Author

Emeric Deutsch, Feb 19 2006

Keywords

Comments

Row n has floor([sqrt(1+8n)-1]/2) terms (number of terms increases by one at each triangular number).
Row sums yield the partition numbers (A000041).
Row n has length A003056(n), hence the first element of column k is in row A000217(k). - Omar E. Pol, Jan 19 2014

Examples

			T(6,2) = 6 because we have [5,1], [4,2], [4,1,1], [3,1,1,1], [2,2,1,1] and [2,1,1,1,1,1] ([6], [3,3], [3,2,1], [2,2,2] and [1,1,1,1,1,1] do not qualify).
Triangle starts:
  1;
  2;
  2,  1;
  3,  2;
  2,  5;
  4,  6, 1;
  2, 11, 2;
  4, 13, 5;
  3, 17, 10;
  4, 22, 15, 1;
  ...
		

Crossrefs

Cf. A060177 (reflected rows). - Alois P. Heinz, Jan 29 2014
Cf. A274174.

Programs

  • Maple
    g:=product(1+t*x^j/(1-x^j),j=1..30)-1: gser:=simplify(series(g,x=0,27)): for n from 1 to 23 do P[n]:=sort(coeff(gser,x^n)) od: for n from 1 to 23 do seq(coeff(P[n],t^j),j=1..floor(sqrt(1+8*n)/2-1/2)) od; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, i) option remember; local j; if n=0 then 1
          elif i<1 then 0 else []; for j from 0 to n/i do zip((x, y)
          ->x+y, %, [`if`(j>0, 0, [][]), b(n-i*j, i-1)], 0) od; %[] fi
        end:
    T:= n-> subsop(1=NULL, [b(n, n)])[]:
    seq(T(n), n=1..30); # Alois P. Heinz, Nov 07 2012
    # third program
    nDiffParts := proc(L)
            nops(convert(L,set)) ;
    end proc:
    A116608 := proc(n,k)
            local a,L;
            a :=0 ;
            for L in combinat[partition](n) do
                    if nDiffParts(L) = k then
                            a := a+1 ;
                    end  if;
            end do:
            a ;
    end proc: # R. J. Mathar, Jun 07 2024
  • Mathematica
    p=Product[1+(y x^i)/(1-x^i),{i,1,20}];f[list_]:=Select[list,#>0&];Flatten[Map[f,Drop[CoefficientList[Series[p,{x,0,20}],{x,y}],1]]] (* Geoffrey Critzer, Nov 28 2011 *)
    Table[Length /@ Split[Sort[Length /@ Union /@ IntegerPartitions@n]], {n, 22}] // Flatten (* Robert Price, Jun 13 2020 *)
  • Python
    from math import isqrt
    from itertools import count, islice
    from sympy.utilities.iterables import partitions
    def A116608_gen(): # generator of terms
        return (sum(1 for p in partitions(n) if len(p)==k) for n in count(1) for k in range(1,(isqrt((n<<3)+1)-1>>1)+1))
    A116608_list = list(islice(A116608_gen(),30)) # Chai Wah Wu, Sep 14 2023
    
  • Python
    from functools import cache
    @cache
    def P(n: int, k: int, r: int) -> int:
        if n == 0: return 1 if k == 0 else 0
        if k == 0: return 0
        if r == 0: return 0
        return sum(P(n - r * j, k - 1, r - 1)
                   for j in range(1, n // r + 1)) + P(n, k, r - 1)
    def A116608triangle(rows: int) -> list[int]:
        return list(filter(None, [P(n, k, n) for n in range(1, rows)
                                  for k in range(1, n + 1)]))
    print(A116608triangle(22)) # Peter Luschny, Sep 14 2023, courtesy of Amir Livne Bar-on

Formula

G.f.: -1 + Product_{j=1..infinity} 1 + tx^j/(1-x^j).
T(n,1) = A000005(n) (number of divisors of n).
T(n,2) = A002133(n).
T(n,3) = A002134(n).
Sum_{k>=1} k * T(n,k) = A000070(n-1).
Sum_{k>=0} k! * T(n,k) = A274174(n). - Alois P. Heinz, Jun 13 2016
T(n + A000217(k), k) = A000712(n), for 0 <= n <= k [Briand]. - Álvar Ibeas, Nov 04 2020

A002133 Number of partitions of n with exactly two part sizes.

Original entry on oeis.org

0, 0, 1, 2, 5, 6, 11, 13, 17, 22, 27, 29, 37, 44, 44, 55, 59, 68, 71, 81, 82, 102, 97, 112, 109, 136, 126, 149, 141, 168, 157, 188, 176, 212, 182, 231, 207, 254, 230, 266, 241, 300, 259, 319, 283, 344, 295, 373, 311, 386, 352, 417, 353, 452, 368, 460, 418, 492, 413
Offset: 1

Views

Author

Keywords

Comments

Also number of solutions to the Diophantine equation ab + bc + cd = n, with a,b,c >= 1. - N. J. A. Sloane, Jun 17 2011
A generalized sum of divisors function.

Examples

			a(8) = 13 because we have 71, 62, 611, 53, 5111, 422, 41111, 332, 3311, 311111, 22211, 221111, 2111111.
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A060177.
Cf. A002134.

Programs

  • Maple
    g:=sum(sum(x^(i+j)/(1-x^i)/(1-x^j),j=1..i-1),i=1..80): gser:=series(g,x=0,65): seq(coeff(gser,x^n),n=1..60); # Emeric Deutsch, Mar 30 2006
    with(numtheory); D00:=n->add(tau(j)*tau(n-j),j=1..n-1); L3:=n->(D00(n)+tau(n)-sigma(n))/2; [seq(L3(n),n=1..60)]; # N. J. A. Sloane, Jun 17 2011
    A002133 := proc(n)
        A055507(n-1)+numtheory[tau](n)-numtheory[sigma](n) ;
        %/2 ;
    end proc: # R. J. Mathar, Jun 15 2022
    # Using function P from A365676:
    A002133 := n -> P(n, 2, n): seq(A002133(n), n = 1..59); # Peter Luschny, Sep 15 2023
  • Mathematica
    nn=50;ss=Sum[Sum[x^(i+j)/(1-x^i)/(1-x^j),{j,1,i-1}],{i,1,nn}];Drop[CoefficientList[Series[ss,{x,0,nn}],x],1]  (* Geoffrey Critzer, Sep 13 2012 *)
    Table[DivisorSigma[0, n] - DivisorSigma[1, n] + Sum[DivisorSigma[0, k]*DivisorSigma[0, n - k], {k, 1, n - 1}], {n, 1, 100}]/2 (* Vaclav Kotesovec, Aug 30 2025 *)
  • Python
    from sympy import divisor_count, divisor_sigma
    def A002133(n): return sum(divisor_count(j)*divisor_count(n-j) for j in range(1,(n-1>>1)+1)) + ((divisor_count(n+1>>1)**2 if n-1&1 else 0)+divisor_count(n)-divisor_sigma(n)>>1) # Chai Wah Wu, Sep 15 2023

Formula

G.f.: Sum_{i>=1} Sum_{j=1..i-1} x^(i+j)/((1-x^i)*(1-x^j)). - Emeric Deutsch, Mar 30 2006
Andrews gives a formula which is programmed up in the Maple code below. - N. J. A. Sloane, Jun 17 2011
G.f.: (G(x)^2-H(x))/2 where G(x) = Sum_{k>0} x^k/(1-x^k) and H(x) = Sum_{k>0} x^(2*k)/(1-x^k)^2. More generally, we obtain g.f. for number of partitions of n with m types of parts if we substitute x(i) with -Sum_{k>0}(x^n/(x^n-1))^i in cycle index Z(S(m); x(1),x(2),...,x(m)) of symmetric group S(m) of degree m. - Vladeta Jovovic, Sep 18 2007

A002134 Generalized divisor function. Number of partitions of n with exactly three part sizes.

Original entry on oeis.org

1, 2, 5, 10, 15, 25, 37, 52, 67, 97, 117, 154, 184, 235, 277, 338, 385, 469, 531, 630, 698, 810, 910, 1038, 1144, 1295, 1425, 1577, 1741, 1938, 2089, 2301, 2505, 2700, 2970, 3189, 3444, 3703, 4004, 4242, 4617, 4882, 5244, 5558, 5999, 6221, 6755, 7050, 7576
Offset: 6

Views

Author

Keywords

Examples

			a(8) = 5 because we have 5+2+1, 4+3+1, 4+2+1+1, 3+2+2+1, 3+2+1+1+1.
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A060177.
Column k=3 of A116608. - Alois P. Heinz, Nov 07 2012

Programs

  • Maple
    # Using function P from A365676:
    A002134 := n -> P(n, 3, n): seq(A002134(n), n = 6..54); # Peter Luschny, Sep 15 2023
  • Mathematica
    nn=40;sss=Sum[Sum[Sum[x^(i+j+k)/(1-x^i)/(1-x^j)/(1-x^k),{k,1,j-1}], {j,1,i-1}], {i,1,nn}]; Drop[CoefficientList[Series[sss,{x,0,nn}],x],6]  (* Geoffrey Critzer, Sep 13 2012 *)

Formula

G.f.: Sum_{i>=1} Sum_{j=1..i-1} Sum_{k=1..j-1} x^(i+j+k)/((1-x^i)*(1-x^j)* (1-x^k)). - Geoffrey Critzer, Sep 13 2012

Extensions

Better description and more terms from Naohiro Nomoto, Jan 24 2002
More terms from Vladeta Jovovic, Nov 02 2003

A060044 Triangle of generalized sum of divisors function, read by rows.

Original entry on oeis.org

1, -1, 1, 4, -1, -5, 1, 6, 1, 3, -4, -1, -2, 8, 1, 1, -13, -2, -5, 13, 1, 10, 23, -6, -1, -11, -25, 12, 1, 12, 27, -20, -2, -21, -49, 14, 3, 31, 74, -8, 1, 5, -13, -62, 24, -1, -4, 23, 85, -29, 1, 2, -42, -132, 18, -2, -8, 42, 165, -13, 3, 14, -42, -195, 20, -4, -20, 43, 229, -30
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2001

Keywords

Comments

Lengths of rows are 1 1 2 2 2 3 3 3 3 ... (A003056).

Examples

			Triangle turned on its side begins:
  1  -1   4  -5   6  -4   8 -13  13 ...
          1  -1   1   3  -2   1  -5 ...
                      1  -1   1  -2 ...
For example, T(8,3) = 1.
		

Crossrefs

Diagonals give A002129, A002130, A060045. Cf. A060043, A060177.
Cf. A003056.

Formula

T(n, k) = sum of (-1)^(k+s_1+s_2+...+s_k) * s_1*s_2*...*s_k where s_1, s_2, ..., s_k are such that s_1*m_1 + s_2*m_2 + ... + s_k*m_k = n and the sum is over all such k-partitions of n.
G.f. for k-th diagonal (the k-th row of the sideways triangle shown in the example): Sum_{ m_1 < m_2 < ... < m_k} q^(m_1+m_2+...+m_k)/((1+q^m_1)*(1+q^m_2)*...*(1+q^m_k))^2 = Sum_n T(n, k)*q^n.

Extensions

More terms from Naohiro Nomoto, Jan 24 2002

A060047 Triangle of generalized sum of divisors function, read by rows.

Original entry on oeis.org

1, 2, 4, 1, 4, 2, 6, 4, 8, 8, 8, 14, 8, 1, 18, 13, 2, 28, 12, 4, 40, 12, 8, 52, 16, 14, 70, 14, 24, 88, 16, 40, 104, 24, 1, 56, 140, 16, 2, 84, 168, 18, 4, 122, 196, 26, 8, 168, 240, 20, 14, 232, 278, 24, 24, 312, 320, 32, 40, 408, 380, 24, 64, 528, 440, 24, 100, 672, 504
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2001

Keywords

Comments

Lengths of rows are 1 1 1 2 2 2 2 2 3 3 3 3 3 3 3 ... (A000196).

Examples

			Triangle turned on its side begins:
  1  2  4  4  6  8  8  8 13 12 12 ...
           1  2  4  8 14 18 28 40 ...
                          1  2  4 ...
For example, T(6,1) = 8, T(6,2) = 4.
		

Crossrefs

Formula

T(n, k) = sum of s_1*s_2*...*s_k where s_1, s_2, ..., s_k are such that s_1*(2*m_1-1) + s_2*(2*m_2-1) + ... + s_k*(2*m_k-1) = n and the sum is over all such k-partitions of n.
G.f. for k-th diagonal (the k-th row of the sideways triangle shown in the example): Sum_{ m_1 < m_2 < ... < m_k} q^(2*m_1+2*m_2+...+2*m_k-k)/((1-q^{2*m_1-1})*(1-q^{2*m_2-1})*...*(1-q^{2*m_k-1}))^2 = Sum_n T(n, k)*q^n.
G.f. for k-th diagonal: (-1)^k * (1/k) * ( Sum_{j>=k} (-1)^j * j * binomial(j+k-1,2*k-1) * q^(j^2) ) / ( 1 + 2 * Sum_{j>=1} (-q)^(j^2) ). - Seiichi Manyama, Sep 15 2023

Extensions

More terms from Naohiro Nomoto, Jan 24 2002

A090794 Number of partitions of n such that the number of different parts is odd.

Original entry on oeis.org

1, 2, 2, 3, 2, 5, 4, 9, 13, 19, 27, 43, 54, 71, 102, 124, 161, 200, 257, 319, 400, 484, 618, 761, 956, 1164, 1450, 1806, 2226, 2741, 3367, 4137, 5020, 6163, 7485, 9042, 10903, 13172, 15721, 18956, 22542, 26925, 31935, 37962, 44861, 53183, 62651
Offset: 1

Views

Author

Vladeta Jovovic, Feb 12 2004

Keywords

Examples

			n=6 has A000041(6)=11 partitions: 6, 5+1, 4+2, 4+1+1, 3+3, 3+2+1, 3+1+1+1, 2+2+2, 2+2+1+1, 2+1+1+1+1 and 1+1+1+1+1+1 with partition sets: {6}, {1,5}, {2,4}, {1,4}, {3}, {1,2,3}, {1,3}, {2}, {1,2}, {1,2} and {1}, five of them have an odd number of elements, therefore a(6)=5.
		

Crossrefs

Programs

  • Haskell
    import Data.List (group)
    a090794 = length . filter odd . map (length . group) . ps 1 where
       ps x 0 = [[]]
       ps x y = [t:ts | t <- [x..y], ts <- ps t (y - t)]
    -- Reinhard Zumkeller, Dec 19 2013

Formula

a(n) = b(n, 1, 0, 0) with b(n, i, j, f) = if iReinhard Zumkeller, Feb 19 2004
G.f.: F(x)*G(x)/2, where F(x) = 1-Product(1-2*x^i, i=1..infinity) and G(x) = 1/Product(1-x^i, i=1..infinity).
a(n) = (A000041(n)-A104575(n))/2.
G.f. A(x) equals the off-diagonal entries in the 2 X 2 matrix Product_{n >= 1} [1, x^n/(1 - x^n); x^n/(1 - x^n), 1] = [B(x), A(x); A(x), B(x)], where B(x) is the g.f. of A092306. - Peter Bala, Feb 10 2021

Extensions

More terms from Reinhard Zumkeller, Feb 17 2004
Definition simplified and shortened by Jonathan Sondow, Oct 13 2013

A365676 Triangle read by rows: T(n, k) is the number of partitions of n having exactly k distinct part sizes, for 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 0, 2, 1, 0, 0, 3, 2, 0, 0, 0, 2, 5, 0, 0, 0, 0, 4, 6, 1, 0, 0, 0, 0, 2, 11, 2, 0, 0, 0, 0, 0, 4, 13, 5, 0, 0, 0, 0, 0, 0, 3, 17, 10, 0, 0, 0, 0, 0, 0, 0, 4, 22, 15, 1, 0, 0, 0, 0, 0, 0, 0, 2, 27, 25, 2, 0, 0, 0, 0, 0, 0, 0, 0, 6, 29, 37, 5, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Peter Luschny, Sep 15 2023

Keywords

Examples

			Triangle T(n, k) starts:
  [0] 1;
  [1] 0, 1;
  [2] 0, 2,  0;
  [3] 0, 2,  1,  0;
  [4] 0, 3,  2,  0, 0;
  [5] 0, 2,  5,  0, 0, 0;
  [6] 0, 4,  6,  1, 0, 0, 0;
  [7] 0, 2, 11,  2, 0, 0, 0, 0;
  [8] 0, 4, 13,  5, 0, 0, 0, 0, 0;
  [9] 0, 3, 17, 10, 0, 0, 0, 0, 0, 0;
		

Crossrefs

Variants: A116608 (nonzero terms), A060177.
Cf. A000041 (row sums), A000005 (T(n,1)), A002133 (T(n,2)), A002134 (T(n,3)), A365630 (T(n,4)), A365631 (T(n,5)).

Programs

  • Maple
    P := proc(n, k, r) option remember; local j;  # after Amir Livne Bar-on
      if n = 0 then return ifelse(k = 0, 1, 0) fi;
      if k = 0 or r = 0 then return 0 fi;
      add(P(n - r * j, k - 1, r - 1), j = 1..iquo(n, r)) + P(n, k, r - 1) end:
    A365676row := n -> local k; seq(P(n, k, n), k = 0..n):
    seq(print(A365676row(n)), n = 0..9);
    # Using the generating function:
    p := product(1 + t*x^j/(1 - x^j), j = 1..20):
    ser := series(p, x, 20):
    seq(seq(coeff(coeff(ser, x, n), t, k), k = 0..n), n = 0..9);
  • Mathematica
    P[n_, k_, r_] := P[n, k, r] = Which[n == 0, If[k == 0, 1, 0], k == 0 || r == 0, 0, True, Sum[P[n-r*j, k-1, r-1], {j, 1, Quotient[n, r]}]+P[n, k, r-1]]; A365676row[n_] := Table[P[n, k, n], {k, 0, n}]; Table[A365676row[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Oct 21 2023, from 1st Maple program *)
  • PARI
    T(n,k) = my(nb=0); forpart(p=n, if (#Set(p) == k, nb++)); nb; \\ Michel Marcus, Sep 17 2023
  • Python
    # after Amir Livne Bar-on
    from functools import cache
    @cache
    def P(n: int, k: int, r: int) -> int:
        if n == 0: return 1 if k == 0 else 0
        if k == 0 or r == 0: return 0
        return sum(P(n - r * j, k - 1, r - 1)
                   for j in range(1, n // r + 1)) + P(n, k, r - 1)
    def A365676Row(n) -> list[int]:
        return [P(n, k, n) for k in range(n + 1)]
    for n in range(10): print(A365676Row(n))
    

Formula

T(n, k) = [t^k][x^n] Product_{j>=1} (1 + t*x^j / (1 - x^j)).
T(n, k) = 0 for n>0 and k=0. T(n,k) = 0 for k > floor([sqrt(1+8n)-1]/2). - Chai Wah Wu, Sep 15 2023

A365630 Number of partitions of n with exactly four part sizes.

Original entry on oeis.org

1, 2, 5, 10, 20, 30, 52, 77, 117, 162, 227, 309, 414, 535, 692, 873, 1100, 1369, 1661, 2030, 2438, 2925, 3450, 4108, 4759, 5570, 6440, 7457, 8491, 9798, 11020, 12593, 14125, 15995, 17820, 20074, 22182, 24833, 27379, 30422, 33351, 36996, 40346, 44445, 48336, 53048, 57494
Offset: 10

Views

Author

Seiichi Manyama, Sep 13 2023

Keywords

Examples

			a(11) = 2 because we have 5+3+2+1, 4+3+2+1+1.
		

Crossrefs

A diagonal of A060177.
Column k=4 of A116608.

Programs

  • Maple
    # Using function P from A365676:
    A365630 := n -> P(n, 4, n): seq(A365630(n), n = 10..56); # Peter Luschny, Sep 15 2023
  • Python
    from sympy.utilities.iterables import partitions
    def A365630(n): return sum(1 for p in partitions(n) if len(p)==4) # Chai Wah Wu, Sep 14 2023

Formula

G.f.: Sum_{0

A365631 Number of partitions of n with exactly five part sizes.

Original entry on oeis.org

1, 2, 5, 10, 20, 36, 58, 95, 147, 222, 323, 462, 636, 889, 1184, 1584, 2060, 2686, 3403, 4353, 5433, 6768, 8319, 10230, 12363, 15011, 17943, 21467, 25403, 30044, 35231, 41294, 48002, 55718, 64328, 74086, 84880, 97071, 110607, 125692, 142313, 160728, 181112, 203438, 228124
Offset: 15

Author

Seiichi Manyama, Sep 13 2023

Keywords

Examples

			a(16) = 2 because we have 6+4+3+2+1, 5+4+3+2+1+1.
		

Crossrefs

A diagonal of A060177.
Column k=5 of A116608.
Cf. A364809.

Programs

  • Maple
    # Using function P from A365676:
    A365631 := n -> P(n, 5, n): seq(A365631(n), n = 15..59); # Peter Luschny, Sep 15 2023
  • Python
    from sympy.utilities.iterables import partitions
    def A365631(n): return sum(1 for p in partitions(n) if len(p)==5) # Chai Wah Wu, Sep 14 2023

Formula

G.f.: Sum_{0
Showing 1-10 of 14 results. Next