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.

A178932 Partitions into distinct parts where no subset of the summands is an arithmetic progression (of length 3 or more).

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 5, 6, 6, 9, 11, 11, 15, 19, 18, 26, 29, 32, 38, 48, 47, 62, 68, 79, 89, 108, 110, 135, 152, 166, 191, 223, 237, 275, 306, 345, 380, 429, 472, 537, 588, 650, 721, 808, 902, 972, 1083, 1205, 1316, 1450, 1617, 1742, 1919, 2130, 2312, 2531
Offset: 0

Views

Author

David S. Newman, Dec 30 2010

Keywords

Comments

a(0) = 1 as is common practice with partitions.

Examples

			There are 4 partitions of 6 into distinct parts, 6, 5+1, 4+2, and 3+2+1.  Since 3+2+1 contains the arithmetic progression 3,2,1, it won't be counted here.  Thus a(6)=3.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 0, 1, Select[IntegerPartitions[n],
         With[{u = Union[#]}, Length[#] == Length[u] &&
         SequencePosition[u, {b_, _, c_, _, d_} /;
         b-c == c-d, 1] == {}]&] // Length];
    Table[an = a[n]; Print[n, " ", an]; an, {n, 0, 60}] (* Jean-François Alcover, Aug 20 2021 *)
  • Sage
    has_arith_prog = lambda x, size: any(len(set(differences(c))) <= 1 for c in Combinations(x,size))
    A178932 = lambda n: Partitions(n,max_slope=-1).filter(lambda p: not has_arith_prog(sorted(p),3)).cardinality() # [D. S. McNeil, Dec 31 2010]

A368357 Consider the doubly-infinite permutation P defined on page 87 of Davis et al. (1977); sequence gives the terms starting at and to the right of 1.

Original entry on oeis.org

1, 2, 3, 8, 12, 10, 14, 9, 13, 11, 15, 32, 48, 40, 56, 36, 52, 44, 60, 34, 50, 42, 58, 38, 54, 46, 62, 33, 49, 41, 57, 37, 53, 45, 61, 35, 51, 43, 59, 39, 55, 47, 63, 128, 192, 160, 224, 144, 208, 176, 240, 136, 200, 168, 232, 152, 216, 184, 248, 132, 196, 164, 228, 148, 212
Offset: 0

Views

Author

N. J. A. Sloane, Dec 31 2023

Keywords

Comments

P is a doubly-infinite sequence which is a permutation of the positive integers and contains no increasing or decreasing 4-term arithmetic progression.
A central portion of P, showing terms to the left (see A368358) and right (the present sequence) of the central 1:
..., 18, 28, 20, 24, 16, 7, 5, 6, 4, 1, 2, 3, 8, 12, 10, 14, 9, 13, 11, 15, ...
See the link for a larger portion.

Crossrefs

Cf. A003407, A368358 (the left-hand portion, reversed).

A296530 Number of non-averaging permutations of [n] with first element n.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 5, 10, 28, 24, 50, 124, 283, 528, 1266, 3715, 10702, 8740, 15414, 31988, 68465, 160964, 380124, 890738, 2230219, 3990852, 8354276, 20281732, 46056920, 131289988, 349369117, 1054037937, 3081527146, 2440225484, 4201202020, 7475926894, 13276918426
Offset: 0

Views

Author

Alois P. Heinz, Dec 14 2017

Keywords

Comments

A non-averaging permutation avoids any 3-term arithmetic progression.
a(0) = 1 by convention.

Examples

			a(4) = 2: 4213, 4231.
a(5) = 2: 51324, 51342.
a(6) = 5: 621453, 624153, 624315, 624351, 624513.
a(7) = 10: 7312564, 7315264, 7315426, 7315462, 7315624, 7351264, 7351426, 7351462, 7351624, 7356124.
		

Crossrefs

Main diagonal of A296529.

Programs

  • Maple
    b:= proc(s) option remember; local n, r, ok, i, j, k;
          if nops(s) = 1 then 1
        else n, r:= max(s), 0;
             for j in s minus {n} do ok, i, k:= true, j-1, j+1;
               while ok and i>=0 and k b({$0..n} minus {n-1}):
    seq(a(n), n=0..30);
  • Mathematica
    b[s_] := b[s] = Module[{n = Max[s], r = 0, ok, i, j, k}, If[Length[s] == 1, 1, Do[{ok, i, k} = {True, j - 1, j + 1}; While[ok && i >= 0 && k < n, {ok, i, k} = {FreeQ[s, i] ~Xor~ MemberQ[s, k], i - 1, k + 1}]; r = r + If[ok, b[s ~Complement~ {j}], 0], {j, s ~Complement~ {n}}]; r]];
    a[n_] := b[Complement[Range[0, n], {n - 1}]]
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 02 2018, from Maple *)

Formula

a(n) = A296529(n,n).

A296531 Number of non-averaging permutations of [n] with first element ceiling(n/2).

Original entry on oeis.org

1, 1, 1, 2, 3, 6, 13, 32, 51, 76, 161, 386, 903, 2280, 5018, 12828, 19720, 27656, 48788, 100120, 220686, 537208, 1258242, 3123166, 7056165, 17189752, 35968308, 82137764, 189847917, 509880208, 1322092262, 3807727932, 5678509066, 7721623440, 13293899416, 23650787296
Offset: 0

Views

Author

Alois P. Heinz, Dec 14 2017

Keywords

Comments

A non-averaging permutation avoids any 3-term arithmetic progression.
a(0) = 1 by convention.

Examples

			a(5) = 6: 31254, 31524, 31542, 35124, 35142, 35412.
a(6) = 13: 312564, 315264, 315426, 315462, 315624, 351264, 351426, 351462, 351624, 354126, 354162, 354612, 356124.
		

Crossrefs

Programs

  • Maple
    b:= proc(s) option remember; local n, r, ok, i, j, k;
          if nops(s) = 1 then 1
        else n, r:= max(s), 0;
             for j in s minus {n} do ok, i, k:= true, j-1, j+1;
               while ok and i>=0 and k b({$0..n} minus {ceil(n/2)-1}):
    seq(a(n), n=0..25);
  • Mathematica
    b[s_] := b[s] = Module[{n = Max[s], r = 0, ok, i, j, k}, If[Length[s] == 1, 1, Do[{ok, i, k} = {True, j - 1, j + 1}; While[ok && i >= 0 && k < n, {ok, i, k} = {FreeQ[s, i] ~Xor~ MemberQ[s, k], i - 1, k + 1}]; r = r + If[ok, b[s ~Complement~ {j}], 0], {j, s ~Complement~ {n}}]; r]];
    a[n_] := b[Complement[Range[0, n], {Ceiling[n/2] - 1}]];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jun 02 2018, from Maple *)

Formula

a(n) = A296529(n,ceiling(n/2)).

A368358 Consider the doubly-infinite permutation P defined on page 87 of Davis et al. (1977); sequence gives the terms starting at and to the left of 1, in reverse order.

Original entry on oeis.org

1, 4, 6, 5, 7, 16, 24, 20, 28, 18, 26, 22, 30, 17, 25, 21, 29, 19, 27, 23, 31, 64, 96, 80, 112, 72, 104, 88, 120, 68, 100, 84, 116, 76, 108, 92, 124, 66, 98, 82, 114, 74, 106, 90, 122, 70, 102, 86, 118, 78, 110, 94, 126, 65, 97, 81, 113, 73, 105, 89, 121, 69, 101, 85, 117, 77, 109
Offset: 0

Views

Author

N. J. A. Sloane, Dec 31 2023

Keywords

Comments

P is a doubly-infinite sequence which is a permutation of the positive integers and contains no increasing or decreasing 4-term arithmetic progression.
A central portion of P, showing terms to the left (the present sequence) and right (A368357) of the central 1:
..., 18, 28, 20, 24, 16, 7, 5, 6, 4, 1, 2, 3, 8, 12, 10, 14, 9, 13, 11, 15, ...
See the link for a larger portion.

Crossrefs

Cf. A003407, A368357 (the right-hand portion).

A339941 Triangle read by rows: T(n,k) is the number of permutations of {1,...,n} whose longest embedded arithmetic progression has length k.

Original entry on oeis.org

1, 0, 2, 0, 4, 2, 0, 10, 12, 2, 0, 20, 82, 16, 2, 0, 48, 516, 134, 20, 2, 0, 104, 3232, 1480, 198, 24, 2, 0, 282, 21984, 15702, 2048, 274, 28, 2, 0, 496, 168368, 162368, 28048, 3204, 362, 32, 2, 0, 1066, 1306404, 1902496, 374194, 39420, 4720, 462, 36, 2, 0, 2460, 11064306, 23226786, 4929828, 622140, 64020, 6644, 574, 40, 2
Offset: 1

Views

Author

Marcel K. Goh, Dec 23 2020

Keywords

Comments

Asymptotics can be found in Goh and Zhao (2020). The column k=2 corresponds to the number of 3-free permutations of 1..n, for n>=2.

Examples

			Triangle T(n,k) begins:
  n/k 1    2         3         4        5       6      7     8    9 10 11 12
   1  1
   2  0    2
   3  0    4         2
   4  0   10        12         2
   5  0   20        82        16        2
   6  0   48       516       134       20       2
   7  0  104      3232      1480      198      24      2
   8  0  282     21984     15702     2048     274     28     2
   9  0  496    168368    162368    28048    3204    362    32    2
  10  0 1066   1306404   1902496   374194   39420   4720   462   36   2
  11  0 2460  11064306  23226786  4929828  622140  64020  6644  574  40  2
  12  0 6128 101355594 298314654 68584052 9719492 913440 98472 9024 698 44 2
		

Crossrefs

Cf. A003407 (column k=2), A338993, A339942.
Previous Showing 11-16 of 16 results.