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 23 results. Next

A304442 Number of partitions of n in which the sequence of the sum of the same summands is constant.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 5, 2, 7, 3, 5, 2, 13, 2, 5, 4, 11, 2, 13, 2, 12, 4, 5, 2, 28, 3, 5, 5, 12, 2, 18, 2, 17, 4, 5, 4, 44, 2, 5, 4, 24, 2, 18, 2, 12, 10, 5, 2, 63, 3, 9, 4, 12, 2, 34, 4, 24, 4, 5, 2, 67, 2, 5, 10, 27, 4, 18, 2, 12, 4, 14, 2, 120, 2, 5, 7, 12, 4, 18, 2, 54
Offset: 0

Views

Author

Seiichi Manyama, May 12 2018

Keywords

Comments

Said differently, these are partitions whose run-sums are all equal. - Gus Wiseman, Jun 25 2022

Examples

			a(72) = binomial(d(72),1) + binomial(d(36),2) + binomial(d(24),3) + binomial(d(18),4) + binomial(d(12),6) = 12 + 36 + 56 + 15 + 1 = 120, where d(n) is the number of divisors of n.
--+----------------------+-----------------------------------------
n |                      | Sequence of the sum of the same summands
--+----------------------+-----------------------------------------
1 | 1                    | 1
2 | 2                    | 2
  | 1+1                  | 2
3 | 3                    | 3
  | 1+1+1                | 3
4 | 4                    | 4
  | 2+2                  | 4
  | 2+1+1                | 2, 2
  | 1+1+1+1              | 4
5 | 5                    | 5
  | 1+1+1+1+1            | 5
6 | 6                    | 6
  | 3+3                  | 6
  | 3+1+1+1              | 3, 3
  | 2+2+2                | 6
  | 1+1+1+1+1+1          | 6
		

Crossrefs

All parts are divisors of n, see A018818, compositions A100346.
For run-lengths instead of run-sums we have A047966, compositions A329738.
These partitions are ranked by A353833.
The distinct instead of equal version is A353837, ranked by A353838, compositions A353850.
The version for compositions is A353851, ranked by A353848.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],SameQ@@Total/@Split[#]&]],{n,0,15}] (* Gus Wiseman, Jun 25 2022 *)
  • PARI
    a(n) = if (n==0, 1, sumdiv(n, d, binomial(numdiv(n/d), d))); \\ Michel Marcus, May 13 2018

Formula

a(n) >= 2 for n > 1.
a(n) = Sum_{d|n} binomial(A000005(n/d), d) for n > 0.

A353851 Number of integer compositions of n with all equal run-sums.

Original entry on oeis.org

1, 1, 2, 2, 5, 2, 8, 2, 12, 5, 8, 2, 34, 2, 8, 8, 43, 2, 52, 2, 70, 8, 8, 2, 282, 5, 8, 18, 214, 2, 386, 2, 520, 8, 8, 8, 1957, 2, 8, 8, 2010, 2, 2978, 2, 3094, 94, 8, 2, 16764, 5, 340, 8, 12310, 2, 26514, 8, 27642, 8, 8, 2, 132938, 2, 8, 238, 107411, 8, 236258
Offset: 0

Views

Author

Gus Wiseman, May 31 2022

Keywords

Comments

Every sequence can be uniquely split into a sequence of non-overlapping runs. For example, the runs of (2,2,1,1,1,3,2,2) are ((2,2),(1,1,1),(3),(2,2)), with sums (4,3,3,4).

Examples

			The a(0) = 1 through a(8) = 12 compositions:
  ()  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
           (11)  (111)  (22)    (11111)  (33)      (1111111)  (44)
                        (112)            (222)                (224)
                        (211)            (1113)               (422)
                        (1111)           (2112)               (2222)
                                         (3111)               (11114)
                                         (11211)              (41111)
                                         (111111)             (111122)
                                                              (112112)
                                                              (211211)
                                                              (221111)
                                                              (11111111)
For example:
  (1,1,2,1,1) has run-sums (2,2,2) so is counted under a(6).
  (4,1,1,1,1,2,2) has run-sums (4,4,4) so is counted under a(12).
  (3,3,2,2,2) has run-sums (6,6) so is counted under a(12).
		

Crossrefs

The version for parts or runs instead of run-sums is A000005.
The version for multiplicities instead of run-sums is A098504.
All parts are divisors of n, see A100346.
The version for partitions is A304442, ranked by A353833.
The version for run-lengths instead of run-sums is A329738, ptns A047966.
These compositions are ranked by A353848.
The distinct instead of equal version is A353850.
A003242 counts anti-run compositions, ranked by A333489.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A353847 represents the composition run-sum transformation.
For distinct instead of equal run-sums: A032020, A098859, A242882, A329739, A351013, A353837, ranked by A353838 (complement A353839), A353852, A354580, ranked by A354581.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@ IntegerPartitions[n],SameQ@@Total/@Split[#]&]],{n,0,15}]
  • PARI
    a(n) = {if(n <=1, return(1)); my(d = divisors(n), res = 0); for(i = 1, #d, nd = numdiv(d[i]); res+=(nd*(nd-1)^(n/d[i]-1)) ); res } \\ David A. Corneth, Jun 02 2022

Formula

From David A. Corneth, Jun 02 2022 (Start)
a(p) = 2 for prime p.
a(p*q) = 8 for distinct primes p and q (Cf. A006881).
a(n) = Sum_{d|n} tau(d)*(tau(d)-1) ^ (n/d - 1) where tau = A000005. (End)

Extensions

More terms from David A. Corneth, Jun 02 2022

A271654 a(n) = Sum_{k|n} binomial(n-1,k-1).

Original entry on oeis.org

1, 2, 2, 5, 2, 17, 2, 44, 30, 137, 2, 695, 2, 1731, 1094, 6907, 2, 30653, 2, 97244, 38952, 352739, 2, 1632933, 10628, 5200327, 1562602, 20357264, 2, 87716708, 2, 303174298, 64512738, 1166803145, 1391282, 4978661179, 2, 17672631939, 2707475853, 69150651910, 2, 286754260229, 2, 1053966829029, 115133177854, 4116715363847, 2, 16892899722499, 12271514, 63207357886437
Offset: 1

Views

Author

Keywords

Comments

Also the number of compositions of n whose length divides n, i.e., compositions with integer mean, ranked by A096199. - Gus Wiseman, Sep 28 2022

Examples

			From _Gus Wiseman_, Sep 28 2022: (Start)
The a(1) = 1 through a(6) = 17 compositions with integer mean:
  (1)  (2)    (3)      (4)        (5)          (6)
       (1,1)  (1,1,1)  (1,3)      (1,1,1,1,1)  (1,5)
                       (2,2)                   (2,4)
                       (3,1)                   (3,3)
                       (1,1,1,1)               (4,2)
                                               (5,1)
                                               (1,1,4)
                                               (1,2,3)
                                               (1,3,2)
                                               (1,4,1)
                                               (2,1,3)
                                               (2,2,2)
                                               (2,3,1)
                                               (3,1,2)
                                               (3,2,1)
                                               (4,1,1)
                                               (1,1,1,1,1,1)
(End)
		

Crossrefs

Cf. A056045.
The version for nonempty subsets is A051293, geometric A326027.
The version for partitions is A067538, ranked by A316413, strict A102627.
These compositions are ranked by A096199.
The version for factorizations is A326622, geometric A326028.
A011782 counts compositions.
A067539 = partitions w integer geo mean, ranked by A326623, strict A326625.
A100346 counts compositions into divisors, partitions A018818.

Programs

  • Maple
    a:= n-> add(binomial(n-1, d-1), d=numtheory[divisors](n)):
    seq(a(n), n=1..50);  # Alois P. Heinz, Dec 03 2023
  • Mathematica
    Table[Length[Join @@ Permutations/@Select[IntegerPartitions[n],IntegerQ[Mean[#]]&]],{n,15}] (* Gus Wiseman, Sep 28 2022 *)
  • PARI
    a(n)=sumdiv(n,k,binomial(n-1,k-1))

A294138 Number of compositions (ordered partitions) of n into proper divisors of n.

Original entry on oeis.org

1, 0, 1, 1, 5, 1, 24, 1, 55, 19, 128, 1, 1627, 1, 741, 449, 5271, 1, 45315, 1, 83343, 3320, 29966, 1, 5105721, 571, 200389, 26425, 5469758, 1, 154004510, 1, 47350055, 226019, 9262156, 51885, 15140335649, 1, 63346597, 2044894, 14700095925, 1, 185493291000, 1, 35539518745, 478164162
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 23 2017

Keywords

Examples

			a(4) = 5 because 4 has 3 divisors {1, 2, 4} among which 2 are proper divisors {1, 2} therefore we have [2, 2], [2, 1, 1], [1, 2, 1], [1, 1, 2] and [1, 1, 1, 1].
		

Crossrefs

Programs

  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[d[[k]] != n] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 45}]

Formula

a(n) = [x^n] 1/(1 - Sum_{d|n, d < n} x^d).
a(n) = A100346(n) - 1.

A300702 Number of compositions (ordered partitions) of n into parts that do not divide n.

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 0, 7, 2, 7, 7, 54, 2, 143, 33, 47, 30, 986, 23, 2583, 58, 1018, 828, 17710, 32, 23866, 3917, 14586, 1368, 317810, 248, 832039, 5902, 188953, 85038, 1505979, 602, 14930351, 393663, 2350986, 13524, 102334154, 16401, 267914295, 431711, 4438212, 8400611, 1836311902
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 11 2018

Keywords

Examples

			a(7) = 7 because we have [5, 2], [4, 3], [3, 4], [3, 2, 2], [2, 5], [2, 3, 2] and [2, 2, 3].
		

Crossrefs

Programs

  • Maple
    a:= proc(m) option remember; local b; b:= proc(n)
          option remember; `if`(n=0, 1, add(`if`(
          irem(m, j)=0, 0, b(n-j)), j=2..n)) end; b(m)
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 11 2018
  • Mathematica
    Table[SeriesCoefficient[1/(1 - Sum[Boole[Mod[n, k] != 0] x^k, {k, 1, n}]), {x, 0, n}], {n, 0, 47}]

A284464 Number of compositions (ordered partitions) of n into squarefree divisors of n.

Original entry on oeis.org

1, 1, 2, 2, 5, 2, 25, 2, 34, 19, 129, 2, 1046, 2, 742, 450, 1597, 2, 44254, 2, 27517, 3321, 29967, 2, 1872757, 571, 200390, 18560, 854850, 2, 154004511, 2, 3524578, 226020, 9262157, 51886, 3353855285, 2, 63346598, 2044895, 1255304727, 2, 185493291001, 2, 1282451595, 345852035, 2972038875, 2, 6006303471178
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 27 2017

Keywords

Examples

			a(4) = 5 because 4 has 3 divisors {1, 2, 4} among which 2 are squarefree {1, 2} therefore we have [2, 2], [2, 1, 1], [1, 2, 1], [1, 2, 2] and [1, 1, 1, 1].
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; local b, l;
          l, b:= select(issqrfree, divisors(n)),
          proc(m) option remember; `if`(m=0, 1,
             add(`if`(j>m, 0, b(m-j)), j=l))
          end; b(n)
        end:
    seq(a(n), n=0..50);   # Alois P. Heinz, Mar 30 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[MoebiusMu[d[[k]]]^2 x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 48}]
  • Python
    from sympy import divisors
    from sympy.ntheory.factor_ import core
    from sympy.core.cache import cacheit
    @cacheit
    def a(n):
        l=[x for x in divisors(n) if core(x)==x]
        @cacheit
        def b(m): return 1 if m==0 else sum(b(m - j) for j in l if j <= m)
        return b(n)
    print([a(n) for n in range(51)]) # Indranil Ghosh, Aug 01 2017, after Maple code

Formula

a(n) = [x^n] 1/(1 - Sum_{d|n, |mu(d)| = 1} x^d), where mu(d) is the Moebius function (A008683).
a(n) = 2 if n is a prime.

A284465 Number of compositions (ordered partitions) of n into prime power divisors of n (not including 1).

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 2, 1, 6, 2, 2, 1, 36, 1, 2, 2, 56, 1, 90, 1, 201, 2, 2, 1, 4725, 2, 2, 20, 1085, 1, 15778, 1, 5272, 2, 2, 2, 476355, 1, 2, 2, 270084, 1, 302265, 1, 35324, 3910, 2, 1, 67279595, 2, 14047, 2, 219528, 1, 5863044, 2, 14362998, 2, 2, 1, 47466605656, 1, 2, 35662, 47350056, 2, 119762253, 1, 9479643
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 27 2017

Keywords

Examples

			a(8) = 6 because 8 has 4 divisors {1, 2, 4, 8} among which 3 are prime powers > 1 {2, 4, 8} therefore we have [8], [4, 4], [4, 2, 2], [2, 4, 2], [2, 2, 4] and [2, 2, 2, 2].
		

Crossrefs

Programs

  • Maple
    F:= proc(n) local f,G;
          G:= 1/(1 - add(add(x^(f[1]^j),j=1..f[2]),f = ifactors(n)[2]));
          coeff(series(G,x,n+1),x,n);
    end proc:
    map(F, [$0..100]); # Robert Israel, Mar 29 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[PrimePowerQ[d[[k]]]] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 68}]
  • Python
    from sympy import divisors, primefactors
    from sympy.core.cache import cacheit
    @cacheit
    def a(n):
        l=[x for x in divisors(n) if len(primefactors(x))==1]
        @cacheit
        def b(m): return 1 if m==0 else sum(b(m - j) for j in l if j <= m)
        return b(n)
    print([a(n) for n in range(71)]) # Indranil Ghosh, Aug 01 2017

Formula

a(n) = [x^n] 1/(1 - Sum_{p^k|n, p prime, k>=1} x^(p^k)).
a(n) = 1 if n is a prime.
a(n) = 2 if n is a semiprime.

A294137 Number of compositions (ordered partitions) of n into nontrivial divisors of n.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 2, 0, 5, 1, 2, 0, 50, 0, 2, 2, 55, 0, 185, 0, 243, 2, 2, 0, 8903, 1, 2, 19, 1219, 0, 48824, 0, 5271, 2, 2, 2, 1323569, 0, 2, 2, 369182, 0, 1659512, 0, 36636, 5111, 2, 0, 254187394, 1, 53535, 2, 223502, 0, 65005979, 2, 16774462, 2, 2, 0, 235105418684, 0, 2, 41386, 47350055, 2
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 23 2017

Keywords

Examples

			a(8) = 5 because 8 has 4 divisors {1, 2, 4, 8} among which 2 are nontrivial divisors {2, 4} therefore we have [4, 4], [4, 2, 2], [2, 4, 2], [2, 2, 4] and [2, 2, 2, 2].
		

Crossrefs

Programs

  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[d[[k]] != 1 && d[[k]] != n] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 65}]

Formula

a(n) = [x^n] 1/(1 - Sum_{d|n, 1 < d < n} x^d).

A331927 Number of compositions (ordered partitions) of n into distinct divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 31, 1, 1, 1, 1, 1, 31, 1, 25, 1, 1, 1, 895, 1, 1, 1, 121, 1, 151, 1, 1, 1, 1, 1, 1135, 1, 1, 1, 865, 1, 31, 1, 1, 1, 1, 1, 11935, 1, 1, 1, 1, 1, 151, 1, 841, 1, 1, 1, 129439, 1, 1, 1, 1, 1, 127, 1, 1, 1, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 01 2020

Keywords

Examples

			a(6) = 7 because we have [6], [3, 2, 1], [3, 1, 2], [2, 3, 1], [2, 1, 3], [1, 3, 2] and [1, 2, 3].
		

Crossrefs

Programs

  • PARI
    a(n)={if(n==0, 1, my(v=divisors(n)); subst(serlaplace(polcoef(prod(i=1, #v, 1 + y*x^v[i] + O(x*x^n)), n)), y, 1))} \\ Andrew Howroyd, Feb 01 2020

Formula

a(n) = A331928(n) + 1 for n > 0.

A284463 Number of compositions (ordered partitions) of n into prime divisors of n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 12, 1, 2, 2, 1, 1, 65, 1, 23, 2, 2, 1, 351, 1, 2, 1, 38, 1, 15778, 1, 1, 2, 2, 2, 10252, 1, 2, 2, 1601, 1, 302265, 1, 80, 750, 2, 1, 299426, 1, 13404, 2, 107, 1, 1618192, 2, 5031, 2, 2, 1, 707445067, 1, 2, 2398, 1, 2, 119762253, 1, 173, 2, 39614048, 1, 255418101, 1, 2, 154603
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 27 2017

Keywords

Examples

			a(6) = 2 because 6 has 4 divisors {1, 2, 3, 6} among which 2 are primes {2, 3} therefore we have [3, 3] and [2, 2, 2].
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local b, l;
          l, b:= numtheory[factorset](n),
          proc(m) option remember; `if`(m=0, 1,
             add(`if`(j>m, 0, b(m-j)), j=l))
          end; b(n)
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 28 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[PrimeQ[d[[k]]]] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 75}]
  • Python
    from sympy import divisors, isprime
    from sympy.core.cache import cacheit
    @cacheit
    def a(n):
        l=[x for x in divisors(n) if isprime(x)]
        @cacheit
        def b(m): return 1 if m==0 else sum(b(m - j) for j in l if j <= m)
        return b(n)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Aug 01 2017, after Maple code

Formula

a(n) = [x^n] 1/(1 - Sum_{p|n, p prime} x^p).
a(n) = 1 if n is a prime power > 1.
a(n) = 2 if n is a squarefree semiprime.
Showing 1-10 of 23 results. Next