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.

A238424 Number of partitions of n without three consecutive parts in arithmetic progression.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 6, 8, 13, 13, 19, 24, 30, 36, 47, 54, 72, 85, 106, 123, 151, 178, 220, 256, 314, 362, 432, 505, 605, 692, 827, 953, 1121, 1303, 1522, 1729, 2037, 2321, 2691, 3095, 3577, 4061, 4699, 5334, 6126, 6959, 7966, 9005, 10317, 11638, 13252, 14977
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 26 2014

Keywords

Comments

Also the number of partitions of n whose first differences are an anti-run, meaning there are no adjacent equal differences. - Gus Wiseman, Mar 31 2020

Examples

			The a(8) = 13 such partitions are:
01:  [ 3 2 2 1 ]
02:  [ 3 3 1 1 ]
03:  [ 3 3 2 ]
04:  [ 4 2 1 1 ]
05:  [ 4 2 2 ]
06:  [ 4 3 1 ]
07:  [ 4 4 ]
08:  [ 5 2 1 ]
09:  [ 5 3 ]
10:  [ 6 1 1 ]
11:  [ 6 2 ]
12:  [ 7 1 ]
13:  [ 8 ]
		

Crossrefs

Cf. A238433 (partitions avoiding equidistant arithmetic progressions).
Cf. A238571 (partitions avoiding any arithmetic progression).
Cf. A238687.
The version for compositions is A238423, with strict case A325849.
The version for permutations is A295370.
The strict case is A332668.
The Heinz numbers of these partitions are the complement of A333195.
Partitions with equal differences are A049988.

Programs

  • Mathematica
    a[n_,r_,d_] := a[n,r,d] = Block[{j}, If[n == 0, 1, Sum[If[j == r+d, 0, a[n-j, j, j - r]], {j, Min[n, r]}]]]; a[n_] := a[n, 2*n+1, 0]; a /@ Range[0, 100] (* Giovanni Resta, Mar 02 2014 *)
    Table[Length[Select[IntegerPartitions[n],!MemberQ[Differences[#,2],0]&]],{n,0,30}] (* Gus Wiseman, Mar 31 2020 *)

A238569 Number of compositions of n avoiding any 3-term arithmetic progression.

Original entry on oeis.org

1, 1, 2, 3, 7, 11, 19, 28, 53, 83, 140, 201, 332, 486, 775, 1207, 1716, 2498, 3870, 5623, 8020, 11276, 17168, 23323, 34746, 46141, 64879, 90467, 127971, 176201, 242869, 333508, 456683, 606403, 844818, 1125922, 1496466, 2005446, 2737912, 3543506, 4824442
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 28 2014

Keywords

Examples

			a(3) = 3: [1,2], [2,1], [3].
a(4) = 7: [1,1,2], [1,2,1], [1,3], [2,1,1], [2,2], [3,1], [4].
a(5) = 11: [1,1,3], [1,2,2], [1,3,1], [1,4], [2,1,2], [2,2,1], [2,3], [3,1,1], [3,2], [4,1], [5].
a(6) = 19: [1,1,2,2], [1,1,4], [1,2,1,2], [1,2,2,1], [1,3,2], [1,4,1], [1,5], [2,1,1,2], [2,1,2,1], [2,1,3], [2,2,1,1], [2,3,1], [2,4], [3,1,2], [3,3], [4,1,1], [4,2], [5,1], [6].
		

Crossrefs

Cf. A003407 (the same for permutations).
Cf. A178932 (the same for strict partitions).
Cf. A238423 (the same for consecutive 3-term arithmetic progressions).
Cf. A238571 (the same for partitions).
Cf. A238686.

Programs

  • Maple
    b:= proc(n, i, o) option remember; `if`(n=0, 1, add(
          `if`(j in o, 0, b(n-j, i union {j}, select(y->02*j-x, i)))), j=1..n))
        end:
    a:= n-> b(n, {}, {}):
    seq(a(n), n=0..30);
  • Mathematica
    b[n_, i_List, o_List] := b[n, i, o] = If[n == 0, 1, Sum[If[MemberQ[o, j], 0, b[n - j, i  ~Union~ {j}, Select[o ~Union~ (2j-i), 0<# && # <= n &]]], {j, 1, n}]]; a[n_] := b[n, {}, {}]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 06 2015, translated from Maple *)

A238687 Number of partitions p of n such that no three points (i,p_i), (j,p_j), (k,p_k) are collinear, where p_i denotes the i-th part.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 6, 8, 13, 10, 18, 21, 27, 29, 41, 41, 62, 65, 77, 91, 114, 127, 151, 173, 213, 232, 279, 322, 372, 410, 491, 518, 630, 724, 814, 894, 1057, 1141, 1326, 1502, 1681, 1839, 2146, 2324, 2636, 2966, 3272, 3607, 4173, 4422, 5035, 5616, 6195, 6703
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 02 2014

Keywords

Examples

			There are a(10) = 18 such partitions of 10: [6,2,1,1], [5,2,2,1], [4,4,1,1], [3,3,2,2], [8,1,1], [7,2,1], [6,3,1], [6,2,2], [5,4,1], [5,3,2], [4,4,2], [4,3,3], [9,1], [8,2], [7,3], [6,4], [5,5], [10].
		

Crossrefs

Cf. A238686 (the same for compositions).

Programs

  • Maple
    b:= proc(n, i, l) local j, k, m; m:= nops(l);
          for j to m-2 do for k from j+1 to m-1 do
            if (l[m]-l[k])*(k-j)=(l[k]-l[j])*(m-k)
              then return 0 fi od od;
         `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, l)+
         `if`(i>n, 0, b(n-i, i, [l[], i]))))
        end:
    a:= n-> b(n, n, []):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, i_, l_] := Module[{j, k, m = Length[l]}, For[j = 1, j <= m - 2, j++, For[k = j+1, k <= m-1, k++, If[(l[[m]] - l[[k]])*(k - j) == (l[[k]] - l[[j]])*(m - k), Return[0]]]]; If[n == 0, 1, If[i < 1, 0, b[n, i - 1, l] + If[i > n, 0, b[n - i, i, Append[l, i]]]]]];
    a[n_] := b[n, n, {}];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, May 21 2018, translated from Maple *)

A238433 Number of partitions of n avoiding equidistant 3-term arithmetic progressions.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 6, 8, 13, 12, 19, 23, 29, 35, 45, 52, 68, 80, 98, 111, 141, 163, 198, 230, 283, 320, 376, 443, 517, 585, 719, 799, 932, 1085, 1254, 1417, 1668, 1861, 2138, 2449, 2804, 3166, 3666, 4083, 4662, 5277, 5960, 6676, 7651, 8494, 9635, 10803, 12157
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 01 2014

Keywords

Examples

			The a(8) = 13 such partitions are:
01:   [ 1 1 2 4 ]
02:   [ 1 1 3 3 ]
03:   [ 1 1 6 ]
04:   [ 1 2 2 3 ]
05:   [ 1 2 5 ]
06:   [ 1 3 4 ]
07:   [ 1 7 ]
08:   [ 2 2 4 ]
09:   [ 2 3 3 ]
10:   [ 2 6 ]
11:   [ 3 5 ]
12:   [ 4 4 ]
13:   [ 8 ]
Note that the fourth partition has the arithmetic progression 1,2,3, but not in equidistant positions.
		

Crossrefs

Cf. A238432 (same for compositions).
Cf. A238571 (partitions avoiding any 3-term arithmetic progression).
Cf. A238424 (partitions avoiding three consecutive parts in arithmetic progression).
Cf. A238687.

Programs

  • Maple
    b:= proc(n, i, l) local j;
          for j from 2 to iquo(nops(l)+1, 2) do
          if l[1]-l[j]=l[j]-l[2*j-1] then return 0 fi od;
         `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, l)+
         `if`(i>n, 0, b(n-i, i, [i,l[]]))))
        end:
    a:= n-> b(n, n, []):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, i_, l_] := b[n, i, l] = Module[{j}, For[ j = 2 , j <= Quotient[ Length[l] + 1, 2] , j++, If[ l[[1]] - l[[j]] == l[[j]] - l[[2*j - 1]] , Return[0]]]; If[n == 0, 1, If[i < 1, 0, b[n, i - 1, l] + If[i > n, 0, b[n - i, i, Prepend[l, i]]]]]];
    a[n_] := b[n, n, {}];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, May 21 2018, translated from Maple *)

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