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

A335515 Number of patterns of length n matching the pattern (1,2,3).

Original entry on oeis.org

0, 0, 0, 1, 19, 257, 3167, 38909, 498235, 6811453, 100623211, 1612937661, 28033056683, 526501880989, 10639153638795, 230269650097469, 5315570416909995, 130370239796988957, 3385531348514480651, 92801566389186549245, 2677687663571344712043, 81124824154544921317597
Offset: 0

Views

Author

Gus Wiseman, Jun 19 2020

Keywords

Comments

We define a 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(3) = 1 through a(4) = 19 patterns:
  (1,2,3)  (1,1,2,3)
           (1,2,1,3)
           (1,2,2,3)
           (1,2,3,1)
           (1,2,3,2)
           (1,2,3,3)
           (1,2,3,4)
           (1,2,4,3)
           (1,3,2,3)
           (1,3,2,4)
           (1,3,4,2)
           (1,4,2,3)
           (2,1,2,3)
           (2,1,3,4)
           (2,3,1,4)
           (2,3,4,1)
           (3,1,2,3)
           (3,1,2,4)
           (4,1,2,3)
		

Crossrefs

The complement A226316 is the avoiding version.
Compositions matching this pattern are counted by A335514 and ranked by A335479.
Permutations of prime indices matching this pattern are counted by A335520.
Patterns are counted by A000670 and ranked by A333217.
Patterns matching the pattern (1,1) are counted by A019472.
Permutations matching (1,2,3) are counted by A056986.
Combinatory separations are counted by A269134.
Patterns matched by standard compositions are counted by A335454.
Minimal patterns avoided by a standard composition are counted by A335465.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[n],MatchQ[#,{_,x_,_,y_,_,z_,_}/;x
    				
  • PARI
    seq(n)=Vec( serlaplace(1/(2-exp(x + O(x*x^n)))) - 1/2 - 1/(1+sqrt(1-8*x+8*x^2 + O(x*x^n))), -(n+1)) \\ Andrew Howroyd, Jan 28 2024

Formula

a(n) = A000670(n) - A226316(n). - Andrew Howroyd, Jan 28 2024

Extensions

a(9) onwards from Andrew Howroyd, Jan 28 2024

A334030 Number of combinatory separations of a multiset whose multiplicities are the parts of the n-th composition in standard order.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 3, 5, 7, 8, 8, 7, 9, 8, 5, 7, 12, 15, 14, 15, 17, 18, 13, 12, 17, 17, 16, 14, 16, 13, 7, 11, 19, 27, 26, 27, 37, 37, 25, 27, 37, 33, 34, 37, 40, 36, 22, 19, 32, 37, 33, 37, 38, 40, 28, 26, 33, 34, 30, 25, 28, 22, 11, 15, 30, 44, 42, 51, 68
Offset: 0

Views

Author

Gus Wiseman, Apr 16 2020

Keywords

Comments

A multiset is normal if it covers an initial interval of positive integers. The type of a multiset of integers is the unique normal multiset that has the same sequence of multiplicities when its entries are taken in increasing order. For example the type of (3,3,5,5,5,6) is (1,1,2,2,2,3).
A pair h<={g_1,...,g_k} is a combinatory separation iff there exists a multiset partition of h whose multiset of block-types is {g_1,...,g_k}. For example, the (headless) combinatory separations of the multiset (1122) are (1122), (1)(112), (1)(122), (11)(11), (12)(12), (1)(1)(11), (1)(1)(12), (1)(1)(1)(1). This list excludes (12)(11), because one cannot partition (1122) into two blocks where one block has two distinct elements and the other has two equal elements.

Examples

			The combinatory separations for n = 1, 3, 5, 9, 10, 13 (heads not shown):
  (1)  (12)    (112)      (1112)        (1122)        (1223)
       (1)(1)  (1)(11)    (1)(111)      (11)(11)      (1)(112)
               (1)(12)    (1)(112)      (1)(112)      (11)(12)
               (1)(1)(1)  (11)(12)      (1)(122)      (1)(122)
                          (1)(1)(11)    (12)(12)      (1)(123)
                          (1)(1)(12)    (1)(1)(11)    (12)(12)
                          (1)(1)(1)(1)  (1)(1)(12)    (1)(1)(11)
                                        (1)(1)(1)(1)  (1)(1)(12)
                                                      (1)(1)(1)(1)
		

Crossrefs

Multisets of compositions are A034691.
The described multiset is a row of A095684.
Combinatory separations of normal multisets are A269134.
Shuffles of compositions are counted by A292884.
Combinatory separations of prime indices are A318559.
The version for prime indices is A318560.
Combinatory separations of strongly normal multisets are A318563.
Multiset partitions of the described multiset are A333942.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Length of Lyndon factorization is A329312.
- Dealings are counted by A333939.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    normize[m_]:=m/.Rule@@@Table[{Union[m][[i]],i},{i,Length[Union[m]]}];
    ptnToNorm[y_]:=Join@@Table[ConstantArray[i,y[[i]]],{i,Length[y]}];
    Table[Length[Union[Table[Sort[normize/@m],{m,mps[ptnToNorm[stc[n]]]}]]],{n,0,100}]

A095684 Triangle read by rows. There are 2^(m-1) rows of length m, for m = 1, 2, 3, ... The rows are in lexicographic order. The rows have the property that the first entry is 1, the second distinct entry (reading from left to right) is 2, the third distinct entry is 3, etc.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 1, 2, 2, 2, 1, 2, 2, 3, 1, 2, 3, 3, 1, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2, 3, 1, 1, 2, 2, 2, 1, 1, 2, 2, 3, 1, 1, 2, 3, 3, 1, 1, 2, 3, 4, 1, 2, 2, 2, 2, 1, 2, 2, 2, 3, 1, 2, 2, 3, 3
Offset: 1

Views

Author

N. J. A. Sloane, Jun 25 2004

Keywords

Comments

Row k is the unique multiset that covers an initial interval of positive integers and has multiplicities equal to the parts of the k-th composition in standard order (graded reverse-lexicographic, A066099). This composition 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. For example, the 13th composition is (1,2,1), so row 13 is {1,2,2,3}. - Gus Wiseman, Apr 26 2020

Examples

			1, 11, 12, 111, 112, 122, 123, 1111, 1112, 1122, 1123, 1222, 1223, 1233, ...
The 8 strings of length 4 are 1111, 1112, 1122, 1123, 1222, 1223, 1233, 1234.
From _Gus Wiseman_, Apr 26 2020: (Start)
The triangle read by columns begins:
  1:{1}  2:{1,1}  4:{1,1,1}   8:{1,1,1,1}  16:{1,1,1,1,1}
         3:{1,2}  5:{1,1,2}   9:{1,1,1,2}  17:{1,1,1,1,2}
                  6:{1,2,2}  10:{1,1,2,2}  18:{1,1,1,2,2}
                  7:{1,2,3}  11:{1,1,2,3}  19:{1,1,1,2,3}
                             12:{1,2,2,2}  20:{1,1,2,2,2}
                             13:{1,2,2,3}  21:{1,1,2,2,3}
                             14:{1,2,3,3}  22:{1,1,2,3,3}
                             15:{1,2,3,4}  23:{1,1,2,3,4}
                                           24:{1,2,2,2,2}
                                           25:{1,2,2,2,3}
                                           26:{1,2,2,3,3}
                                           27:{1,2,2,3,4}
                                           28:{1,2,3,3,3}
                                           29:{1,2,3,3,4}
                                           30:{1,2,3,4,4}
                                           31:{1,2,3,4,5}
(End)
		

Crossrefs

See A096299 for another version.
The number of distinct parts in row n is A000120(n), also the maximum part.
Row sums are A029931.
Heinz numbers of rows are A057335.
Row lengths are A070939.
Row products are A284001.
The version for prime indices is A305936.
There are A333942(n) multiset partitions of row n.
Multisets of compositions are counted by A034691.
Combinatory separations of normal multisets are A269134.
All of the following pertain to compositions in standard order (A066099):
- Necklaces are A065609.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon words are A275692.
- Dealings are counted by A333939.
- Distinct parts are counted by A334028.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    ptnToNorm[y_]:=Join@@Table[ConstantArray[i,y[[i]]],{i,Length[y]}];
    Table[ptnToNorm[stc[n]],{n,15}] (* Gus Wiseman, Apr 26 2020 *)

A284001 a(n) = A005361(A283477(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 4, 6, 1, 2, 4, 6, 8, 12, 18, 24, 1, 2, 4, 6, 8, 12, 18, 24, 16, 24, 36, 48, 54, 72, 96, 120, 1, 2, 4, 6, 8, 12, 18, 24, 16, 24, 36, 48, 54, 72, 96, 120, 32, 48, 72, 96, 108, 144, 192, 240, 162, 216, 288, 360, 384, 480, 600, 720, 1, 2, 4, 6, 8, 12, 18, 24, 16, 24, 36, 48, 54, 72, 96, 120, 32, 48, 72, 96, 108, 144, 192, 240, 162, 216, 288, 360, 384, 480
Offset: 0

Views

Author

Antti Karttunen, Mar 18 2017

Keywords

Comments

a(n) is the product of elements of the multiset that covers an initial interval of positive integers with multiplicities equal to the parts of the n-th composition in standard order (graded reverse-lexicographic, A066099). This composition is obtained by taking the set of positions of 1's in the reversed binary expansion of n, prepending 0, taking first differences, and reversing again. For example, the 13th composition is (1,2,1) giving the multiset {1,2,2,3} with product 12, so a(13) = 12. - Gus Wiseman, Apr 26 2020

Crossrefs

Row products of A095684.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Weighted sum is A029931.
- Necklaces are A065609.
- Sum is A070939.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon words are A275692.
- Distinct parts are counted by A334028.

Programs

  • Mathematica
    Table[Times @@ FactorInteger[#][[All, -1]] &[Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e == 1 :> {Times @@ Prime@ Range@ PrimePi@ p, e}] &[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[n, 2]]], {n, 0, 93}] (* Michael De Vlieger, Mar 18 2017 *)
  • PARI
    A005361(n) = factorback(factor(n)[, 2]); \\ From A005361
    A034386(n) = prod(i=1, primepi(n), prime(i));
    A108951(n) = { my(f=factor(n)); prod(i=1, #f~, A034386(f[i, 1])^f[i, 2]) };  \\ From A108951
    A019565(n) = {my(j,v); factorback(Mat(vector(if(n, #n=vecextract(binary(n), "-1..1")), j, [prime(j), n[j]])~))}; \\ From A019565
    A283477(n) = A108951(A019565(n));
    A284001(n) = A005361(A283477(n));
    
  • Scheme
    (define (A284001 n) (A005361 (A283477 n)))

Formula

a(n) = A005361(A283477(n)).
a(n) = A003963(A057335(n)). - Gus Wiseman, Apr 26 2020
a(n) = A284005(A053645(n)) for n > 0 with a(0) = 1. - Mikhail Kurkov, Jun 05 2021 [verification needed]
Showing 1-4 of 4 results.