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 61-67 of 67 results.

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.

A333631 Number of permutations of {1..n} with three consecutive terms in arithmetic progression.

Original entry on oeis.org

0, 0, 0, 2, 6, 40, 238, 1760, 14076, 131732, 1308670, 14678452, 176166906, 2317481348, 32416648496, 490915956484, 7846449011500, 134291298372632, 2416652824505150, 46141903780094080, 922528719841017424, 19456439433050482412, 427837767407051523776, 9873256397944571377332
Offset: 0

Views

Author

Gus Wiseman, Mar 31 2020

Keywords

Comments

Also permutations whose second differences have at least one zero.

Examples

			The a(3) = 2 and a(4) = 6 permutations:
  (1,2,3)  (1,2,3,4)
  (3,2,1)  (1,4,3,2)
           (2,3,4,1)
           (3,2,1,4)
           (4,1,2,3)
           (4,3,2,1)
		

Crossrefs

The complement is counted by A295370.
The version for prime indices is A333195.
Strict partitions with equal differences are A049980.
Partitions with equal differences are A049988.
Compositions without triples in arithmetic progression are A238423.
Partitions without triples in arithmetic progression are A238424.
Strict partitions without triples in arithmetic progression are A332668.

Programs

  • Mathematica
    Table[Select[Permutations[Range[n]],MatchQ[Differences[#],{_,x_,x_,_}]&]//Length,{n,0,8}]

Formula

a(n) = n! - A295370(n).

Extensions

a(11)-a(21) (using A295370) from Giovanni Resta, Apr 07 2020
a(22)-a(23) (using A295370) from Alois P. Heinz, Jan 27 2024

A385214 Number of subsets of {1..n} without all equal lengths of maximal runs of consecutive elements increasing by 1.

Original entry on oeis.org

0, 0, 0, 0, 2, 8, 25, 66, 159, 361, 791, 1688, 3539, 7328, 15040, 30669, 62246, 125896, 253975, 511357, 1028052
Offset: 0

Views

Author

Gus Wiseman, Jun 25 2025

Keywords

Examples

			The maximal runs of S = {1,2,4,5,6,8,9} are ((1,2),(4,5,6),(8,9)), with lengths (2,3,2), so S is counted under a(9).
The a(0) = 0 through a(5) = 8 subsets:
  .  .  .  .  {1,2,4}  {1,2,4}
              {1,3,4}  {1,2,5}
                       {1,3,4}
                       {1,4,5}
                       {2,3,5}
                       {2,4,5}
                       {1,2,3,5}
                       {1,3,4,5}
		

Crossrefs

These subsets are ranked by A164708, complement A164707
The complement is counted by A243815.
For distinct instead of equal lengths we have A384176, complement A384175.
For anti-runs instead of runs we have complement of A384889, for partitions A384888.
For permutations instead of subsets we have complement of A384892, distinct A384891.
For partitions instead of subsets we have complement of A384904, strict A384886.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A049988 counts partitions with equal run-lengths, distinct A325325.
A329738 counts compositions with equal run-lengths, distinct A329739.
A384177 counts subsets with all distinct lengths of maximal anti-runs, ranks A384879.
A384887 counts partitions with equal lengths of gapless runs, distinct A384884.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],!SameQ@@Length/@Split[#,#2==#1+1&]&]],{n,0,10}]

A049995 Number of arithmetic progressions of 4 or more positive integers, nondecreasing with sum <= n.

Original entry on oeis.org

0, 0, 0, 1, 2, 3, 4, 6, 7, 10, 11, 14, 15, 18, 21, 25, 26, 30, 31, 37, 40, 44, 45, 51, 55, 59, 62, 69, 70, 79, 80, 86, 89, 94, 101, 111, 112, 117, 120, 132, 133, 143, 144, 152, 162, 168, 169, 180, 184, 196, 200, 209, 210, 221, 230, 242, 246, 253, 254, 274, 275, 282, 291, 302, 312, 325, 326, 336
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

From Petros Hadjicostas, Sep 29 2019: (Start)
a(n) = Sum_{k = 1..n} A049994(k).
G.f.: (g.f. of A049994)/(1-x). (End)

Extensions

More terms from Petros Hadjicostas, Sep 29 2019

A088043 Number of partitions of n into parts which can be arranged to form a geometric progression (possibly with a common ratio of 1). (For every partition there exists a geometric progression in which this partition fits in as successive terms.).

Original entry on oeis.org

1, 2, 3, 4, 3, 6, 4, 6, 5, 6, 3, 10, 4, 7, 8, 8, 3, 10, 3, 10, 9, 6, 3, 14, 5, 7, 7, 11, 3, 15, 5, 10, 7, 6, 8, 16, 3, 6, 8, 15, 3, 16, 4, 10, 12, 6, 3, 18, 6, 10, 7, 11, 3, 14, 7, 15, 8, 6, 3, 23, 3, 8, 14, 12, 8, 14, 3, 10, 7, 15, 3, 22, 4, 6, 12, 10, 8, 15, 3, 19, 9, 6, 3, 24, 8, 7, 7, 14, 3, 23
Offset: 1

Views

Author

Amarnath Murthy, Sep 20 2003

Keywords

Examples

			a(15) = 8 and the partitions are (15), (5, 5, 5), (3, 3, 3, 3, 3), (1, 1, ...15 times), (1, 2, 4, 8), (5, 10), (1, 14), (3, 12).
a(31) = 5 and the partitions are (31), (1+1...,31 times), (1,5,25),(1,2,4,8,16), (1,30).
		

Crossrefs

Cf. A049988.

Programs

  • PARI
    lim = 100; A = vector(lim, i, 1); for (r = 1, lim - 1, s = r + 1; while (s <= lim, forstep (k = s, lim, s, A[k]++); s = r*s + 1)); A \\ David Wasserman, Jun 21 2005

Extensions

More terms from David Wasserman, Jun 21 2005

A330285 The maximum number of arithmetic progressions in a sequence of length n.

Original entry on oeis.org

0, 0, 1, 3, 7, 12, 20, 29, 41, 55, 72, 90, 113, 137, 164, 194, 228, 263, 303, 344, 390, 439, 491, 544, 604, 666, 731, 799, 872, 946, 1027, 1109, 1196, 1286, 1379, 1475, 1579, 1684, 1792, 1903, 2021, 2140, 2266, 2393, 2525, 2662, 2802, 2943, 3093, 3245, 3402, 3562, 3727
Offset: 1

Views

Author

Joseph Wheat, Dec 21 2019

Keywords

Comments

The partial arithmetic density D_n(A) up to n is merely the number of arithmetic progressions, A(s(n)), divided by the total number of nonempty subsets of {s(1), s(2), ..., s(n)}, i.e., A(s(n))/(2^n - 1). As n approaches infinity, D_n(A) converges to zero. Furthermore, the infinite sum of the partial densities for any sequence always converges to the total density D(A). Every infinite arithmetic progression has the same total density, Sum_{n >= 1} a(n)/(2^n - 1) = alpha ~ 1.25568880818612911696845537; sequences with a finite number of progressions have D(A) < alpha; and sequences without any arithmetic progressions have D(A) = 0.

Crossrefs

Partial sums of A002541.

Programs

  • PARI
    a(n) = sum(i=1, n, sum(j=1, i, floor((i - 1)/(j + 1))))

Formula

a(n) = Sum_{i=1..n} Sum_{j=1..i} floor((i - 1)/(j + 1)).

A342531 Triangle read by rows where T(n,k) is the number of strict integer partitions of n with maximal descent k, n >= 0, 0 <= k <= n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 25 2021

Keywords

Comments

The maximal descent of an empty or singleton partition is considered to be 0.

Examples

			Triangle begins:
1
1 0
1 0 0
1 1 0 0
1 0 1 0 0
1 1 0 1 0 0
1 1 1 0 1 0 0
1 1 1 1 0 1 0 0
1 0 2 1 1 0 1 0 0
1 2 1 1 1 1 0 1 0 0
1 1 2 2 1 1 1 0 1 0 0
1 1 2 3 1 1 1 1 0 1 0 0
1 1 3 2 3 1 1 1 1 0 1 0 0
1 1 3 3 3 2 1 1 1 1 0 1 0 0
1 1 3 4 3 3 2 1 1 1 1 0 1 0 0
1 3 3 4 4 3 2 2 1 1 1 1 0 1 0 0
1 0 5 5 5 4 3 2 2 1 1 1 1 0 1 0 0
1 1 4 7 5 5 4 2 2 2 1 1 1 1 0 1 0 0
1 2 5 6 7 6 4 4 2 2 2 1 1 1 1 0 1 0 0
1 1 5 9 7 7 6 4 3 2 2 2 1 1 1 1 0 1 0 0
1 1 6 9 9 7 8 5 4 3 2 2 2 1 1 1 1 0 1 0 0
Row n = 15 counts the following strict partitions (empty columns indicated by dots, A..F = 10..15):
  F  87     753   96    762   A5   A41   B4   B31  C3  C21  D2  .  E1  .  .
     654    6432  852   843   861  9321  A32
     54321  6531  7431  951   942
                  7521  8421
		

Crossrefs

The non-strict version is A238353.
A000041 counts partitions (strict: A000009).
A049980 counts strict partitions with equal differences.
A325325 counts partitions with distinct differences (ranking: A325368).
A325545 counts compositions with distinct differences.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&If[Length[#]<=1,k==0,Max[Differences[Reverse[#]]]==k]&]],{n,0,15},{k,0,n}]
Previous Showing 61-67 of 67 results.