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

A054519 Number of increasing arithmetic progressions of nonnegative integers ending in n, including those of length 1 or 2.

Original entry on oeis.org

1, 2, 4, 6, 9, 11, 15, 17, 21, 24, 28, 30, 36, 38, 42, 46, 51, 53, 59, 61, 67, 71, 75, 77, 85, 88, 92, 96, 102, 104, 112, 114, 120, 124, 128, 132, 141, 143, 147, 151, 159, 161, 169, 171, 177, 183, 187, 189, 199, 202, 208, 212, 218, 220, 228, 232, 240, 244, 248
Offset: 0

Views

Author

Henry Bottomley, Apr 07 2000

Keywords

Comments

a(0)=1, a(n) = a(n-1) + sigma_0(n) (A000005). - Ctibor O. Zizka, Nov 08 2008
a(n) is the index of the n-th term of A027750 whose value is 1. - Michel Marcus, Oct 15 2015
From Gus Wiseman, Jun 07 2019: (Start)
Also the number of subsets of {1..n} that are closed under taking the difference of two strictly decreasing terms. For example, the a(0) = 1 through a(6) = 15 subsets are:
{} {} {} {} {} {} {}
{1} {1} {1} {1} {1} {1}
{2} {2} {2} {2} {2}
{1,2} {3} {3} {3} {3}
{1,2} {4} {4} {4}
{1,2,3} {1,2} {5} {5}
{2,4} {1,2} {6}
{1,2,3} {2,4} {1,2}
{1,2,3,4} {1,2,3} {2,4}
{1,2,3,4} {3,6}
{1,2,3,4,5} {1,2,3}
{2,4,6}
{1,2,3,4}
{1,2,3,4,5}
{1,2,3,4,5,6}
(End)

Examples

			a(3)=6 because the six increasing progressions (3), (2,3), (1,2,3), (0,1,2,3), (1,3) and (0,3) all end in 3.
		

Crossrefs

Programs

  • Magma
    [1] cat [&+[Ceiling((k+1)/(i+1)): i in [1..k+1]]: k in [1..60]]; // Marius A. Burtea, Jun 10 2019
  • Maple
    IBI:= {{}}: a[0]:= 1: for n from 1 to 45 do IBI:= IBI union map(t -> t union {n}, select(t -> (t minus map(q -> n-q, t)={}), IBI)); a[n]:= nops(IBI) od: seq(a[n], n=0..45); # Zerinvary Lajos, Mar 18 2007
    with(numtheory):a[1]:=2: for n from 2 to 59 do a[n]:=a[n-1]+tau(n) od: seq(a[n], n=0..45); # Zerinvary Lajos, Mar 21 2009
    map(`+`, ListTools:-PartialSums(map(numtheory:-tau, [$0..1000])),1); # Robert Israel, Oct 15 2015
  • Mathematica
    a[0]=1; a[n_] := a[n] = a[n-1] + DivisorSigma[0, n]; Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Oct 05 2012, after Ctibor O. Zizka *)
    nxt[{n_,a_}]:={n+1,a+DivisorSigma[0,n+1]}; Transpose[NestList[nxt,{0,1},50]][[2]] (* Harvey P. Dale, Oct 15 2012 *)
    Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Subtract@@@Reverse/@Subsets[#,{2}]]&]],{n,0,10}] (* Gus Wiseman, Jun 07 2019 *)
  • PARI
    vector(100, n, n--; sum(k=1, n, n\k) + 1) \\ Altug Alkan, Oct 15 2015
    

Formula

a(n) = A051336(n+1) - A051336(n) = a(n-1) + A000005(n) = A006218(n)+1.
G.f.: (1-x)^(-1) * (1 + Sum_{j>=1} x^j/(1-x^j)). - Robert Israel, Oct 15 2015
a(n) = Sum_{i=1..n+1} ceiling((n+1)/(i+1)). - Wesley Ivan Hurt, Sep 15 2017

A238423 Number of compositions of n avoiding three consecutive parts in arithmetic progression.

Original entry on oeis.org

1, 1, 2, 3, 7, 13, 22, 42, 81, 149, 278, 516, 971, 1812, 3374, 6297, 11770, 21970, 41002, 76523, 142901, 266779, 497957, 929563, 1735418, 3239698, 6047738, 11289791, 21076118, 39344992, 73448769, 137113953, 255965109, 477835991, 892023121, 1665227859
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 26 2014

Keywords

Comments

These are compositions of n whose second-differences are nonzero. - Gus Wiseman, Jun 03 2019

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 ]
		

Crossrefs

Cf. A238424 (equivalent for partitions).
Cf. A238569 (equivalent for any 3-term arithmetic progression).

Programs

  • Maple
    # b(n, r, d): number of compositions of n where the leftmost part j
    #             does not have distance d to the recent part r
    b:= proc(n, r, d) option remember; `if`(n=0, 1,
          add(`if`(j=r+d, 0, b(n-j, j, j-r)), j=1..n))
        end:
    a:= n-> b(n, infinity, 0):
    seq(a(n), n=0..45);
  • Mathematica
    b[n_, r_, d_] := b[n, r, d] = If[n == 0, 1, Sum[If[j == r + d, 0, b[n - j, j, j - r]], {j, 1, n}]]; a[n_] := b[n, Infinity, 0]; Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Nov 06 2014, after Maple *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[Differences[#,2],0]&]],{n,0,10}] (* Gus Wiseman, Jun 03 2019 *)

Formula

a(n) ~ c * d^n, where d = 1.866800016014240677813344121155900699..., c = 0.540817940878009616510727217687704495... - Vaclav Kotesovec, May 01 2014

A295370 Number of permutations of [n] avoiding three consecutive terms in arithmetic progression.

Original entry on oeis.org

1, 1, 2, 4, 18, 80, 482, 3280, 26244, 231148, 2320130, 25238348, 302834694, 3909539452, 54761642704, 816758411516, 13076340876500, 221396129723368, 3985720881222850, 75503196628737920, 1510373288335622576, 31634502738658957588, 696162960370556156224, 15978760340940405262668
Offset: 0

Views

Author

Alois P. Heinz, Nov 20 2017

Keywords

Comments

These are permutations of n whose second-differences are nonzero. - Gus Wiseman, Jun 03 2019

Examples

			a(3) = 4: 132, 213, 231, 312.
a(4) = 18: 1243, 1324, 1342, 1423, 2134, 2143, 2314, 2413, 2431, 3124, 3142, 3241, 3412, 3421, 4132, 4213, 4231, 4312.
		

Crossrefs

Programs

  • Maple
    b:= proc(s, j, k) option remember; `if`(s={}, 1,
          add(`if`(k=0 or 2*j<>i+k, b(s minus {i}, i,
              `if`(2*i-j in s, j, 0)), 0), i=s))
        end:
    a:= n-> b({$1..n}, 0$2):
    seq(a(n), n=0..12);
  • Mathematica
    Table[Length[Select[Permutations[Range[n]],!MemberQ[Differences[#,2],0]&]],{n,0,5}] (* Gus Wiseman, Jun 03 2019 *)
    b[s_, j_, k_] := b[s, j, k] = If[s == {}, 1, Sum[If[k == 0 || 2*j != i + k, b[s~Complement~{i}, i, If[MemberQ[s, 2*i - j ], j, 0]], 0], {i, s}]];
    a[n_] := a[n] = b[Range[n], 0, 0];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 16}] (* Jean-François Alcover, Nov 20 2023, after Alois P. Heinz *)

Extensions

a(22)-a(23) from Vaclav Kotesovec, Mar 22 2022

A325874 Number of integer partitions of n whose differences of all degrees > 1 are nonzero.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 6, 8, 12, 13, 19, 24, 26, 33, 45, 52, 66, 78, 92, 113, 129, 160, 192, 231, 268, 305, 361, 436, 501, 591, 665, 783, 897, 1071, 1228, 1361, 1593, 1834, 2101, 2452, 2685, 3129, 3526, 4067, 4568, 5189, 5868, 6655, 7565, 8468, 9400
Offset: 0

Views

Author

Gus Wiseman, Jun 02 2019

Keywords

Comments

The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (6,3,1) are (-3,-2). The zeroth differences are the sequence itself, while k-th differences for k > 0 are the differences of the (k-1)-th differences. If m is the length of the sequence, its differences of all degrees are the union of the zeroth through m-th differences.
The case for all degrees including 1 is A325852.

Examples

			The a(1) = 1 through a(9) = 13 partitions:
  (1)  (2)   (3)   (4)    (5)    (6)     (7)    (8)     (9)
       (11)  (21)  (22)   (32)   (33)    (43)   (44)    (54)
                   (31)   (41)   (42)    (52)   (53)    (63)
                   (211)  (221)  (51)    (61)   (62)    (72)
                          (311)  (411)   (322)  (71)    (81)
                                 (2211)  (331)  (332)   (441)
                                         (421)  (422)   (522)
                                         (511)  (431)   (621)
                                                (521)   (711)
                                                (611)   (4221)
                                                (3221)  (4311)
                                                (3311)  (5211)
                                                        (32211)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],!MemberQ[Union@@Table[Differences[#,i],{i,2,Length[#]}],0]&]],{n,0,30}]

A325875 Number of compositions of n whose differences of all degrees > 1 are nonzero.

Original entry on oeis.org

1, 1, 2, 3, 7, 13, 20, 38, 69, 129, 222, 407, 726, 1313, 2318, 4146, 7432, 13296, 23759, 42458, 75714
Offset: 0

Views

Author

Gus Wiseman, Jun 02 2019

Keywords

Comments

The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (6,3,1) are (-3,-2). The zeroth differences are the sequence itself, while k-th differences for k > 0 are the differences of the (k-1)-th differences. If m is the length of the sequence, its differences of all degrees are the union of the zeroth through m-th differences.
A composition of n is a finite sequence of positive integers with sum n.
The case for all degrees including 1 is A325851.

Examples

			The a(1) = 1 through a(6) = 20 compositions:
  (1)  (2)   (3)   (4)    (5)     (6)
       (11)  (12)  (13)   (14)    (15)
             (21)  (22)   (23)    (24)
                   (31)   (32)    (33)
                   (112)  (41)    (42)
                   (121)  (113)   (51)
                   (211)  (122)   (114)
                          (131)   (132)
                          (212)   (141)
                          (221)   (213)
                          (311)   (231)
                          (1121)  (312)
                          (1211)  (411)
                                  (1122)
                                  (1131)
                                  (1212)
                                  (1311)
                                  (2121)
                                  (2211)
                                  (11211)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[Union@@Table[Differences[#,i],{i,2,Length[#]}],0]&]],{n,0,10}]

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_,_}]&]

A326494 Number of subsets of {1..n} containing all differences and quotients of pairs of distinct elements.

Original entry on oeis.org

1, 2, 4, 6, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127
Offset: 0

Views

Author

Gus Wiseman, Jul 09 2019

Keywords

Comments

The only allowed sets are the empty set, any singleton, any initial interval of positive integers and {2,4}. This can be shown by induction. - Andrew Howroyd, Aug 25 2019

Examples

			The a(0) = 1 through a(6) = 13 subsets:
  {}  {}   {}     {}       {}         {}           {}
      {1}  {1}    {1}      {1}        {1}          {1}
           {2}    {2}      {2}        {2}          {2}
           {1,2}  {3}      {3}        {3}          {3}
                  {1,2}    {4}        {4}          {4}
                  {1,2,3}  {1,2}      {5}          {5}
                           {2,4}      {1,2}        {6}
                           {1,2,3}    {2,4}        {1,2}
                           {1,2,3,4}  {1,2,3}      {2,4}
                                      {1,2,3,4}    {1,2,3}
                                      {1,2,3,4,5}  {1,2,3,4}
                                                   {1,2,3,4,5}
                                                   {1,2,3,4,5,6}
		

Crossrefs

Subsets with difference are A054519.
Subsets with quotients are A326023.
Subsets with quotients > 1 are A326079.
Subsets without differences or quotients are A326490.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],SubsetQ[#,Union[Divide@@@Select[Tuples[#,2],UnsameQ@@#&&Divisible@@#&],Subtract@@@Select[Tuples[#,2],Greater@@#&]]]&]],{n,0,10}]

Formula

a(n) = 2*n + 1 = A005408(n) for n > 3. - Andrew Howroyd, Aug 25 2019

Extensions

Terms a(20) and beyond from Andrew Howroyd, Aug 25 2019

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