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 21-26 of 26 results.

A331579 Position of first appearance of n in A124758 (products of compositions in standard order).

Original entry on oeis.org

1, 2, 4, 8, 16, 18, 64, 34, 36, 66, 1024, 68, 4096, 258, 132, 136, 65536, 146, 262144, 264, 516, 4098
Offset: 1

Views

Author

Gus Wiseman, Mar 20 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The list of terms together with the corresponding compositions begins:
       1: (1)
       2: (2)
       4: (3)
       8: (4)
      16: (5)
      18: (3,2)
      64: (7)
      34: (4,2)
      36: (3,3)
      66: (5,2)
    1024: (11)
      68: (4,3)
    4096: (13)
     258: (7,2)
     132: (5,3)
     136: (4,4)
   65536: (17)
     146: (3,3,2)
  262144: (19)
     264: (5,4)
		

Crossrefs

The product of prime indices is A003963.
The sum of binary indices is A029931.
The sum of prime indices is A056239.
Sums of compositions in standard order are A070939.
The product of binary indices is A096111.
All terms belong to A114994.
Products of compositions in standard order are A124758.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    q=Table[Times@@stc[n],{n,1000}];
    Table[Position[q,i][[1,1]],{i,First[Split[Union[q],#1+1==#2&]]}]

A334300 Number of distinct nonempty subsequences (not necessarily contiguous) in the n-th composition in standard order (A066099).

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 3, 3, 1, 3, 2, 5, 3, 6, 5, 4, 1, 3, 3, 5, 3, 5, 6, 7, 3, 6, 5, 9, 5, 9, 7, 5, 1, 3, 3, 5, 2, 7, 7, 7, 3, 7, 3, 8, 7, 11, 10, 9, 3, 6, 7, 9, 7, 10, 11, 12, 5, 9, 8, 13, 7, 12, 9, 6, 1, 3, 3, 5, 3, 7, 7, 7, 3, 5, 5, 11, 6, 13, 11, 9, 3, 7, 6
Offset: 0

Views

Author

Gus Wiseman, Jun 01 2020

Keywords

Comments

Looking only at contiguous subsequences, or restrictions to a subinterval, gives A124770.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			Triangle begins:
  1
  1 2
  1 3 3 3
  1 3 2 5 3 6 5 4
  1 3 3 5 3 5 6 7 3 6 5 9 5 9 7 5
If the k-th composition in standard order is c, then we say that the STC-number of c is k. The n-th column below lists the STC-numbers of the nonempty subsequences of the composition with STC-number n:
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
        1     2  2  3     4   2   5   4   6   6   7
              1  1  1     1       3   1   5   3   3
                                  2       3   2   1
                                  1       2   1
                                          1
		

Crossrefs

Row lengths are A011782.
Looking only at contiguous subsequences gives A124770.
The contiguous case with empty subsequences allowed is A124771.
Allowing empty subsequences gives A334299.
Compositions where every subinterval has a different sum are A333222.
Knapsack compositions are A333223.
Contiguous positive subsequence-sums are counted by A333224.
Contiguous subsequence-sums are counted by A333257.
Subsequence-sums are counted by A334968.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[Rest[Subsets[stc[n]]]]],{n,0,100}]
  • Python
    from itertools import combinations
    def comp(n):
        # see A357625
        return
    def A334300(n):
        A,C = set(),comp(n)
        c = range(len(C))
        for j in c:
            for k in combinations(c, j):
                A.add(tuple(C[i] for i in k))
        return len(A) # John Tyler Rascoe, Mar 12 2025

Formula

a(n) = A334299(n) - 1.

A335474 Number of nonempty normal patterns contiguously matched by the n-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 4, 2, 4, 4, 4, 1, 2, 2, 4, 2, 4, 4, 6, 2, 4, 4, 7, 4, 7, 6, 5, 1, 2, 2, 4, 2, 3, 4, 6, 2, 4, 3, 6, 4, 6, 7, 8, 2, 4, 4, 7, 3, 7, 6, 10, 4, 7, 6, 10, 6, 10, 8, 6, 1, 2, 2, 4, 2, 3, 4, 6, 2, 4, 4, 6, 4, 6, 7, 8, 2, 4, 4, 7, 4, 6
Offset: 0

Views

Author

Gus Wiseman, Jun 21 2020

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
We define a (normal) pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			The a(n) patterns for n = 32, 80, 133, 290, 305, 329, 436 are:
      (1)  (1)   (1)    (1)    (1)     (1)     (1)
           (12)  (21)   (12)   (12)    (11)    (12)
                 (321)  (21)   (21)    (12)    (21)
                        (231)  (121)   (21)    (121)
                               (213)   (122)   (123)
                               (2131)  (221)   (212)
                                       (2331)  (1212)
                                               (2123)
                                               (12123)
		

Crossrefs

The version for Heinz numbers of partitions is A335516(n) - 1.
The non-contiguous version is A335454(n) - 1.
The version allowing empty patterns is A335458.
Patterns are counted by A000670 and ranked by A333217.
The n-th composition has A124771(n) distinct consecutive subsequences.
Knapsack compositions are counted by A325676 and ranked by A333223.
The n-th composition has A334299(n) distinct subsequences.
Minimal avoided patterns are counted by A335465.
Patterns matched by prime indices are counted by A335549.

Programs

  • Mathematica
    stc[n_]:=Reverse[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]];
    mstype[q_]:=q/.Table[Union[q][[i]]->i,{i,Length[Union[q]]}];
    Table[Length[Union[mstype/@ReplaceList[stc[n],{_,s__,_}:>{s}]]],{n,0,100}]

Formula

a(n) = A335458(n) - 1.

A354583 Heinz numbers of non-rucksack partitions: not every prime-power divisor has a different sum of prime indices.

Original entry on oeis.org

12, 24, 36, 40, 48, 60, 63, 72, 80, 84, 96, 108, 112, 120, 126, 132, 144, 156, 160, 168, 180, 189, 192, 200, 204, 216, 224, 228, 240, 252, 264, 276, 280, 288, 300, 312, 315, 320, 324, 325, 336, 348, 351, 352, 360, 372, 378, 384, 396, 400, 408, 420, 432, 440
Offset: 1

Views

Author

Gus Wiseman, Jun 15 2022

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 term rucksack is short for run-knapsack.

Examples

			The terms together with their prime indices begin:
   12: {1,1,2}
   24: {1,1,1,2}
   36: {1,1,2,2}
   40: {1,1,1,3}
   48: {1,1,1,1,2}
   60: {1,1,2,3}
   63: {2,2,4}
   72: {1,1,1,2,2}
   80: {1,1,1,1,3}
   84: {1,1,2,4}
   96: {1,1,1,1,1,2}
  108: {1,1,2,2,2}
  112: {1,1,1,1,4}
  120: {1,1,1,2,3}
  126: {1,2,2,4}
  132: {1,1,2,5}
  144: {1,1,1,1,2,2}
  156: {1,1,2,6}
  160: {1,1,1,1,1,3}
  168: {1,1,1,2,4}
For example, {2,2,2,3,3} does not have distinct run-sums because 2+2+2 = 3+3, so 675 is in the sequence.
		

Crossrefs

Knapsack partitions are counted by A108917, ranked by A299702.
Non-knapsack partitions are ranked by A299729.
The non-partial version is A353839, complement A353838 (counted by A353837).
The complement is A353866, counted by A353864.
The complete complement is A353867, counted by A353865.
The complement for compositions is counted by A354580.
A001222 counts prime factors, distinct A001221.
A056239 adds up prime indices, row sums of A112798 and A296150.
A073093 counts prime-power divisors.
A300273 ranks collapsible partitions, counted by A275870.
A304442 counts partitions with all equal run-sums, ranked by A353833.
A333223 ranks knapsack compositions, counted by A325676.
A353852 ranks compositions with all distinct run-sums, counted by A353850.
A353861 counts distinct partial run-sums of prime indices.
A354584 lists run-sums of prime indices, rows ranked by A353832.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],!UnsameQ@@Total/@primeMS/@Select[Divisors[#],PrimePowerQ]&]

A334268 Number of compositions of n where every distinct subsequence (not necessarily contiguous) has a different sum.

Original entry on oeis.org

1, 1, 2, 4, 5, 10, 10, 24, 24, 43, 42, 88, 72, 136, 122, 242, 213, 392, 320, 630, 490, 916, 742, 1432, 1160, 1955, 1604, 2826, 2310, 3850, 2888, 5416, 4426, 7332, 5814, 10046, 7983, 12946, 10236, 17780, 14100, 22674, 17582, 30232, 23674, 37522, 29426, 49832
Offset: 0

Views

Author

Gus Wiseman, Jun 02 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The contiguous case is A325676.

Examples

			The a(1) = 1 through a(6) = 19 compositions:
  (1)  (2)    (3)      (4)        (5)          (6)
       (1,1)  (1,2)    (1,3)      (1,4)        (1,5)
              (2,1)    (2,2)      (2,3)        (2,4)
              (1,1,1)  (3,1)      (3,2)        (3,3)
                       (1,1,1,1)  (4,1)        (4,2)
                                  (1,1,3)      (5,1)
                                  (1,2,2)      (1,1,4)
                                  (2,2,1)      (2,2,2)
                                  (3,1,1)      (4,1,1)
                                  (1,1,1,1,1)  (1,1,1,1,1,1)
		

Crossrefs

These compositions are ranked by A334967.
Compositions where every restriction to a subinterval has a different sum are counted by A169942 and A325677 and ranked by A333222. The case of partitions is counted by A325768 and ranked by A325779.
Positive subset-sums of partitions are counted by A276024 and A299701.
Knapsack partitions are counted by A108917 and A325592 and ranked by A299702, while the strict case is counted by A275972 and ranked by A059519 and A301899.
Knapsack compositions are counted by A325676 and A325687 and ranked by A333223. The case of partitions is counted by A325769 and ranked by A325778, for which the number of distinct consecutive subsequences is given by A325770.

Programs

  • Maple
    b:= proc(n, s) option remember; `if`(n=0, 1, add((h->
          `if`(nops(h)=nops(map(l-> add(i, i=l), h)),
           b(n-j, h), 0))({s[], map(l-> [l[], j], s)[]}), j=1..n))
        end:
    a:= n-> b(n, {[]}):
    seq(a(n), n=0..23);  # Alois P. Heinz, Jun 03 2020
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Total/@Union[Subsets[#]]&]],{n,0,15}]

Extensions

a(18)-a(47) from Alois P. Heinz, Jun 03 2020

A335279 Positions of first appearances in A124771 = number of distinct contiguous subsequences of compositions in standard order.

Original entry on oeis.org

0, 1, 3, 5, 11, 15, 23, 27, 37, 47, 55, 107, 111, 119, 155, 215, 223, 239, 411, 431, 471, 479, 495, 549, 631, 943, 951, 959, 991, 1647, 1887, 1967, 1983, 2015, 2543, 2935, 3703, 3807, 3935, 3967, 4031, 6639, 6895, 7407, 7871, 7903, 8063, 8127, 10207, 13279
Offset: 1

Views

Author

Gus Wiseman, Jun 03 2020

Keywords

Examples

			The sequence together with the corresponding compositions begins:
     0: ()                215: (1,2,2,1,1,1)
     1: (1)               223: (1,2,1,1,1,1,1)
     3: (1,1)             239: (1,1,2,1,1,1,1)
     5: (2,1)             411: (1,3,1,2,1,1)
    11: (2,1,1)           431: (1,2,2,1,1,1,1)
    15: (1,1,1,1)         471: (1,1,2,2,1,1,1)
    23: (2,1,1,1)         479: (1,1,2,1,1,1,1,1)
    27: (1,2,1,1)         495: (1,1,1,2,1,1,1,1)
    37: (3,2,1)           549: (4,3,2,1)
    47: (2,1,1,1,1)       631: (3,1,1,2,1,1,1)
    55: (1,2,1,1,1)       943: (1,1,2,2,1,1,1,1)
   107: (1,2,2,1,1)       951: (1,1,2,1,2,1,1,1)
   111: (1,2,1,1,1,1)     959: (1,1,2,1,1,1,1,1,1)
   119: (1,1,2,1,1,1)     991: (1,1,1,2,1,1,1,1,1)
   155: (3,1,2,1,1)      1647: (1,3,1,2,1,1,1,1)
The subsequences for n = 0, 1, 3, 5, 11, 15, 23, 27 are the following (0 = empty partition):
  0  0  0   0   0    0     0     0     0    0
     1  1   1   1    1     1     1     1    1
        11  2   2    11    2     2     2    2
            21  11   111   11    11    3    11
                21   1111  21    12    21   21
                211        111   21    32   111
                           211   121   321  211
                           2111  211        1111
                                 1211       2111
                                            21111
		

Crossrefs

Positions of first appearances in A124771.
Compositions where every subinterval has a different sum are A333222.
Knapsack compositions are A333223.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    seq=Table[Length[Union[ReplaceList[stc[n],{_,s___,_}:>{s}]]],{n,0,1000}];
    Table[Position[seq,i][[1,1]]-1,{i,First/@Gather[seq]}]
Previous Showing 21-26 of 26 results.