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-4 of 4 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 *)

A238571 Number of partitions of n avoiding any 3-term arithmetic progression.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 6, 8, 12, 12, 19, 23, 27, 34, 43, 49, 62, 74, 88, 104, 127, 145, 176, 199, 239, 272, 324, 378, 430, 490, 583, 654, 750, 876, 988, 1112, 1291, 1441, 1642, 1877, 2121, 2358, 2682, 2977, 3365, 3830, 4237, 4734, 5357, 5868, 6590, 7398, 8182, 9049
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 28 2014

Keywords

Examples

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

Crossrefs

Cf. A003407 (the same for permutations).
Cf. A178932 (the same for strict partitions).
Cf. A238569 (the same for compositions).
Cf. A238433 (partitions avoiding equidistant 3-term arithmetic progressions).
Cf. A238424 (partitions avoiding three consecutive parts in arithmetic progression).
Cf. A238687.

Programs

  • Mathematica
    a[n_] := a[n] = Count[IntegerPartitions[n], P_ /; {} == SequencePosition[P, {_, i_, _, j_, _, k_, _} /; j - i == k - j, 1]];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 50}] (* Jean-François Alcover, Oct 29 2021 *)

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 *)

A238432 Number of compositions of n avoiding equidistant 3-term arithmetic progressions.

Original entry on oeis.org

1, 1, 2, 3, 7, 13, 22, 41, 74, 133, 233, 400, 714, 1209, 2091, 3591, 6089, 10316, 17477, 29413, 49515, 82474, 137659, 228461, 377936, 623710, 1025445, 1680418, 2746242, 4474654, 7270430, 11774128, 19020802, 30640812, 49222427, 78857338, 126033488, 200872080
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Mar 01 2014

Keywords

Examples

			The a(5) = 13 such compositions are:
01:  [ 1 1 2 1 ]
02:  [ 1 1 3 ]
03:  [ 1 2 1 1 ]
04:  [ 1 2 2 ]
05:  [ 1 3 1 ]
06:  [ 1 4 ]
07:  [ 2 1 2 ]
08:  [ 2 2 1 ]
09:  [ 2 3 ]
10:  [ 3 1 1 ]
11:  [ 3 2 ]
12:  [ 4 1 ]
13:  [ 5 ]
Note that the first and third composition contain the progression 1,1,1, but not in equidistant positions.
		

Crossrefs

Cf. A238433 (same for partitions).
Cf. A238569 (compositions avoiding any 3-term arithmetic progression).
Cf. A238423 (compositions avoiding three consecutive parts in arithmetic progression).
Cf. A238686.

Programs

  • Maple
    b:= proc(n, 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, add(b(n-i, [i, l[]]), i=1..n))
        end:
    a:= n-> b(n, []):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, l_] := b[n, 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, Sum[b[n - i, Prepend[l, i]], {i, 1, n}]]];
    a[n_] := b[n, {}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, May 21 2018, translated from Maple *)
Showing 1-4 of 4 results.