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 11-15 of 15 results.

A349799 Numbers k such that the k-th composition in standard order is weakly alternating but has at least two adjacent equal parts.

Original entry on oeis.org

3, 7, 10, 11, 14, 15, 19, 21, 23, 26, 27, 28, 29, 30, 31, 35, 36, 39, 42, 43, 47, 51, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 71, 73, 74, 79, 83, 84, 85, 86, 87, 90, 91, 94, 95, 99, 100, 103, 106, 111, 112, 113, 114, 115, 118, 119, 120, 121, 122, 123, 124, 125
Offset: 1

Views

Author

Gus Wiseman, Dec 15 2021

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.
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.
This sequence ranks compositions that are weakly but not strongly alternating.

Examples

			The terms and corresponding compositions begin:
   3: (1,1)
   7: (1,1,1)
  10: (2,2)
  11: (2,1,1)
  14: (1,1,2)
  15: (1,1,1,1)
  19: (3,1,1)
  21: (2,2,1)
  23: (2,1,1,1)
  26: (1,2,2)
  27: (1,2,1,1)
  28: (1,1,3)
  29: (1,1,2,1)
  30: (1,1,1,2)
  31: (1,1,1,1,1)
		

Crossrefs

Partitions of this type are counted by A349795, ranked by A350137.
Permutations of prime indices of this type are counted by A349798.
These compositions are counted by A349800.
A001250 = alternating permutations, ranked by A349051, complement A348615.
A003242 = Carlitz (anti-run) compositions, ranked by A333489.
A025047/A025048/A025049 = alternating compositions, ranked by A345167.
A261983 = non-anti-run compositions, ranked by A348612.
A345164 = alternating permutations of prime indices, with twins A344606.
A345165 = partitions without an alternating permutation, ranked by A345171.
A345170 = partitions with an alternating permutation, ranked by A345172.
A345166 = separable partitions with no alternations, ranked by A345173.
A345192 = non-alternating compositions, ranked by A345168.
A345195 = non-alternating anti-run compositions, ranked by A345169.
A349052/A129852/A129853 = weakly alternating compositions.
A349053 = non-weakly alternating compositions, ranked by A349057.
A349056 = weak alternations of prime indices, complement A349797.
A349060 = weak alternations of partitions, complement A349061.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}];
    Select[Range[0,100],(whkQ[stc[#]]||whkQ[-stc[#]])&&MatchQ[stc[#],{_,x_,x_,_}]&]

Formula

A350251 Number of non-alternating permutations of the multiset of prime factors of n.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 0, 0, 0, 1, 0, 2, 0, 2, 0, 0, 0, 4, 1, 0, 1, 2, 0, 2, 0, 1, 0, 0, 0, 4, 0, 0, 0, 4, 0, 2, 0, 2, 2, 0, 0, 5, 1, 2, 0, 2, 0, 4, 0, 4, 0, 0, 0, 8, 0, 0, 2, 1, 0, 2, 0, 2, 0, 2, 0, 9, 0, 0, 2, 2, 0, 2, 0, 5, 1, 0, 0, 8, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Jan 08 2022

Keywords

Comments

A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).

Examples

			The a(n) permutations for selected n:
n = 4    12    24     48      60     72      90     96       120
   ----------------------------------------------------------------
    22   223   2223   22223   2235   22233   2335   222223   22235
         322   2232   22232   2253   22323   2353   222232   22253
               2322   22322   2352   22332   2533   222322   22325
               3222   23222   2532   23223   3235   223222   22352
                      32222   3225   23322   3325   232222   22523
                              3522   32223   3352   322222   22532
                              5223   32232   3532            23225
                              5322   32322   5233            23522
                                     33222   5323            25223
                                             5332            25322
                                                             32225
                                                             32252
                                                             32522
                                                             35222
                                                             52223
                                                             52232
                                                             52322
                                                             53222
		

Crossrefs

The non-anti-run case is A336107, complement A335452.
The complement is counted by A345164, with twins A344606.
Positions of nonzero terms are A345171, counted by A345165.
Positions of zeros are A345172, counted by A345170.
Compositions of this type are counted by A345192, ranked by A345168.
Ordered factorizations of this type counted by A348613, complement A348610.
Compositions weakly of this type are counted by A349053, ranked by A349057.
The weak version is A349797, complement A349056.
The case that is also weakly alternating is A349798, compositions A349800.
Patterns of this type are counted by A350252, complement A345194.
A001250 counts alternating permutations, complement A348615.
A003242 counts Carlitz (anti-run) compositions.
A008480 counts permutations of prime factors (ordered prime factorizations).
A025047/A025048/A025049 count alternating compositions, ranked by A345167.
A056239 adds up prime indices, row sums of A112798 (row lengths A001222).
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A344616 gives the alternating sum of prime indices, reverse A316524.
A349052/A129852/A129853 count weakly alternating compositions.

Programs

  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]] ==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[Permutations[Flatten[ ConstantArray@@@FactorInteger[n]]],!wigQ[#]&]],{n,100}]

Formula

a(n) = A008480(n) - A345164(n).

A129838 Number of up/down (or down/up) compositions of n into distinct parts.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 5, 6, 8, 11, 18, 21, 30, 38, 52, 78, 97, 128, 170, 222, 285, 421, 510, 683, 872, 1148, 1440, 1893, 2576, 3209, 4151, 5313, 6784, 8615, 10969, 13755, 18573, 22713, 29173, 36536, 46705, 57899, 73696, 91076, 114777, 148531, 182813, 228938, 287042
Offset: 0

Views

Author

Vladeta Jovovic, May 21 2007

Keywords

Comments

Original name was: Number of alternating compositions of n into distinct parts.
A composition is up/down if it is alternately strictly increasing and strictly decreasing, starting with an increase. - Gus Wiseman, Jan 15 2022

Examples

			From _Gus Wiseman_, Jan 15 2022: (Start)
The a(1) = 1 through a(8) = 8 up/down strict compositions (non-strict A025048):
  (1)  (2)  (3)    (4)    (5)    (6)      (7)      (8)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)    (1,7)
                          (2,3)  (2,4)    (2,5)    (2,6)
                                 (1,3,2)  (3,4)    (3,5)
                                 (2,3,1)  (1,4,2)  (1,4,3)
                                          (2,4,1)  (1,5,2)
                                                   (2,5,1)
                                                   (3,4,1)
The a(1) = 1 through a(8) = 8 down/up strict compositions (non-strict A025049):
  (1)  (2)  (3)    (4)    (5)    (6)      (7)      (8)
            (2,1)  (3,1)  (3,2)  (4,2)    (4,3)    (5,3)
                          (4,1)  (5,1)    (5,2)    (6,2)
                                 (2,1,3)  (6,1)    (7,1)
                                 (3,1,2)  (2,1,4)  (2,1,5)
                                          (4,1,2)  (3,1,4)
                                                   (4,1,3)
                                                   (5,1,2)
(End)
		

Crossrefs

The case of permutations is A000111.
This is the up/down case of A032020.
This is the strict case of A129852/A129853, strong A025048/A025049.
The undirected version is A349054.
A001250 = alternating permutations, complement A348615.
A003242 = Carlitz compositions, complement A261983.
A011782 = compositions, unordered A000041.
A025047 = alternating compositions, complement A345192.
A349052 = weakly alternating compositions, complement A349053.

Programs

  • Maple
    g:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(g(o-1+j, u-j), j=1..u))
        end:
    b:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
          `if`(k=0, `if`(n=0, 1, 0), b(n-k, k)+b(n-k, k-1)))
        end:
    a:= n-> add(b(n, k)*g(k, 0), k=0..floor((sqrt(8*n+1)-1)/2)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Dec 22 2021
  • Mathematica
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]y[[m+1]]],{m,1,Length[y]-1}];
    Table[Length[Select[Join@@Permutations/@ Select[IntegerPartitions[n],UnsameQ@@#&],whkQ]],{n,0,15}] (* Gus Wiseman, Jan 15 2022 *)

Formula

G.f.: Sum_{k>=0} A000111(k)*x^(k*(k+1)/2)/Product_{i=1..k} (1-x^i). - Vladeta Jovovic, May 24 2007
a(n) = Sum_{k=0..A003056(n)} A000111(k) * A008289(n,k). - Alois P. Heinz, Dec 22 2021
a(n) = (A349054(n) + 1)/2. - Gus Wiseman, Jan 15 2022

Extensions

a(0)=1 prepended by Alois P. Heinz, Dec 22 2021
Name changed from "alternating" to "up/down" by Gus Wiseman, Jan 15 2022

A350137 Nonsquarefree numbers whose prime signature, except possibly the first and last parts, is all even.

Original entry on oeis.org

4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 28, 32, 36, 40, 44, 45, 48, 49, 50, 52, 54, 56, 63, 64, 68, 72, 75, 76, 80, 81, 88, 90, 92, 96, 98, 99, 100, 104, 108, 112, 116, 117, 121, 124, 125, 126, 128, 135, 136, 144, 147, 148, 152, 153, 160, 162, 164, 169, 171, 172
Offset: 1

Views

Author

Gus Wiseman, Dec 23 2021

Keywords

Comments

A number's prime signature (row n of A124010) is the sequence of positive exponents in its prime factorization.
Also nonsquarefree numbers whose prime factors, taken in order and with multiplicity, are alternately constant and weakly increasing, starting with either.
Also the Heinz numbers of non-strict integer partitions whose part multiplicities, except possibly the first and last, are all even. These are counted by A349795.

Examples

			The terms together with their prime indices begin:
    4: {1,1}
    8: {1,1,1}
    9: {2,2}
   12: {1,1,2}
   16: {1,1,1,1}
   18: {1,2,2}
   20: {1,1,3}
   24: {1,1,1,2}
   25: {3,3}
   27: {2,2,2}
   28: {1,1,4}
   32: {1,1,1,1,1}
   36: {1,1,2,2}
   40: {1,1,1,3}
   44: {1,1,5}
   45: {2,2,3}
   48: {1,1,1,1,2}
		

Crossrefs

This is the nonsquarefree case of the complement of A349794.
These are the Heinz numbers of the partitions counted by A349795.
A version for compositions is A349799, counted by A349800.
A complementary version is A350140, counted by A349796.
A001250 = alternating permutations, ranked by A349051, complement A348615.
A005117 = squarefree numbers, complement A013929.
A025047/A025048/A025049 = alternating compositions, ranked by A345167.
A056239 adds up prime indices, row sums of A112798, row lengths A001222.
A124010 = prime signature, sorted A118914.
A345164 = alternating permutations of prime indices, complement A350251.
A349052/A129852/A129853 = weakly alternating compositions.
A349053 = non-weakly alternating compositions, ranked by A349057.
A349056 = weakly alternating permutations of prime indices.
A349058 = weakly alternating patterns, complement A350138.
A349060 = weakly alternating partitions, complement A349061.

Programs

  • Mathematica
    Select[Range[100],!SquareFreeQ[#]&&(PrimePowerQ[#]||And@@EvenQ/@Take[Last/@FactorInteger[#],{2,-2}])&]

A350353 Numbers whose multiset of prime factors has a permutation that is not weakly alternating.

Original entry on oeis.org

30, 36, 42, 60, 66, 70, 72, 78, 84, 90, 100, 102, 105, 108, 110, 114, 120, 126, 130, 132, 138, 140, 144, 150, 154, 156, 165, 168, 170, 174, 180, 182, 186, 190, 195, 196, 198, 200, 204, 210, 216, 220, 222, 225, 228, 230, 231, 234, 238, 240, 246, 252, 255, 258
Offset: 1

Views

Author

Gus Wiseman, Jan 13 2022

Keywords

Comments

We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.

Examples

			The terms together with a (generally not unique) non-weakly alternating permutation of each multiset of prime indices begin:
   30 : (1,2,3)       100 : (1,3,3,1)
   36 : (1,2,2,1)     102 : (1,2,7)
   42 : (1,2,4)       105 : (2,3,4)
   60 : (1,1,2,3)     108 : (1,2,2,1,2)
   66 : (1,2,5)       110 : (1,3,5)
   70 : (1,3,4)       114 : (1,2,8)
   72 : (1,1,2,2,1)   120 : (1,1,1,2,3)
   78 : (1,2,6)       126 : (1,2,4,2)
   84 : (1,1,2,4)     130 : (1,3,6)
   90 : (1,2,3,2)     132 : (1,1,2,5)
		

Crossrefs

The strong version is A289553, complement A167171.
These are the positions of nonzero terms in A349797.
Below, WA = "weakly alternating":
- WA compositions are counted by A349052/A129852/A129853.
- Non-WA compositions are counted by A349053, ranked by A349057.
- WA permutations of prime factors = A349056, complement A349797.
- WA patterns are counted by A349058, complement A350138.
- WA ordered factorizations are counted by A349059, complement A350139.
- WA partitions are counted by A349060, complement A349061.
A001250 counts alternating permutations, complement A348615.
A008480 counts permutations of prime factors.
A025047 = alternating compositions, ranked by A345167, complement A345192.
A056239 adds up prime indices, row sums of A112798 (row lengths A001222).
A071321 gives the alternating sum of prime factors, reverse A071322.
A335452 counts anti-run permutations of prime factors, complement A336107.
A345164 = alternating permutations of prime factors, complement A350251.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}];
    Select[Range[100],Select[Permutations[primeMS[#]],!whkQ[#]&&!whkQ[-#]&]!={}&]
Previous Showing 11-15 of 15 results.