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-8 of 8 results.

A342528 Number of compositions with alternating parts weakly decreasing (or weakly increasing).

Original entry on oeis.org

1, 1, 2, 4, 7, 12, 20, 32, 51, 79, 121, 182, 272, 399, 582, 839, 1200, 1700, 2394, 3342, 4640, 6397, 8771, 11955, 16217, 21878, 29386, 39285, 52301, 69334, 91570, 120465, 157929, 206313, 268644, 348674, 451185, 582074, 748830, 960676, 1229208, 1568716, 1997064
Offset: 0

Views

Author

Gus Wiseman, Mar 24 2021

Keywords

Comments

These are finite sequences q of positive integers summing to n such that q(i) >= q(i+2) for all possible i.
The strict case (alternating parts are strictly decreasing) is A000041. Is there a bijective proof?
Yes. Construct a Ferrers diagram by placing odd parts horizontally and even parts vertically in a fishbone pattern. The resulting Ferrers diagram will be for an ordinary partition and the process is reversible. It does not appear that this method can be applied to give a formula for this sequence. - Andrew Howroyd, Mar 25 2021

Examples

			The a(1) = 1 through a(6) = 20 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (13)    (14)     (15)
             (21)   (22)    (23)     (24)
             (111)  (31)    (32)     (33)
                    (121)   (41)     (42)
                    (211)   (131)    (51)
                    (1111)  (212)    (141)
                            (221)    (222)
                            (311)    (231)
                            (1211)   (312)
                            (2111)   (321)
                            (11111)  (411)
                                     (1212)
                                     (1311)
                                     (2121)
                                     (2211)
                                     (3111)
                                     (12111)
                                     (21111)
                                     (111111)
		

Crossrefs

The even-length case is A114921.
The version with alternating parts unequal is A224958 (unordered: A000726).
The version with alternating parts equal is A342527.
A000041 counts weakly increasing (or weakly decreasing) compositions.
A000203 adds up divisors.
A002843 counts compositions with all adjacent parts x <= 2y.
A003242 counts anti-run compositions.
A069916/A342492 = decreasing/increasing first quotients.
A070211/A325546 = weakly decreasing/increasing differences.
A175342/A325545 = constant/distinct differences.
A342495 = constant first quotients (unordered: A342496, strict: A342515, ranking: A342522).

Programs

  • Maple
    b:= proc(n, i, j) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1, j)+b(n-i, min(n-i, j), min(n-i, i))))
        end:
    a:= n-> b(n$3):
    seq(a(n), n=0..42);  # Alois P. Heinz, Jan 16 2025
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],GreaterEqual@@Plus@@@Reverse/@Partition[#,2,1]&]],{n,0,15}]
  • PARI
    seq(n)={my(p=1/prod(k=1, n, 1-y*x^k + O(x*x^n))); Vec(1+sum(k=1, n, polcoef(p,k,y)*(polcoef(p,k-1,y) + polcoef(p,k,y))))} \\ Andrew Howroyd, Mar 24 2021

Formula

G.f.: Sum_{k>=0} ([y^k] P(x,y))*([y^k] (1 + y)*P(x,y)), where P(x,y) = Product_{k>=1} 1/(1 - y*x^k). - Andrew Howroyd, Jan 16 2025

Extensions

Terms a(21) and beyond from Andrew Howroyd, Mar 24 2021

A169594 Number of divisors of n, counting divisor multiplicity in n.

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 6, 4, 4, 2, 7, 2, 4, 4, 9, 2, 7, 2, 7, 4, 4, 2, 10, 4, 4, 6, 7, 2, 8, 2, 11, 4, 4, 4, 12, 2, 4, 4, 10, 2, 8, 2, 7, 7, 4, 2, 14, 4, 7, 4, 7, 2, 10, 4, 10, 4, 4, 2, 13, 2, 4, 7, 15, 4, 8, 2, 7, 4, 8, 2, 16, 2, 4, 7, 7, 4, 8, 2, 14, 9, 4, 2, 13, 4, 4, 4, 10, 2, 13, 4, 7, 4, 4, 4, 17, 2, 7
Offset: 1

Views

Author

Joseph L. Pe, Dec 02 2009

Keywords

Comments

The multiplicity of a divisor d > 1 in n is defined as the largest power i for which d^i divides n; and for d = 1 it is defined as 1.
a(n) is also the sum of the multiplicities of the divisors of n.
In other words, a(n) = 1 + sum of the highest exponents e_i for which each number k_i in range 2 .. n divide n, as {k_i}^{e_i} | n. For nondivisors of n this exponent e_i is 0, for n itself it is 1. - Antti Karttunen, May 20 2017
From Gus Wiseman, Mar 25 2021: (Start)
Also the number of strict chains of divisors ending with n and having constant (equal) first quotients. The case starting with 1 is A089723. For example, the a(1) = 1 through a(12) = 7 chains are:
1 2 3 4 5 6 7 8 9 10 11 12
1|2 1|3 1|4 1|5 1|6 1|7 1|8 1|9 1|10 1|11 1|12
2|4 2|6 2|8 3|9 2|10 2|12
1|2|4 3|6 4|8 1|3|9 5|10 3|12
2|4|8 4|12
1|2|4|8 6|12
3|6|12
(End)
a(n) depends only on the prime signature of n. - David A. Corneth, Mar 28 2021

Examples

			The divisors of 8 are 1, 2, 4, 8 of multiplicity 1, 3, 1, 1, respectively. So a(8) = 1 + 3 + 1 + 1 = 6.
		

Crossrefs

Cf. A168512.
Row sums of A286561, A286563 and A286564.
A001055 counts factorizations (strict: A045778, ordered: A074206).
A057567 counts chains of divisors with weakly increasing first quotients.
A067824 counts strict chains of divisors ending with n.
A253249 counts strict chains of divisors.
A334997 counts chains of divisors of n by length.
A342086 counts chains of divisors with strictly increasing first quotients.
A342496 counts partitions with equal first quotients (strict: A342515, ranking: A342522, ordered: A342495).
A342530 counts chains of divisors with distinct first quotients.
First differences of A078651.

Programs

  • Maple
    a := n -> ifelse(n < 2, 1, 1 + add(padic:-ordp(n, k), k = 2..n)):
    seq(a(n), n = 1..98);  # Peter Luschny, Apr 10 2025
  • Mathematica
    divmult[d_, n_] := Module[{output, i}, If[d == 1, output = 1, If[d == n, output = 1, i = 0; While[Mod[n, d^(i + 1)] == 0, i = i + 1]; output = i]]; output]; dmt0[n_] := Module[{divs, l}, divs = Divisors[n]; l = Length[divs]; Sum[divmult[divs[[i]], n], {i, 1, l}]]; Table[dmt0[i], {i, 1, 40}]
    Table[1 + DivisorSum[n, IntegerExponent[n, #] &, # > 1 &], {n, 98}] (* Michael De Vlieger, May 20 2017 *)
  • PARI
    A286561(n,k) = { my(i=1); if(1==k, 1, while(!(n%(k^i)), i = i+1); (i-1)); };
    A169594(n) = sumdiv(n,d,A286561(n,d)); \\ Antti Karttunen, May 20 2017
    
  • PARI
    a(n) = { if(n == 1, return(1)); my(f = factor(n), u = vecmax(f[, 2]), cf = f, res = numdiv(f) - u + 1); for(i = 2, u, cf[, 2] = f[, 2]\i; res+=numdiv(factorback(cf)) ); res } \\ David A. Corneth, Mar 29 2021
    
  • PARI
    A169594(n) = {my(s=0, k=2); while(k<=n, s+=valuation(n, k); k=k+1); s + 1} \\ Zhuorui He, Aug 28 2025
    
  • Python
    def a286561(n, k):
        i=1
        if k==1: return 1
        while n%(k**i)==0:
            i+=1
        return i-1
    def a(n): return sum([a286561(n, d) for d in divisors(n)]) # Indranil Ghosh, May 20 2017
  • Scheme
    (define (A169594 n) (add (lambda (k) (A286561bi n k)) 1 n))
    ;; Implements sum_{i=lowlim..uplim} intfun(i)
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
    ;; For A286561bi see A286561. - Antti Karttunen, May 20 2017
    

Formula

From Friedjof Tellkamp, Feb 29 2024: (Start)
a(n) = A309891(n) + 1.
G.f.: x/(1-x) + Sum_{k>=2, j>=1} x^(k^j)/(1-x^(k^j)).
Dirichlet g.f.: zeta(s) * (1 + Sum_{k>=1} (zeta(k*s) - 1)).
Sum_{n>=1} a(n)/n^2 = (7/24) * Pi^2. (End)

Extensions

Extended by Ray Chandler, Dec 08 2009

A342527 Number of compositions of n with alternating parts equal.

Original entry on oeis.org

1, 1, 2, 4, 6, 8, 11, 12, 16, 17, 21, 20, 29, 24, 31, 32, 38, 32, 46, 36, 51, 46, 51, 44, 69, 51, 61, 60, 73, 56, 87, 60, 84, 74, 81, 76, 110, 72, 91, 88, 115, 80, 123, 84, 117, 112, 111, 92, 153, 101, 132, 116, 139, 104, 159, 120, 161, 130, 141, 116, 205, 120, 151, 156, 178, 142, 195, 132, 183, 158
Offset: 0

Views

Author

Gus Wiseman, Mar 24 2021

Keywords

Comments

These are finite sequences q of positive integers summing to n such that q(i) = q(i+2) for all possible i.

Examples

			The a(1) = 1 through a(8) = 16 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (12)   (13)    (14)     (15)      (16)       (17)
             (21)   (22)    (23)     (24)      (25)       (26)
             (111)  (31)    (32)     (33)      (34)       (35)
                    (121)   (41)     (42)      (43)       (44)
                    (1111)  (131)    (51)      (52)       (53)
                            (212)    (141)     (61)       (62)
                            (11111)  (222)     (151)      (71)
                                     (1212)    (232)      (161)
                                     (2121)    (313)      (242)
                                     (111111)  (12121)    (323)
                                               (1111111)  (1313)
                                                          (2222)
                                                          (3131)
                                                          (21212)
                                                          (11111111)
		

Crossrefs

The odd-length case is A062968.
The even-length case is A065608.
The version with alternating parts unequal is A224958 (unordered: A000726).
The version with alternating parts weakly decreasing is A342528.
A000005 counts constant compositions.
A000041 counts weakly increasing (or weakly decreasing) compositions.
A000203 adds up divisors.
A002843 counts compositions with all adjacent parts x <= 2y.
A003242 counts anti-run compositions.
A175342 counts compositions with constant differences.
A342495 counts compositions with constant first quotients.
A342496 counts partitions with constant first quotients (strict: A342515, ranking: A342522).

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Plus@@@Reverse/@Partition[#,2,1]&]],{n,0,15}]

Formula

a(n) = 1 + n + A000203(n) - 2*A000005(n).
a(n) = A065608(n) + A062968(n).

A342495 Number of compositions of n with constant (equal) first quotients.

Original entry on oeis.org

1, 1, 2, 4, 5, 6, 8, 10, 10, 11, 12, 12, 16, 16, 18, 20, 19, 18, 22, 22, 24, 28, 24, 24, 30, 27, 30, 30, 34, 30, 38, 36, 36, 36, 36, 40, 43, 40, 42, 46, 48, 42, 52, 46, 48, 52, 48, 48, 56, 55, 54, 54, 58, 54, 60, 58, 64, 64, 60, 60, 72, 64, 68, 74, 69, 72, 72
Offset: 0

Views

Author

Gus Wiseman, Mar 17 2021

Keywords

Comments

The first quotients of a sequence are defined as if the sequence were an increasing divisor chain, so for example the first quotients of (6,3,1) are (1/2,1/3).

Examples

			The composition (1,2,4,8) has first quotients (2,2,2) so is counted under a(15).
The composition (4,5,6) has first quotients (5/4,6/5) so is not counted under a(15).
The a(1) = 1 through a(7) = 10 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)
       (11)  (12)   (13)    (14)     (15)      (16)
             (21)   (22)    (23)     (24)      (25)
             (111)  (31)    (32)     (33)      (34)
                    (1111)  (41)     (42)      (43)
                            (11111)  (51)      (52)
                                     (222)     (61)
                                     (111111)  (124)
                                               (421)
                                               (1111111)
		

Crossrefs

The version for differences instead of quotients is A175342.
The unordered version is A342496, ranked by A342522.
The strict unordered version is A342515.
The distinct version is A342529.
A000005 counts constant compositions.
A000009 counts strictly increasing (or strictly decreasing) compositions.
A000041 counts weakly increasing (or weakly decreasing) compositions.
A003238 counts chains of divisors summing to n - 1 (strict: A122651).
A167865 counts strict chains of divisors > 1 summing to n.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],SameQ@@Divide@@@Partition[#,2,1]&]],{n,0,15}]

Formula

a(n > 0) = 2*A342496(n) - A000005(n).

A342496 Number of integer partitions of n with constant (equal) first quotients.

Original entry on oeis.org

1, 1, 2, 3, 4, 4, 6, 6, 7, 7, 8, 7, 11, 9, 11, 12, 12, 10, 14, 12, 15, 16, 14, 13, 19, 15, 17, 17, 20, 16, 23, 19, 21, 20, 20, 22, 26, 21, 23, 25, 28, 22, 30, 24, 27, 29, 26, 25, 33, 29, 30, 29, 32, 28, 34, 31, 36, 34, 32, 31, 42
Offset: 0

Views

Author

Gus Wiseman, Mar 17 2021

Keywords

Comments

The first quotients of a sequence are defined as if the sequence were an increasing divisor chain, so for example the first quotients of (6,3,1) are (1/2,1/3).

Examples

			The partition (12,6,3) has first quotients (1/2,1/2) so is counted under a(21).
The a(1) = 1 through a(9) = 7 partitions:
  1   2    3     4      5       6        7         8          9
      11   21    22     32      33       43        44         54
           111   31     41      42       52        53         63
                 1111   11111   51       61        62         72
                                222      421       71         81
                                111111   1111111   2222       333
                                                   11111111   111111111
		

Crossrefs

The version for differences instead of quotients is A049988.
The ordered version is A342495.
The distinct version is A342514.
The strict case is A342515.
The Heinz numbers of these partitions are A342522.
A000005 counts constant partitions.
A003238 counts chains of divisors summing to n - 1 (strict: A122651).
A167865 counts strict chains of divisors > 1 summing to n.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],SameQ@@Divide@@@Partition[#,2,1]&]],{n,0,30}]

Formula

a(n > 0) = (A342495(n) + A000005(n))/2.

A342530 Number of strict chains of divisors ending with n and having distinct first quotients.

Original entry on oeis.org

1, 2, 2, 3, 2, 6, 2, 6, 3, 6, 2, 12, 2, 6, 6, 9, 2, 12, 2, 12, 6, 6, 2, 28, 3, 6, 6, 12, 2, 26, 2, 14, 6, 6, 6, 31, 2, 6, 6, 28, 2, 26, 2, 12, 12, 6, 2, 52, 3, 12, 6, 12, 2, 28, 6, 28, 6, 6, 2, 66, 2, 6, 12, 25, 6, 26, 2, 12, 6, 26, 2, 76, 2, 6, 12, 12, 6, 26
Offset: 1

Views

Author

Gus Wiseman, Mar 25 2021

Keywords

Comments

The first quotients of a sequence are defined as if the sequence were an increasing divisor chain, so for example the quotients of (6,3,1) are (1/2,1/3).

Examples

			The a(1) = 1 through a(12) = 12 chains (reversed):
  1  2    3    4    5    6      7    8      9    10      11    12
     2/1  3/1  4/1  5/1  6/1    7/1  8/1    9/1  10/1    11/1  12/1
               4/2       6/2         8/2    9/3  10/2          12/2
                         6/3         8/4         10/5          12/3
                         6/2/1       8/2/1       10/2/1        12/4
                         6/3/1       8/4/1       10/5/1        12/6
                                                               12/2/1
                                                               12/3/1
                                                               12/4/1
                                                               12/4/2
                                                               12/6/1
                                                               12/6/2
Not counted under a(12) are: 12/4/2/1, 12/6/2/1, 12/6/3, 12/6/3/1.
		

Crossrefs

The version for weakly increasing first quotients is A057567.
The version for equal first quotients is A169594.
The case of chains starting with 1 is A254578.
The version for strictly increasing first quotients is A342086.
A001055 counts factorizations (strict: A045778, ordered: A074206).
A067824 counts strict chains of divisors ending with n.
A167865 counts strict chains of divisors > 1 summing to n.
A253249 counts strict chains of divisors.
A334997 counts chains of divisors of n by length.
A342495/A342529 count compositions with equal/distinct quotients.
A342496/A342514 count partitions with equal/distinct quotients.
A342515/A342520 count strict partitions with equal/distinct quotients.
A342522/A342521 rank partitions with equal/distinct quotients.

Programs

  • Mathematica
    cmi[n_]:=Prepend[Prepend[#,n]&/@Join@@cmi/@Most[Divisors[n]],{n}];
    Table[Length[Select[cmi[n],UnsameQ@@Divide@@@Partition[#,2,1]&]],{n,100}]

Formula

a(n) = Sum_{d|n} A254578(d). - Ridouane Oudra, Jun 17 2025

A342521 Heinz numbers of integer partitions with distinct first quotients.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 41, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 55, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 82
Offset: 1

Views

Author

Gus Wiseman, Mar 23 2021

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
The first quotients of a sequence are defined as if the sequence were an increasing divisor chain, so for example the first quotients of (6,3,1) are (1/2,1/3).

Examples

			The prime indices of 1365 are {2,3,4,6}, with first quotients (3/2,4/3,3/2), so 1365 is not in the sequence.
Most small numbers are in the sequence, but the sequence of non-terms together with their prime indices begins:
    8: {1,1,1}
   16: {1,1,1,1}
   24: {1,1,1,2}
   27: {2,2,2}
   32: {1,1,1,1,1}
   36: {1,1,2,2}
   40: {1,1,1,3}
   42: {1,2,4}
   48: {1,1,1,1,2}
   54: {1,2,2,2}
   56: {1,1,1,4}
   64: {1,1,1,1,1,1}
   72: {1,1,1,2,2}
   80: {1,1,1,1,3}
   81: {2,2,2,2}
   84: {1,1,2,4}
   88: {1,1,1,5}
   96: {1,1,1,1,1,2}
  100: {1,1,3,3}
		

Crossrefs

For multiplicities (prime signature) instead of quotients we have A130091.
For differences instead of quotients we have A325368 (count: A325325).
These partitions are counted by A342514 (strict: A342520, ordered: A342529).
The equal instead of distinct version is A342522.
The version counting strict divisor chains is A342530.
A001055 counts factorizations (strict: A045778, ordered: A074206).
A003238 counts chains of divisors summing to n - 1 (strict: A122651).
A167865 counts strict chains of divisors > 1 summing to n.
A318991/A318992 rank reversed partitions with/without integer quotients.

Programs

  • Mathematica
    primeptn[n_]:=If[n==1,{},Reverse[Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]];
    Select[Range[100],UnsameQ@@Divide@@@Reverse/@Partition[primeptn[#],2,1]&]

A342194 Number of strict compositions of n with equal differences, or strict arithmetic progressions summing to n.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 7, 7, 7, 13, 11, 11, 17, 13, 15, 25, 17, 17, 29, 19, 23, 35, 25, 23, 39, 29, 29, 45, 33, 29, 55, 31, 35, 55, 39, 43, 65, 37, 43, 65, 51, 41, 77, 43, 51, 85, 53, 47, 85, 53, 65, 87, 61, 53, 99, 67, 67, 97, 67, 59, 119, 61, 71, 113, 75, 79, 123, 67, 79, 117
Offset: 0

Views

Author

Gus Wiseman, Apr 02 2021

Keywords

Examples

			The a(1) = 1 through a(9) = 13 compositions:
  (1)  (2)  (3)    (4)    (5)    (6)      (7)    (8)    (9)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)  (1,7)  (1,8)
            (2,1)  (3,1)  (2,3)  (2,4)    (2,5)  (2,6)  (2,7)
                          (3,2)  (4,2)    (3,4)  (3,5)  (3,6)
                          (4,1)  (5,1)    (4,3)  (5,3)  (4,5)
                                 (1,2,3)  (5,2)  (6,2)  (5,4)
                                 (3,2,1)  (6,1)  (7,1)  (6,3)
                                                        (7,2)
                                                        (8,1)
                                                        (1,3,5)
                                                        (2,3,4)
                                                        (4,3,2)
                                                        (5,3,1)
		

Crossrefs

Strict compositions in general are counted by A032020.
The unordered version is A049980.
The non-strict version is A175342.
A000203 adds up divisors.
A000726 counts partitions with alternating parts unequal.
A003242 counts anti-run compositions.
A224958 counts compositions with alternating parts unequal.
A342343 counts compositions with alternating parts strictly decreasing.
A342495 counts compositions with constant quotients.
A342527 counts compositions with alternating parts equal.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],SameQ@@Differences[#]&]],{n,0,30}]

Formula

a(n > 0) = A175342(n) - A000005(n) + 1.
a(n > 0) = 2*A049988(n) - 2*A000005(n) + 1 = 2*A049982(n) + 1.
Showing 1-8 of 8 results.