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-10 of 67 results. Next

A000837 Number of partitions of n into relatively prime parts. Also aperiodic partitions.

Original entry on oeis.org

1, 1, 1, 2, 3, 6, 7, 14, 17, 27, 34, 55, 63, 100, 119, 167, 209, 296, 347, 489, 582, 775, 945, 1254, 1481, 1951, 2334, 2980, 3580, 4564, 5386, 6841, 8118, 10085, 12012, 14862, 17526, 21636, 25524, 31082, 36694, 44582, 52255, 63260, 74170, 88931, 104302
Offset: 0

Views

Author

Keywords

Comments

Starting (1, 1, 2, 3, 6, 7, 14, ...), = row sums of triangle A137585. - Gary W. Adamson, Jan 27 2008
Triangle A168532 has aerated variants of this sequence in each column starting with offset 1, row sums = A000041. - Gary W. Adamson, Nov 28 2009
A partition is aperiodic iff its multiplicities are relatively prime, i.e., its Heinz number (A215366) is not a perfect power (A007916). - Gus Wiseman, Dec 19 2017
This sequence is monotonically increasing; each partition of n-1 can have a part of size 1 added to it to get a partition counted in a(n). - Franklin T. Adams-Watters, Jul 24 2020

Examples

			Of the 11 partitions of 6, we must exclude 6, 4+2, 3+3 and 2+2+2, so a(6) = 11 - 4 = 7.
For n=6, 2+2+1+1 is periodic because it can be written 2*(2+1), similarly 1+1+1+1+1+1, 3+3 and 2+2+2.
The a(6) = 7 partitions into relatively prime parts are (51), (411), (321), (3111), (2211), (21111), (111111). The a(6) = 7 aperiodic partitions are (6), (51), (42), (411), (321), (3111), (21111). - _Gus Wiseman_, Dec 19 2017
		

References

  • H. W. Gould, personal communication.

Crossrefs

Programs

  • Mathematica
    p[n_] := IntegerPartitions[n]; l[n_] := Length[p[n]]; g[n_, j_] := Apply[GCD, Part[p[n], j]]; h[n_] := Table[g[n, j], {j, 1, l[n]}]; Join[{1}, Table[Count[h[n], 1], {n, 1, 20}]]
    (* Clark Kimberling, Mar 09 2012 *)
    a[0] = 1; a[n_] := Sum[ MoebiusMu[n/d] * PartitionsP[d], {d, Divisors[n]}]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Oct 03 2013 *)
  • PARI
    N=66; x='x+O('x^N); gf=2+sum(n=1,N, (1/eta(x^n))*moebius(n)); Vec(gf) \\ Joerg Arndt, May 11 2013
    
  • PARI
    print1("1, "); for(n=1,46,my(s=0);forpart(X=n,s+=gcd(X)==1);print1(s,", ")) \\ Hugo Pfoertner, Mar 27 2020
    
  • Python
    from sympy import npartitions, mobius, divisors
    def a(n): return 1 if n==0 else sum(mobius(n//d)*npartitions(d) for d in divisors(n)) # Indranil Ghosh, Apr 26 2017

Formula

Möbius transform of A000041. - Christian G. Bower, Jun 11 2000
Product_{n>0} 1/(1-q^n) = 1 + Sum_{n>0} a(n)*q^n/(1-q^n). - Mamuka Jibladze, Nov 14 2015
a(n) ~ exp(Pi*sqrt(2*n/3)) / (4*n*sqrt(3)). - Vaclav Kotesovec, Jan 28 2019
a(n) <= p(n) <= a(n+1), where p(n) is the number of partitions of n (A000041). - Franklin T. Adams-Watters, Jul 24 2020

Extensions

Corrected and extended by David W. Wilson, Aug 15 1996
Additional name from Christian G. Bower, Jun 11 2000

A047968 a(n) = Sum_{d|n} p(d), where p(d) = A000041 = number of partitions of d.

Original entry on oeis.org

1, 3, 4, 8, 8, 17, 16, 30, 34, 52, 57, 99, 102, 153, 187, 261, 298, 432, 491, 684, 811, 1061, 1256, 1696, 1966, 2540, 3044, 3876, 4566, 5846, 6843, 8610, 10203, 12610, 14906, 18491, 21638, 26508, 31290, 38044, 44584, 54133, 63262, 76241
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Comments

Inverse Moebius transform of A000041.
Row sums of triangle A137587. - Gary W. Adamson, Jan 27 2008
Row sums of triangle A168021. - Omar E. Pol, Nov 20 2009
Row sums of triangle A168017. Row sums of triangle A168018. - Omar E. Pol, Nov 25 2009
Sum of the partition numbers of the divisors of n. - Omar E. Pol, Feb 25 2014
Conjecture: for n > 6, a(n) is strictly increasing. - Franklin T. Adams-Watters, Apr 19 2014
Number of constant multiset partitions of multisets spanning an initial interval of positive integers with multiplicities an integer partition of n. - Gus Wiseman, Sep 16 2018

Examples

			For n = 10 the divisors of 10 are 1, 2, 5, 10, hence the partition numbers of the divisors of 10 are 1, 2, 7, 42, so a(10) = 1 + 2 + 7 + 42 = 52. - _Omar E. Pol_, Feb 26 2014
From _Gus Wiseman_, Sep 16 2018: (Start)
The a(6) = 17 constant multiset partitions:
  (111111)  (111)(111)    (11)(11)(11)  (1)(1)(1)(1)(1)(1)
  (111222)  (12)(12)(12)
  (111122)  (112)(112)
  (112233)  (123)(123)
  (111112)
  (111123)
  (111223)
  (111234)
  (112234)
  (112345)
  (123456)
(End)
		

Crossrefs

Programs

  • Maple
    with(combinat): with(numtheory): a := proc(n) c := 0: l := sort(convert(divisors(n), list)): for i from 1 to nops(l) do c := c+numbpart(l[i]) od: RETURN(c): end: for j from 1 to 60 do printf(`%d, `, a(j)) od: # Zerinvary Lajos, Apr 14 2007
  • Mathematica
    a[n_] := Sum[ PartitionsP[d], {d, Divisors[n]}]; Table[a[n], {n, 1, 44}] (* Jean-François Alcover, Oct 03 2013 *)

Formula

G.f.: Sum_{k>0} (-1+1/Product_{i>0} (1-z^(k*i))). - Vladeta Jovovic, Jun 22 2003
G.f.: sum(n>0,A000041(n)*x^n/(1-x^n)). - Mircea Merca, Feb 24 2014.
a(n) = A168111(n) + A000041(n). - Omar E. Pol, Feb 26 2014
a(n) = Sum_{y is a partition of n} A000005(GCD(y)). - Gus Wiseman, Sep 16 2018

A327516 Number of integer partitions of n that are empty, (1), or have at least two parts and these parts are pairwise coprime.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 6, 9, 11, 14, 17, 22, 26, 32, 37, 42, 50, 59, 69, 80, 91, 101, 115, 133, 152, 170, 190, 210, 235, 265, 300, 334, 366, 398, 441, 484, 541, 597, 648, 703, 770, 848, 935, 1022, 1102, 1184, 1281, 1406, 1534, 1661, 1789, 1916, 2062, 2244, 2435
Offset: 0

Views

Author

Gus Wiseman, Sep 19 2019

Keywords

Comments

The Heinz numbers of these partitions are given by A302696.
Note that the definition excludes partitions with repeated parts other than 1 (cf. A038348, A304709).

Examples

			The a(1) = 1 through a(8) = 11 partitions:
  (1)  (11)  (21)   (31)    (32)     (51)      (43)       (53)
             (111)  (211)   (41)     (321)     (52)       (71)
                    (1111)  (311)    (411)     (61)       (431)
                            (2111)   (3111)    (511)      (521)
                            (11111)  (21111)   (3211)     (611)
                                     (111111)  (4111)     (5111)
                                               (31111)    (32111)
                                               (211111)   (41111)
                                               (1111111)  (311111)
                                                          (2111111)
                                                          (11111111)
		

Crossrefs

A000837 is the relatively prime instead of pairwise coprime version.
A051424 includes all singletons, with strict case A007360.
A101268 is the ordered version (with singletons).
A302696 ranks these partitions, with complement A335241.
A305713 is the strict case.
A307719 counts these partitions of length 3.
A018783 counts partitions with a common divisor.
A328673 counts pairwise non-coprime partitions.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],#=={}||CoprimeQ@@#&]],{n,0,30}]

Formula

For n > 1, a(n) = A051424(n) - 1. - Gus Wiseman, Sep 18 2020

A034729 a(n) = Sum_{ k, k|n } 2^(k-1).

Original entry on oeis.org

1, 3, 5, 11, 17, 39, 65, 139, 261, 531, 1025, 2095, 4097, 8259, 16405, 32907, 65537, 131367, 262145, 524827, 1048645, 2098179, 4194305, 8390831, 16777233, 33558531, 67109125, 134225995, 268435457, 536887863, 1073741825, 2147516555, 4294968325, 8590000131
Offset: 1

Views

Author

Keywords

Comments

Dirichlet convolution of b_n=1 with c_n = 2^(n-1).
Equals row sums of triangle A143425, & inverse Möbius transform (A051731) of [1, 2, 4, 8, ...]. - Gary W. Adamson, Aug 14 2008
Number of constant multiset partitions of normal multisets of size n, where a multiset is normal if it spans an initial interval of positive integers. - Gus Wiseman, Sep 16 2018

Examples

			From _Gus Wiseman_, Sep 16 2018: (Start)
The a(4) = 11 constant multiset partitions:
  (1)(1)(1)(1)
    (11)(11)
    (12)(12)
     (1111)
     (1222)
     (1122)
     (1112)
     (1233)
     (1223)
     (1123)
     (1234)
(End)
		

Crossrefs

Cf. A289508.
Sums of the form Sum_{d|n} q^(d-1): this sequence (q=2), A034730 (q=3), A113999 (q=10), A339684 (q=4), A339685 (q=5), A339686 (q=6), A339687 (q=7), A339688 (q=8), A339689 (q=9).

Programs

  • Magma
    A034729:= func< n | (&+[2^(d-1): d in Divisors(n)]) >;
    [A034729(n): n in [1..40]]; // G. C. Greubel, Jun 26 2024
    
  • Maple
    seq(add(2^(k-1),k=numtheory:-divisors(n)), n = 1 .. 100); # Robert Israel, Aug 22 2014
  • Mathematica
    Rest[CoefficientList[Series[Sum[x^k/(1-2*x^k),{k,1,30}],{x,0,30}],x]] (* Vaclav Kotesovec, Sep 08 2014 *)
  • PARI
    A034729(n) = sumdiv(n,k,2^(k-1)) \\ Michael B. Porter, Mar 11 2010
    
  • PARI
    {a(n)=polcoeff(sum(m=1,n,2^(m-1)*x^m/(1-x^m +x*O(x^n))),n)}
    for(n=1,40,print1(a(n),", ")) \\ Paul D. Hanna, Aug 21 2014
    
  • PARI
    {a(n)=local(A=x+x^2);A=sum(m=1,n,x^m*sumdiv(m,d,1/(1 - x^(m/d) +x*O(x^n))^d) );polcoeff(A,n)}
    for(n=1,40,print1(a(n),", ")) \\ Paul D. Hanna, Aug 21 2014
    
  • Python
    from sympy import divisors
    def A034729(n): return sum(1<<(d-1) for d in divisors(n,generator=True)) # Chai Wah Wu, Jul 15 2022
    
  • SageMath
    def A034729(n): return sum(2^(k-1) for k in (1..n) if (k).divides(n))
    [A034729(n) for n in range(1,41)] # G. C. Greubel, Jun 26 2024

Formula

G.f.: Sum_{n>0} x^n/(1-2*x^n). - Vladeta Jovovic, Nov 14 2002
a(n) = 1/2 * A055895(n). - Joerg Arndt, Aug 14 2012
G.f.: Sum_{n>=1} 2^(n-1) * x^n / (1 - x^n). - Paul D. Hanna, Aug 21 2014
G.f.: Sum_{n>=1} x^n * Sum_{d|n} 1/(1 - x^d)^(n/d). - Paul D. Hanna, Aug 21 2014
a(n) ~ 2^(n-1). - Vaclav Kotesovec, Sep 09 2014
a(n) = Sum_{k in row n of A215366} A008480(k) * A000005(A289508(k)). - Gus Wiseman, Sep 16 2018
a(n) = Sum_{c is a composition of n} A000005(gcd(c)). - Gus Wiseman, Sep 16 2018

A083710 Number of integer partitions of n with a part dividing all the other parts.

Original entry on oeis.org

1, 1, 2, 3, 5, 6, 11, 12, 20, 25, 37, 43, 70, 78, 114, 143, 196, 232, 330, 386, 530, 641, 836, 1003, 1340, 1581, 2037, 2461, 3127, 3719, 4746, 5605, 7038, 8394, 10376, 12327, 15272, 17978, 22024, 26095, 31730, 37339, 45333, 53175, 64100, 75340, 90138
Offset: 0

Views

Author

N. J. A. Sloane, Jun 16 2003

Keywords

Comments

Since the summand (part) which divides all the other summands is necessarily the smallest, an equivalent definition is: "Number of partitions of n such that smallest part divides every part." - Joerg Arndt, Jun 08 2009
The first few partitions that fail the criterion are 5=3+2, 7=5+2=4+3=3+2+2. So a(5) = A000041(5) - 1 = 6, a(7) = A000041(7) - 3 = 12. - Vladeta Jovovic, Jun 17 2003
Starting with offset 1 = inverse Mobius transform (A051731) of the partition numbers, A000041. - Gary W. Adamson, Jun 08 2009

Examples

			From _Gus Wiseman_, Apr 18 2021: (Start)
The a(1) = 1 through a(7) = 12 partitions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)
       (11)  (21)   (22)    (41)     (33)      (61)
             (111)  (31)    (221)    (42)      (331)
                    (211)   (311)    (51)      (421)
                    (1111)  (2111)   (222)     (511)
                            (11111)  (321)     (2221)
                                     (411)     (3211)
                                     (2211)    (4111)
                                     (3111)    (22111)
                                     (21111)   (31111)
                                     (111111)  (211111)
                                               (1111111)
(End)
		

References

  • L. M. Chawla, M. O. Levan and J. E. Maxfield, On a restricted partition function and its tables, J. Natur. Sci. and Math., 12 (1972), 95-101.

Crossrefs

Cf. A000041, A051731. - Gary W. Adamson, Jun 08 2009
The case with no 1's is A083711.
The strict case is A097986.
The version for "divisible by" instead of "dividing" is A130689.
The case where there is also a part divisible by all the others is A130714.
The complement of these partitions is counted by A338470.
The Heinz numbers of these partitions are dense, complement of A342193.
The case where there is also no part divisible by all the others is A343345.
A000005 counts divisors.
A000070 counts partitions with a selected part.
A006128 counts partitions with a selected position.
A015723 counts strict partitions with a selected part.
A018818 counts partitions into divisors (strict: A033630).
A167865 counts strict chains of divisors > 1 summing to n.

Programs

  • Maple
    with(combinat): with(numtheory): a := proc(n) c := 0: l := sort(convert(divisors(n), list)): for i from 1 to nops(l)-0 do c := c+numbpart(l[i]-1) od: RETURN(c): end: for j from 0 to 60 do printf(`%d, `, a(j)) od: # Zerinvary Lajos, Apr 14 2007
  • Mathematica
    Table[Length[Select[IntegerPartitions[n],And@@IntegerQ/@(#/Min@@#)&]],{n,0,30}] (* Gus Wiseman, Apr 18 2021 *)

Formula

Equals left border of triangle A137587 starting (1, 2, 3, 5, 6, 11, ...). - Gary W. Adamson, Jan 27 2008
G.f.: 1 + Sum_{n>=1} x^n/eta(x^n). The g.f. for partitions into parts that are a multiple of n is x^n/eta(x^n), now sum over n. - Joerg Arndt, Jun 08 2009
Gary W. Adamson's comment is equivalent to the formula a(n) = Sum_{d|n} p(d-1) where p(i) = number of partitions of i (A000041(i)). Hence A083710 has g.f. Sum_{d>=1} p(d-1)*x^d/(1-x^d), - N. J. A. Sloane, Jun 08 2009

Extensions

More terms from Vladeta Jovovic, Jun 17 2003
Name shortened by Gus Wiseman, Apr 18 2021

A302698 Number of integer partitions of n into relatively prime parts that are all greater than 1.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 3, 2, 5, 4, 13, 7, 23, 18, 32, 33, 65, 50, 104, 92, 148, 153, 252, 226, 376, 376, 544, 570, 846, 821, 1237, 1276, 1736, 1869, 2552, 2643, 3659, 3887, 5067, 5509, 7244, 7672, 10086, 10909, 13756, 15168, 19195, 20735, 26237, 28708, 35418, 39207
Offset: 1

Views

Author

Gus Wiseman, Apr 11 2018

Keywords

Comments

Two or more numbers are relatively prime if they have no common divisor other than 1. A single number is not considered relatively prime unless it is equal to 1 (which is impossible in this case).
The Heinz numbers of these partitions are given by A302697.

Examples

			The a(5) = 1 through a(12) = 7 partitions (empty column indicated by dot):
  (32)  .  (43)   (53)   (54)    (73)    (65)     (75)
           (52)   (332)  (72)    (433)   (74)     (543)
           (322)         (432)   (532)   (83)     (552)
                         (522)   (3322)  (92)     (732)
                         (3222)          (443)    (4332)
                                         (533)    (5322)
                                         (542)    (33222)
                                         (632)
                                         (722)
                                         (3332)
                                         (4322)
                                         (5222)
                                         (32222)
		

Crossrefs

A000837 is the version allowing 1's.
A002865 does not require relative primality.
A302697 gives the Heinz numbers of these partitions.
A337450 is the ordered version.
A337451 is the ordered strict version.
A337452 is the strict version.
A337485 is the pairwise coprime instead of relatively prime version.
A000740 counts relatively prime compositions.
A078374 counts relatively prime strict partitions.
A212804 counts compositions with no 1's.
A291166 appears to rank relatively prime compositions.
A332004 counts strict relatively prime compositions.
A337561 counts pairwise coprime strict compositions.
A338332 is the case of length 3, with strict case A338333.

Programs

  • Maple
    b:= proc(n, i, g) option remember; `if`(n=0, `if`(g=1, 1, 0),
          `if`(i<2, 0, b(n, i-1, g)+b(n-i, min(n-i, i), igcd(g, i))))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=1..60);  # Alois P. Heinz, Apr 12 2018
  • Mathematica
    Table[Length[Select[IntegerPartitions[n],FreeQ[#,1]&&GCD@@#===1&]],{n,30}]
    (* Second program: *)
    b[n_, i_, g_] := b[n, i, g] = If[n == 0, If[g == 1, 1, 0], If[i < 2, 0, b[n, i - 1, g] + b[n - i, Min[n - i, i], GCD[g, i]]]];
    a[n_] := b[n, n, 0];
    Array[a, 60] (* Jean-François Alcover, May 10 2021, after Alois P. Heinz *)

Formula

a(n) = A002865(n) - A018783(n).

Extensions

Extended by Gus Wiseman, Oct 29 2020

A328171 Number of (necessarily strict) integer partitions of n with no two consecutive parts divisible.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 3, 2, 4, 4, 5, 4, 9, 9, 10, 12, 14, 16, 20, 23, 29, 34, 38, 41, 51, 60, 66, 78, 89, 103, 119, 137, 157, 180, 201, 229, 261, 298, 338, 379, 431, 486, 547, 618, 694, 783, 876, 986, 1103, 1241, 1387, 1551, 1728, 1932, 2148, 2395, 2664, 2963
Offset: 0

Views

Author

Gus Wiseman, Oct 11 2019

Keywords

Examples

			The a(1) = 1 through a(15) = 10 partitions (A..F = 10..15):
  1  2  3  4  5   6  7   8   9    A    B   C    D    E     F
              32     43  53  54   64   65  75   76   86    87
                     52      72   73   74  543  85   95    96
                             432  532  83  732  94   A4    B4
                                       92       A3   B3    D2
                                                B2   653   654
                                                643  743   753
                                                652  752   852
                                                832  5432  A32
                                                           6432
		

Crossrefs

The complement is counted by A328221.
The Heinz numbers of these partitions are A328603.
Partitions whose pairs of consecutive parts are relatively prime are A328172, with strict case A328188.
Partitions with no pair of consecutive parts relatively prime are A328187, with strict case A328220.
Numbers without consecutive divisible proper divisors are A328028.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],!MatchQ[#,{_,x_,y_,_}/;Divisible[x,y]]&]],{n,0,30}]

A304711 Heinz numbers of integer partitions whose distinct parts are pairwise coprime.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 15, 16, 18, 20, 22, 24, 26, 28, 30, 32, 33, 34, 35, 36, 38, 40, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 58, 60, 62, 64, 66, 68, 69, 70, 72, 74, 75, 76, 77, 80, 82, 85, 86, 88, 90, 92, 93, 94, 95, 96, 98, 99, 100, 102, 104, 106, 108, 110
Offset: 1

Views

Author

Gus Wiseman, May 17 2018

Keywords

Comments

Two parts are coprime if they have no common divisor greater than 1. For partitions of length 1 note that (1) is coprime but (x) is not coprime for x > 1.
First differs from A289509 at a(24) = 44, A289509(24) = 42.

Examples

			Sequence of all partitions whose distinct parts are pairwise coprime begins (1), (11), (21), (111), (31), (211), (41), (32), (1111), (221), (311), (51), (2111), (61), (411), (321), (11111), (52), (71), (43), (2211), (81), (3111).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200],CoprimeQ@@PrimePi/@FactorInteger[#][[All,1]]&]

A200976 Number of partitions of n such that each pair of parts (if any) has a common factor.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 4, 1, 5, 3, 8, 1, 14, 1, 16, 9, 22, 1, 38, 1, 45, 17, 57, 1, 94, 7, 102, 30, 138, 1, 218, 2, 231, 58, 298, 21, 451, 3, 491, 103, 644, 4, 919, 4, 1005, 203, 1257, 7, 1784, 20, 1993, 301, 2441, 10, 3365, 70, 3737, 496, 4569, 17, 6252, 23, 6848
Offset: 0

Views

Author

Alois P. Heinz, Nov 29 2011

Keywords

Comments

a(n) is different from A018783(n) for n = 0, 31, 37, 41, 43, 46, 47, 49, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, ... .
Every pair of (possibly equal) parts has a common factor > 1. These partitions are said to be (pairwise) intersecting. - Gus Wiseman, Nov 04 2019

Examples

			a(0) = 1: [];
a(4) = 2: [2,2], [4];
a(9) = 3: [3,3,3], [3,6], [9];
a(31) = 2: [6,10,15], [31];
a(41) = 4: [6,10,10,15], [6,15,20], [6,14,21], [41].
		

Crossrefs

Cf. A018783.
The version with only distinct parts compared is A328673.
The relatively prime case is A202425.
The strict case is A318717.
The version for non-isomorphic multiset partitions is A319752.
The version for set-systems is A305843.

Programs

  • Maple
    b:= proc(n, j, s) local ok, i;
          if n=0 then 1
        elif j<2 then 0
        else ok:= true;
             for i in s while ok do ok:= evalb(igcd(i, j)<>1) od;
             `if`(ok, add(b(n-j*k, j-1, [s[], j]), k=1..n/j), 0) +b(n, j-1, s)
          fi
        end:
    a:= n-> b(n, n, []):
    seq(a(n), n=0..62);
  • Mathematica
    b[n_, j_, s_] := Module[{ok, i, is}, Which[n == 0, 1, j < 2, 0, True, ok = True; For[is = 1, is <= Length[s] && ok, is++, i = s[[is]]; ok = GCD[i, j] != 1]; If[ok, Sum[b[n-j*k, j-1, Append[s, j]], {k, 1, n/j}], 0] + b[n, j-1, s]]]; a[n_] := b[n, n, {}]; Table[a[n], {n, 0, 62}] (* Jean-François Alcover, Dec 26 2013, translated from Maple *)
    Table[Length[Select[IntegerPartitions[n],And[And@@(GCD[##]>1&)@@@Select[Tuples[Union[#],2],LessEqual@@#&]]&]],{n,0,20}] (* Gus Wiseman, Nov 04 2019 *)

Formula

a(n > 0) = A328673(n) - 1. - Gus Wiseman, Nov 04 2019

A178470 Number of compositions (ordered partitions) of n where no pair of adjacent part sizes is relatively prime.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 5, 1, 8, 4, 17, 3, 38, 5, 67, 25, 132, 27, 290, 54, 547, 163, 1086, 255, 2277, 530, 4416, 1267, 8850, 2314, 18151, 4737, 35799, 10499, 71776, 20501, 145471, 41934, 289695, 89030, 581117, 178424, 1171545, 365619, 2342563, 761051, 4699711
Offset: 0

Views

Author

Keywords

Comments

A178472(n) is a lower bound for a(n). This bound is exact for n = 2..10 and 12, but falls behind thereafter.
a(0) = 1 vacuously for the empty composition. One could take a(1) = 0, on the theory that each composition is followed by infinitely many 0's, and thus the 1 is not relatively prime to its neighbor; but this definition seems simpler.

Examples

			The three compositions for 11 are <11>, <2,6,3> and <3,6,2>.
From _Gus Wiseman_, Nov 19 2019: (Start)
The a(1) = 1 through a(11) = 3 compositions (A = 10, B = 11):
  1  2  3  4   5  6    7  8     9    A      B
           22     24      26    36   28     263
                  33      44    63   46     362
                  42      62    333  55
                  222     224        64
                          242        82
                          422        226
                          2222       244
                                     262
                                     424
                                     442
                                     622
                                     2224
                                     2242
                                     2422
                                     4222
                                     22222
(End)
		

Crossrefs

The case of partitions is A328187, with Heinz numbers A328336.
Partitions with all pairs of consecutive parts relatively prime are A328172.
Compositions without consecutive divisible parts are A328460 (one way) or A328508 (both ways).

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1,
          add(`if`(h=1 or igcd(j, h)>1, b(n-j, j), 0), j=2..n))
        end:
    a:= n-> `if`(n=1, 1, b(n, 1)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Oct 23 2011
  • Mathematica
    b[n_, h_] := b[n, h] = If[n == 0, 1, Sum [If[h == 1 || GCD[j, h] > 1, b[n - j, j], 0], {j, 2, n}]]; a[n_] := If[n == 1, 1, b[n, 1]]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Oct 29 2015, after Alois P. Heinz *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,y_,_}/;GCD[x,y]==1]&]],{n,0,20}] (* Gus Wiseman, Nov 19 2019 *)
  • PARI
    am(n)=local(r);r=matrix(n,n,i,j,i==j);for(i=2,n,for(j=1,i-1,for(k=1,j,if(gcd(i-j,k)>1,r[i,i-j]+=r[j,k]))));r
    al(n)=local(m);m=am(n);vector(n,i,sum(j=1,i,m[i,j]))
Showing 1-10 of 67 results. Next