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

A332668 Number of strict integer partitions of n without three consecutive parts in arithmetic progression.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 5, 6, 6, 9, 11, 11, 15, 20, 19, 26, 31, 34, 41, 50, 53, 67, 78, 84, 99, 120, 130, 154, 177, 193, 226, 262, 291, 332, 375, 419, 479, 543, 608, 676, 765, 859, 961, 1075, 1202, 1336, 1495, 1672, 1854, 2050, 2301, 2536, 2814, 3142, 3448, 3809
Offset: 0

Views

Author

Gus Wiseman, Mar 28 2020

Keywords

Comments

Also the number of strict integer partitions of n whose first differences are an anti-run, meaning there are no adjacent equal differences.

Examples

			The a(1) = 1 through a(10) = 9 partitions (A = 10):
  (1)  (2)  (3)   (4)   (5)   (6)   (7)    (8)    (9)    (A)
            (21)  (31)  (32)  (42)  (43)   (53)   (54)   (64)
                        (41)  (51)  (52)   (62)   (63)   (73)
                                    (61)   (71)   (72)   (82)
                                    (421)  (431)  (81)   (91)
                                           (521)  (621)  (532)
                                                         (541)
                                                         (631)
                                                         (721)
		

Crossrefs

Anti-run compositions are counted by A003242.
Normal anti-runs of length n + 1 are counted by A005649.
Strict partitions with equal differences are A049980.
Partitions with equal differences are A049988.
The non-strict version is A238424.
The version for permutations is A295370.
Anti-run compositions are ranked by A333489.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&!MatchQ[Differences[#],{_,x_,x_,_}]&]],{n,0,30}]

A295390 Number T(n,k) of permutations of [n] having exactly k consecutive 3-term arithmetic progressions; triangle T(n,k), n>=0, 0<=k<=max(n-2,0), read by rows.

Original entry on oeis.org

1, 1, 2, 4, 2, 18, 4, 2, 80, 34, 4, 2, 482, 196, 36, 4, 2, 3280, 1418, 292, 44, 4, 2, 26244, 11292, 2426, 304, 48, 4, 2, 231148, 106132, 22156, 3010, 372, 56, 4, 2, 2320130, 1046176, 225804, 32308, 3892, 424, 60, 4, 2, 25238348, 11679626, 2585080, 366484, 42176, 4540, 472, 68, 4, 2
Offset: 0

Views

Author

Alois P. Heinz, Nov 21 2017

Keywords

Examples

			Triangle T(n,k) begins:
        1;
        1;
        2;
        4,       2;
       18,       4,      2;
       80,      34,      4,     2;
      482,     196,     36,     4,    2;
     3280,    1418,    292,    44,    4,   2;
    26244,   11292,   2426,   304,   48,   4,  2;
   231148,  106132,  22156,  3010,  372,  56,  4, 2;
  2320130, 1046176, 225804, 32308, 3892, 424, 60, 4, 2;
  ...
		

Crossrefs

Column k=0 gives A295370.
Row sums give A000142.

A333195 Numbers with three consecutive prime indices in arithmetic progression.

Original entry on oeis.org

8, 16, 24, 27, 30, 32, 40, 48, 54, 56, 60, 64, 72, 80, 81, 88, 96, 104, 105, 108, 110, 112, 120, 125, 128, 135, 136, 144, 150, 152, 160, 162, 168, 176, 184, 189, 192, 200, 208, 210, 216, 220, 224, 232, 238, 240, 243, 248, 250, 256, 264, 270, 272, 273, 280, 288
Offset: 1

Views

Author

Gus Wiseman, Mar 29 2020

Keywords

Comments

Also numbers whose first differences of prime indices do not form an anti-run, meaning there are adjacent equal differences.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of terms together with their prime indices begins:
    8: {1,1,1}          105: {2,3,4}
   16: {1,1,1,1}        108: {1,1,2,2,2}
   24: {1,1,1,2}        110: {1,3,5}
   27: {2,2,2}          112: {1,1,1,1,4}
   30: {1,2,3}          120: {1,1,1,2,3}
   32: {1,1,1,1,1}      125: {3,3,3}
   40: {1,1,1,3}        128: {1,1,1,1,1,1,1}
   48: {1,1,1,1,2}      135: {2,2,2,3}
   54: {1,2,2,2}        136: {1,1,1,7}
   56: {1,1,1,4}        144: {1,1,1,1,2,2}
   60: {1,1,2,3}        150: {1,2,3,3}
   64: {1,1,1,1,1,1}    152: {1,1,1,8}
   72: {1,1,1,2,2}      160: {1,1,1,1,1,3}
   80: {1,1,1,1,3}      162: {1,2,2,2,2}
   81: {2,2,2,2}        168: {1,1,1,2,4}
   88: {1,1,1,5}        176: {1,1,1,1,5}
   96: {1,1,1,1,1,2}    184: {1,1,1,9}
  104: {1,1,1,6}        189: {2,2,2,4}
		

Crossrefs

Anti-run compositions are counted by A003242.
Normal anti-runs of length n + 1 are counted by A005649.
Strict partitions with equal differences are A049980.
Partitions with equal differences are A049988.
These are the Heinz numbers of the partitions *not* counted by A238424.
Permutations avoiding triples in arithmetic progression are A295370.
Strict partitions avoiding triples in arithmetic progression are A332668.
Anti-run compositions are ranked by A333489.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],MatchQ[Differences[primeMS[#]],{_,x_,x_,_}]&]

A338765 Number of permutations p of [n] such that | |p(i) - p(i-1)| - |p(i+1) - p(i)| | <= 1.

Original entry on oeis.org

1, 1, 2, 6, 18, 38, 76, 162, 330, 650, 1272, 2586, 5262, 10506, 20856, 41928, 83684, 165800, 329310, 653614, 1303388, 2584660, 5139580, 10210912, 20288128, 40224174, 79824572, 158316222, 314272812
Offset: 0

Views

Author

Alois P. Heinz, Nov 07 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(s, x, y) option remember; `if`(s={}, 1, add(
          `if`(x=0 or y=0 or abs(abs(x-y)-abs(y-j))<=1,
             b(s minus {j}, y, j), 0), j=s))
        end:
    a:= n-> b({$1..n}, 0$2):
    seq(a(n), n=0..15);
  • Mathematica
    b[s_, x_, y_] := b[s, x, y] = If[s == {}, 1, Sum[
         If[x == 0 || y == 0 || Abs[Abs[x - y] - Abs[y - j]] <= 1,
         b[s ~Complement~ {j}, y, j], 0], {j, s}]];
    a[n_] := b[Range[n], 0, 0];
    a /@ Range[0, 15] (* Jean-François Alcover, Apr 26 2021, after Alois P. Heinz *)

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

A348534 Number of permutations p of [n] whose absolute differences between consecutive elements yield up-down sequences.

Original entry on oeis.org

1, 1, 2, 2, 8, 20, 82, 326, 1678, 8776, 54804, 357910, 2646340, 20551986, 176420758, 1586656630, 15504954504, 158675287132, 1738817196038, 19931418239724, 242312687882510
Offset: 0

Views

Author

Alois P. Heinz, Oct 25 2021

Keywords

Comments

Number of permutations p of [n] such that |p(i-1)-p(i)| < |p(i)-p(i+1)| if i is even and |p(i-1)-p(i)| > |p(i)-p(i+1)| if i is odd.

Examples

			a(0) = 1: (), the empty permutation.
a(1) = 1: 1.
a(2) = 2: 12, 21.
a(3) = 2: 213, 231.
a(4) = 8: 1243, 2134, 2143, 2413, 3142, 3412, 3421, 4312.
a(5) = 20: 12435, 12453, 21435, 21453, 23541, 31425, 31452, 31542, 32451, 32541, 34125, 34215, 35124, 35214, 35241, 43125, 45213, 45231, 54213, 54231.
a(6) = 82: 124356, 124365, 125364, 125634, ..., 652143, 652413, 653412, 653421.
		

Crossrefs

Programs

  • Maple
    b:= proc(s, x, y) option remember; (n-> `if`(n=0, 1, add((d->
         `if`(x=0 or n::even and xd, b(s minus {j},
         `if`(y=0, 0, d), j), 0))(abs(y-j)), j=s)))(nops(s))
        end:
    a:= n-> b({$1..n}, 0$2):
    seq(a(n), n=0..12);
  • Mathematica
    b[s_, x_, y_] := b[s, x, y] = Function[n, If[n == 0, 1, Sum[Function[d,
         If[x == 0 || EvenQ[n] && x < d || OddQ[n] && x > d, b[s ~Complement~
         {j}, If[y == 0, 0, d], j], 0]][Abs[y - j]], {j, s}]]][Length[s]];
    a[n_] := b[Range[n], 0, 0];
    Table[a[n], {n, 0, 12}] (* Jean-François Alcover, Mar 07 2022, after Alois P. Heinz *)
Previous Showing 11-16 of 16 results.