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

A102726 Number of compositions of the integer n into positive parts that avoid a fixed pattern of three letters.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 31, 60, 114, 214, 398, 732, 1334, 2410, 4321, 7688, 13590, 23869, 41686, 72405, 125144, 215286, 368778, 629156, 1069396, 1811336, 3058130, 5147484, 8639976, 14463901, 24154348, 40244877, 66911558, 111026746, 183886685, 304034456, 501877227
Offset: 0

Views

Author

Herbert S. Wilf, Feb 07 2005

Keywords

Comments

The sequence is the same no matter which of the six patterns of three letters is chosen as the one to be avoided.

Examples

			a(6) = 31 because there are 32 compositions of 6 into positive parts and only one of these, namely 6 = 1+2+3, contains the pattern (123), the other 31 compositions of 6 avoid that pattern.
		

Crossrefs

The version for patterns is A226316.
These compositions are ranked by the complement of A335479.
The matching version is A335514.
The version for prime indices is A335521.
Constant patterns are counted by A000005 and ranked by A272919.
Permutations are counted by A000142 and ranked by A333218.
Patterns are counted by A000670 and ranked by A333217.
Compositions are counted by A011782.
Strict compositions are counted by A032020 and ranked by A233564.
Patterns matched by compositions are counted by A335456.
Minimal patterns avoided by a given composition are counted by A335465.

Programs

  • Maple
    b:= proc(n, m, t) option remember; `if`(n=0, 1,
          add(b(n-i, min(m, i, n-i), min(t, n-i,
          `if`(i>m, i, t))), i=1..min(n, t)))
        end:
    a:= n-> b(n$3):
    seq(a(n), n=0..50);  # Alois P. Heinz, Mar 18 2014
  • Mathematica
    b[n_, m_, t_] := b[n, m, t] = If[n == 0, 1, Sum[b[n - i, Min[m, i, n - i], Min[t, n - i, If[i > m, i, t]]], {i, 1, Min[n, t]}]];
    a[n_] := b[n, n, n];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Nov 10 2017, after Alois P. Heinz *)
    mstype[q_]:=q/.Table[Union[q][[i]]->i,{i,Length[Union[q]]}];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[Union[mstype/@Subsets[#]],{1,2,3}]&]],{n,0,10}] (* Gus Wiseman, Jun 22 2020 *)
  • PARI
    seq(n)={Vec(sum(i=1, n, prod(j=1, n, if(i==j, 1, (1-x^i)/((1-x^(j-i))*(1-x^i-x^j))) + O(x*x^n))/(1-x^i)))} \\ Andrew Howroyd, Dec 31 2020

Formula

G.f.: Sum_{i>=1} (1/(1-x^i))*Product_{j>=1, j<>i} (1-x^i)/((1-x^(j-i))*(1-x^i-x^j)).
Asymptotics (Savage and Wilf, 2005): a(n) ~ c * ((1+sqrt(5))/2)^n, where c = r/(r-1)/(r-s) * (r * Product_{j>=3} (1-1/r)/(1-r^(1-j))/(1-1/r-r^(-j)) - Product_{j>=3} (1-1/r^2)/(1-r^(2-j))/(1-1/r^2-r^(-j)) ) = 18.9399867283479198666671671745270505487677312850521421513193261105... and r = (1+sqrt(5))/2, s = (1-sqrt(5))/2. - Vaclav Kotesovec, May 02 2014

Extensions

More terms from Ralf Stephan, May 27 2005

A333175 If n = Product (p_j^k_j) then a(n) = Sum (a(n/p_j^k_j)), with a(1) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 6, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 6, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 6, 1, 2, 2, 1, 2, 6, 1, 2, 2, 6, 1, 2, 1, 2, 2, 2, 2, 6, 1, 2, 1, 2, 1, 6, 2, 2, 2, 2, 1, 6, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 11 2020

Keywords

Comments

Number of ordered prime factorizations of radical of n.
Number of permutations of the prime indices of n (counting multiplicity) avoiding the patterns (1,2,1) and (2,1,2). These are permutations with all equal parts contiguous. Depends only on sorted prime signature (A118914). - Gus Wiseman, Jun 27 2020

Examples

			From _Gus Wiseman_, Jun 27 2020 (Start)
The a(n) permutations of prime indices for n = 2, 12, 60:
  (1)  (112)  (1123)
       (211)  (1132)
              (2113)
              (2311)
              (3112)
              (3211)
(End)
		

Crossrefs

Dominates A335451.
Permutations of prime indices are A008480.
Unsorted prime signature is A124010. Sorted prime signature is A118914.
(1,2,1)-avoiding permutations of prime indices are A335449.
(2,1,2)-avoiding permutations of prime indices are A335450.
(1,2,1) or (2,1,2)-matching permutations of prime indices are A335460.
(1,2,1) and (2,1,2)-matching permutations of prime indices are A335462.

Programs

  • Maple
    f:= n -> nops(numtheory:-factorset(n))!:
    map(f, [$1..100]); # Robert Israel, Mar 12 2020
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Plus @@ (a[n/#[[1]]^#[[2]]] & /@ FactorInteger[n]); Table[a[n], {n, 1, 100}]
    a[1] = 1; a[n_] := a[n] = Sum[If[GCD[n/d, d] == 1 && d < n, Boole[PrimePowerQ[n/d]] a[d], 0], {d, Divisors[n]}]; Table[a[n], {n, 1, 100}]
    Table[PrimeNu[n]!, {n, 1, 100}]

Formula

a(1) = 1; a(n) = Sum_{d|n, d < n, gcd(d, n/d) = 1} A069513(n/d) * a(d).
a(n) = A000142(A001221(n)).

A335514 Number of (1,2,3)-matching compositions of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 4, 14, 42, 114, 292, 714, 1686, 3871, 8696, 19178, 41667, 89386, 189739, 399144, 833290, 1728374, 3565148, 7319212, 14965880, 30496302, 61961380, 125577752, 253971555, 512716564, 1033496947, 2080572090, 4183940550, 8406047907, 16875834728
Offset: 0

Views

Author

Gus Wiseman, Jun 22 2020

Keywords

Examples

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

Crossrefs

The version for permutations is A056986.
The avoiding version is A102726.
These compositions are ranked by A335479.
The version for patterns is A335515.
The version for prime indices is A335520.
Permutations are counted by A000142 and ranked by A333218.
Patterns are counted by A000670 and ranked by A333217.
Patterns matched by compositions are counted by A335456.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],MatchQ[#,{_,x_,_,y_,_,z_,_}/;x
    				

Formula

a(n > 0) = 2^(n - 1) - A102726(n).

Extensions

Terms a(21) and beyond from Andrew Howroyd, Dec 31 2020

A226316 Expansion of g.f. 1/2 + 1/(1+sqrt(1-8*x+8*x^2)).

Original entry on oeis.org

1, 1, 3, 12, 56, 284, 1516, 8384, 47600, 275808, 1624352, 9694912, 58510912, 356467392, 2189331648, 13540880384, 84265071360, 527232146944, 3314742364672, 20930141861888, 132673039491072, 843959152564224, 5385800362473472, 34470606645280768, 221213787774230528, 1423139139514138624
Offset: 0

Views

Author

N. J. A. Sloane, Jun 09 2013

Keywords

Comments

From Robert A. Proctor, Jul 18 2017: (Start)
a(n) is the number of words of length n on {1,2,...,r} with positive multiplicities as 1 <= r <= n avoiding the pattern 123. [This is easy to see from the next comment.]
a(n) is the number of 123-avoiding ordered set partitions of {1,2,...,n}. [This is Cor. 2.3 of the Chen-Dai-Zhou reference.] (End)

Examples

			From _Gus Wiseman_, Jun 25 2020: (Start)
The a(0) = 1 through a(3) = 12 words that are (1,2,3)-avoiding and cover an initial interval:
  ()  (1)  (1,1)  (1,1,1)
           (1,2)  (1,1,2)
           (2,1)  (1,2,1)
                  (1,2,2)
                  (1,3,2)
                  (2,1,1)
                  (2,1,2)
                  (2,1,3)
                  (2,2,1)
                  (2,3,1)
                  (3,1,2)
                  (3,2,1)
(End)
		

Crossrefs

Cf. A220097.
Sequences covering an initial interval are counted by A000670.
(1,2,3)-matching permutations are counted by A056986.
(1,2,3)-avoiding permutations are counted by A000108.
(1,2,3)-matching compositions are counted by A335514.
(1,2,3)-avoiding compositions are counted by A102726.
(1,2,3)-matching patterns are counted by A335515.
(1,2,3)-avoiding patterns are counted by A226316 (this sequence).
(1,2,3)-matching permutations of prime indices are counted by A335520.
(1,2,3)-avoiding permutations of prime indices are counted by A335521.
(1,2,3)-matching compositions are ranked by A335479.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<4, [1$2, 3, 12][n+1],
          ((9*n-3)*a(n-1) -(16*n-20)*a(n-2) +(8*n-16)*a(n-3))/(n+1))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Jun 18 2013
  • Mathematica
    CoefficientList[Series[1/2 + 1 / (1 + Sqrt[1 - 8 x + 8 x^2]), {x, 0, 30}], x] (* Vincenzo Librandi, Jun 18 2013 *)
    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_,_}/;xGus Wiseman, Jun 25 2020 *)

Formula

a(n) ~ sqrt((sqrt(2)-1)/Pi)*2^(n-1/2)*(2+sqrt(2))^n/n^(3/2). - Vaclav Kotesovec, Jun 29 2013
Conjecture: (n+1)*a(n) +3*(-3*n+1)*a(n-1) +4*(4*n-5)*a(n-2) +8*(-n+2)*a(n-3)=0. - R. J. Mathar, Apr 02 2015
a(n) = A000670(n) - A335515(n). - Gus Wiseman, Jun 25 2020

A335520 Number of (1,2,3)-matching permutations of the prime indices of n.

Original entry on oeis.org

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

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(n) permutations for n = 30, 60, 120, 210, 180, 480:
  (123)  (1123)  (11123)  (1234)  (11223)  (1111123)
         (1213)  (11213)  (1243)  (11232)  (1111213)
         (1231)  (11231)  (1324)  (12123)  (1111231)
                 (12113)  (1342)  (12132)  (1112113)
                 (12131)  (1423)  (12213)  (1112131)
                 (12311)  (2134)  (12231)  (1112311)
                          (2314)  (12312)  (1121113)
                          (2341)  (12321)  (1121131)
                          (3124)  (21123)  (1121311)
                          (4123)  (21213)  (1123111)
                                  (21231)  (1211113)
                                           (1211131)
                                           (1211311)
                                           (1213111)
                                           (1231111)
		

Crossrefs

Positions of nonzero terms are A000977.
These permutations are ranked by A335479.
These compositions are counted by A335514.
Patterns matching this pattern are counted by A335515.
The complement A335521 is the avoiding version.
Permutations of prime indices are counted by A008480.
Patterns are counted by A000670 and ranked by A333217.
Anti-run permutations of prime indices are counted by A335452.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Select[Permutations[primeMS[n]],MatchQ[#,{_,x_,_,y_,_,z_,_}/;x
    				

Formula

For n > 0, a(n) + A335521(n) = A008480(n).
Showing 1-5 of 5 results.