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 20 results. Next

A289509 Numbers k such that the gcd of the indices j for which the j-th prime prime(j) divides k is 1.

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, 42, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 58, 60, 62, 64, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 82, 84, 85, 86, 88, 90, 92, 93, 94, 95, 96, 98, 99, 100, 102, 104
Offset: 1

Views

Author

Christopher J. Smyth, Jul 11 2017

Keywords

Comments

Any integer k in the sequence encodes (by 'Heinz encoding' cf. A056239) a multiset of integers whose gcd is 1, namely the multiset containing r_j copies of j if k factors as Product_j prime(j)^{r_j} with gcd_j j = 1.
Clearly the sequence contains all even numbers and no odd primes or odd prime powers. It also clearly contains all numbers that are divisible by consecutive primes.
The sequence is the list of those k such that A289508(k) = 1.
It is also the list of those k such that A289506(k) = A289507(k).
Heinz numbers of integer partitions with relatively prime parts, where the Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). - Gus Wiseman, Apr 13 2018

Examples

			6 is a term because 6 = p_1*p_2 and gcd(1,2) = 1.
From _Gus Wiseman_, Apr 13 2018: (Start)
Sequence of integer partitions with relatively prime parts begins:
02 : (1)
04 : (11)
06 : (21)
08 : (111)
10 : (31)
12 : (211)
14 : (41)
15 : (32)
16 : (1111)
18 : (221)
20 : (311)
22 : (51)
24 : (2111)
26 : (61)
28 : (411)
30 : (321)
32 : (11111)
33 : (52)
34 : (71)
35 : (43)
36 : (2211)
38 : (81)
40 : (3111)
(End)
		

Crossrefs

Programs

  • Maple
    p:=1:for ind to 10000 do p:=nextprime(p);primeindex[p]:=ind;od:
    out:=[]:for n from 2 to 100 do m:=[];f:=ifactors(n)[2];g:=0;
    for k to nops(f) do mk:=primeindex[f[k][1]];m:=[op(m),mk];
    g:=gcd(g,mk);od; if g=1 then out:=[op(out),n];fi;od:out;
  • Mathematica
    Select[Range[200],GCD@@PrimePi/@FactorInteger[#][[All,1]]===1&] (* Gus Wiseman, Apr 13 2018 *)
  • PARI
    isok(n) = my(f=factor(n)); gcd(apply(x->primepi(x), f[,1])) == 1; \\ Michel Marcus, Jul 19 2017
    
  • Python
    from sympy import gcd, primepi, primefactors
    def ok(n): return gcd([primepi(p) for p in primefactors(n)]) == 1
    print([n for n in range(1, 151) if ok(n)]) # Indranil Ghosh, Aug 06 2017

A302696 Numbers whose prime indices (with repetition) are pairwise coprime. Nonprime Heinz numbers of integer partitions with pairwise coprime parts.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 14, 15, 16, 20, 22, 24, 26, 28, 30, 32, 33, 34, 35, 38, 40, 44, 46, 48, 51, 52, 55, 56, 58, 60, 62, 64, 66, 68, 69, 70, 74, 76, 77, 80, 82, 85, 86, 88, 92, 93, 94, 95, 96, 102, 104, 106, 110, 112, 116, 118, 119, 120, 122, 123, 124, 128, 132
Offset: 1

Views

Author

Gus Wiseman, Apr 11 2018

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. Two or more numbers are coprime if no pair has a common divisor other than 1. A single number is not considered coprime unless it is equal to 1.
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
Number 36 = prime(1)*prime(1)*prime(2)*prime(2) is not included in the sequence, because the pair of prime indices {2,2} is not coprime. - Gus Wiseman, Dec 06 2021

Examples

			Sequence of integer partitions with pairwise coprime parts begins: (), (1), (11), (21), (111), (31), (211), (41), (32), (1111), (311), (51), (2111), (61), (411), (321).
Missing from this list are: (2), (3), (4), (22), (5), (6), (7), (221), (8), (42), (9), (33), (222).
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local F;
       F:= ifactors(n)[2];
       if nops(F)=1 then if F[1][1] = 2 then return true else return false fi fi;
       if ormap(t -> t[2]>1 and t[1] <> 2, F) then return false fi;
       F:= map(t -> numtheory:-pi(t[1]), F);
       ilcm(op(F))=convert(F,`*`)
    end proc:
    select(filter, [$1..200]); # Robert Israel, Sep 10 2020
  • Mathematica
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[200],Or[#===1,CoprimeQ@@primeMS[#]]&]
  • PARI
    isA302696(n) = if(isprimepower(n),!(n%2), if(!issquarefree(n>>valuation(n,2)), 0, my(pis=apply(primepi,factor(n)[,1])); (lcm(pis)==factorback(pis)))); \\ Antti Karttunen, Dec 06 2021

Extensions

Clarification (with repetition) added to the definition by Antti Karttunen, Dec 06 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

A302796 Squarefree numbers whose prime indices are relatively prime. Nonprime Heinz numbers of strict integer partitions with relatively prime parts.

Original entry on oeis.org

1, 2, 6, 10, 14, 15, 22, 26, 30, 33, 34, 35, 38, 42, 46, 51, 55, 58, 62, 66, 69, 70, 74, 77, 78, 82, 85, 86, 93, 94, 95, 102, 105, 106, 110, 114, 118, 119, 122, 123, 130, 134, 138, 141, 142, 143, 145, 146, 154, 155, 158, 161, 165, 166, 170, 174, 177, 178, 182
Offset: 1

Views

Author

Gus Wiseman, Apr 13 2018

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. 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.
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			Sequence of terms together with their sets of prime indices begins:
01 : {}
02 : {1}
06 : {1,2}
10 : {1,3}
14 : {1,4}
15 : {2,3}
22 : {1,5}
26 : {1,6}
30 : {1,2,3}
33 : {2,5}
34 : {1,7}
35 : {3,4}
38 : {1,8}
42 : {1,2,4}
46 : {1,9}
51 : {2,7}
55 : {3,5}
58 : {1,10}
62 : {1,11}
66 : {1,2,5}
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100],Or[#===1,SquareFreeQ[#]&&GCD@@PrimePi/@FactorInteger[#][[All,1]]===1]&]
  • PARI
    isok(n) = {if (n == 1, return (1)); if (issquarefree(n), my(f = factor(n)); return (gcd(vector(#f~, k, primepi(f[k,1]))) == 1););} \\ Michel Marcus, Apr 13 2018

A355737 Number of ways to choose a sequence of divisors, one of each prime index of n (with multiplicity), such that the result has no common divisor > 1.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 2, 1, 3, 4, 1, 1, 4, 1, 2, 4, 2, 1, 2, 3, 4, 7, 3, 1, 4, 1, 1, 4, 2, 6, 4, 1, 4, 6, 2, 1, 6, 1, 2, 8, 3, 1, 2, 5, 4, 4, 4, 1, 8, 4, 3, 5, 4, 1, 4, 1, 2, 10, 1, 6, 4, 1, 2, 6, 6, 1, 4, 1, 6, 8, 4, 6, 8, 1, 2, 15, 2, 1, 6, 4, 4
Offset: 1

Views

Author

Gus Wiseman, Jul 17 2022

Keywords

Comments

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 a(2) = 1 through a(18) = 4 choices:
  1  1  11  1  11  1  111  11  11  1  111  1  11  11  1111  1  111
               12          12  13     112     12  13           112
                           21                 14  21           121
                                                  23           122
		

Crossrefs

Dominated by A355731, firsts A355732, primes A355741, prime-powers A355742.
For weakly increasing instead of coprime we have A355735, primes A355745.
Positions of first appearances are A355738.
For strict instead of coprime we have A355739, zeros A355740.
A000005 counts divisors.
A001221 counts distinct prime factors, with sum A001414.
A001222 counts prime factors with multiplicity.
A003963 multiplies together the prime indices of n.
A056239 adds up prime indices, row sums of A112798.
A120383 lists numbers divisible by all of their prime indices.
A289508 gives GCD of prime indices.
A289509 ranks relatively prime partitions, odd A302697, squarefree A302796.
A324850 lists numbers divisible by the product of their prime indices.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Select[Tuples[Divisors/@primeMS[n]],GCD@@#==1&]],{n,100}]

A302797 Squarefree numbers whose prime indices are pairwise coprime. Heinz numbers of strict integer partitions with pairwise coprime parts.

Original entry on oeis.org

1, 2, 6, 10, 14, 15, 22, 26, 30, 33, 34, 35, 38, 46, 51, 55, 58, 62, 66, 69, 70, 74, 77, 82, 85, 86, 93, 94, 95, 102, 106, 110, 118, 119, 122, 123, 134, 138, 141, 142, 143, 145, 146, 154, 155, 158, 161, 165, 166, 170, 177, 178, 186, 187, 190, 194, 201, 202
Offset: 1

Views

Author

Gus Wiseman, Apr 13 2018

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. Two or more numbers are coprime if no pair of them has a common divisor other than 1. A single number is not considered coprime unless it is equal to 1.
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			Sequence of terms together with their sets of prime indices begins:
01 : {}
02 : {1}
06 : {1,2}
10 : {1,3}
14 : {1,4}
15 : {2,3}
22 : {1,5}
26 : {1,6}
30 : {1,2,3}
33 : {2,5}
34 : {1,7}
35 : {3,4}
38 : {1,8}
46 : {1,9}
51 : {2,7}
55 : {3,5}
58 : {1,10}
62 : {1,11}
66 : {1,2,5}
69 : {2,9}
70 : {1,3,4}
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100],Or[#===1,SquareFreeQ[#]&&CoprimeQ@@PrimePi/@FactorInteger[#][[All,1]]]&]

A366843 Number of integer partitions of n into odd, relatively prime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 4, 6, 6, 9, 11, 13, 17, 21, 23, 32, 37, 42, 53, 62, 70, 88, 103, 116, 139, 164, 184, 220, 255, 283, 339, 390, 435, 511, 578, 653, 759, 863, 963, 1107, 1259, 1401, 1609, 1814, 2015, 2303, 2589, 2878, 3259, 3648, 4058, 4580, 5119, 5672, 6364
Offset: 0

Views

Author

Gus Wiseman, Oct 28 2023

Keywords

Examples

			The a(1) = 1 through a(8) = 6 partitions:
  (1)  (11)  (111)  (31)    (311)    (51)      (331)      (53)
                    (1111)  (11111)  (3111)    (511)      (71)
                                     (111111)  (31111)    (3311)
                                               (1111111)  (5111)
                                                          (311111)
                                                          (11111111)
		

Crossrefs

Allowing even parts gives A000837.
The strict case is A366844, with evens A078374.
The complement is counted by A366852, with evens A018783.
The pairwise coprime version is A366853, with evens A051424.
A000041 counts integer partitions, strict A000009 (also into odds).
A000740 counts relatively prime compositions.
A168532 counts partitions by gcd.
A366842 counts partitions whose odd parts have a common divisor > 1.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],#=={}||And@@OddQ/@#&&GCD@@#==1&]],{n,0,30}]
  • Python
    from math import gcd
    from sympy.utilities.iterables import partitions
    def A366843(n): return sum(1 for p in partitions(n) if all(d&1 for d in p) and gcd(*p)==1) # Chai Wah Wu, Oct 30 2023

A337450 Number of relatively prime compositions of n with no 1's.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 0, 7, 5, 17, 17, 54, 51, 143, 168, 358, 482, 986, 1313, 2583, 3663, 6698, 9921, 17710, 26489, 46352, 70928, 121137, 188220, 317810, 497322, 832039, 1313501, 2177282, 3459041, 5702808, 9094377, 14930351, 23895672, 39084070, 62721578
Offset: 0

Views

Author

Gus Wiseman, Aug 31 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.

Examples

			The a(5) = 2 through a(10) = 17 compositions (empty column indicated by dot):
  (2,3)  .  (2,5)    (3,5)    (2,7)      (3,7)
  (3,2)     (3,4)    (5,3)    (4,5)      (7,3)
            (4,3)    (2,3,3)  (5,4)      (2,3,5)
            (5,2)    (3,2,3)  (7,2)      (2,5,3)
            (2,2,3)  (3,3,2)  (2,2,5)    (3,2,5)
            (2,3,2)           (2,3,4)    (3,3,4)
            (3,2,2)           (2,4,3)    (3,4,3)
                              (2,5,2)    (3,5,2)
                              (3,2,4)    (4,3,3)
                              (3,4,2)    (5,2,3)
                              (4,2,3)    (5,3,2)
                              (4,3,2)    (2,2,3,3)
                              (5,2,2)    (2,3,2,3)
                              (2,2,2,3)  (2,3,3,2)
                              (2,2,3,2)  (3,2,2,3)
                              (2,3,2,2)  (3,2,3,2)
                              (3,2,2,2)  (3,3,2,2)
		

Crossrefs

A000740 is the version allowing 1's.
2*A055684(n) is the case of length 2.
A302697 ranks the unordered case.
A302698 is the unordered version.
A337451 is the strict version.
A337452 is the unordered strict version.
A000837 counts relatively prime partitions.
A002865 counts partitions with no 1's.
A101268 counts singleton or pairwise coprime compositions.
A212804 counts compositions with no 1's.
A291166 appears to rank relatively prime compositions.
A337462 counts pairwise coprime compositions.

Programs

  • Maple
    b:= proc(n, g) option remember; `if`(n=0,
         `if`(g=1, 1, 0), add(b(n-j, igcd(g, j)), j=2..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..42);
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MemberQ[#,1]&&GCD@@#==1&]],{n,0,15}]

A343338 Numbers with no prime index dividing or divisible by all the other prime indices.

Original entry on oeis.org

1, 15, 33, 35, 45, 51, 55, 69, 75, 77, 85, 91, 93, 95, 99, 105, 119, 123, 135, 141, 143, 145, 153, 155, 161, 165, 175, 177, 187, 201, 203, 205, 207, 209, 215, 217, 219, 221, 225, 231, 245, 247, 249, 253, 255, 265, 275, 279, 285, 287, 291, 295, 297, 299, 301
Offset: 1

Views

Author

Gus Wiseman, Apr 13 2021

Keywords

Comments

Alternative name: 1 and numbers whose smallest prime index does not divide all the other prime indices, nor whose greatest prime index is divisible by all the other prime indices.
First differs from A302697 in having 91.
First differs from A337987 in having 91.
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.
Also Heinz numbers of partitions with greatest part not divisible by all the others and smallest part not dividing all the others (counted by A343342). The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), giving a bijective correspondence between positive integers and integer partitions.

Examples

			The sequence of terms together with their prime indices begins:
      1: {}         105: {2,3,4}      203: {4,10}
     15: {2,3}      119: {4,7}        205: {3,13}
     33: {2,5}      123: {2,13}       207: {2,2,9}
     35: {3,4}      135: {2,2,2,3}    209: {5,8}
     45: {2,2,3}    141: {2,15}       215: {3,14}
     51: {2,7}      143: {5,6}        217: {4,11}
     55: {3,5}      145: {3,10}       219: {2,21}
     69: {2,9}      153: {2,2,7}      221: {6,7}
     75: {2,3,3}    155: {3,11}       225: {2,2,3,3}
     77: {4,5}      161: {4,9}        231: {2,4,5}
     85: {3,7}      165: {2,3,5}      245: {3,4,4}
     91: {4,6}      175: {3,3,4}      247: {6,8}
     93: {2,11}     177: {2,17}       249: {2,23}
     95: {3,8}      187: {5,7}        253: {5,9}
     99: {2,2,5}    201: {2,19}       255: {2,3,7}
For example, the prime indices of 975 are {2,3,3,6}, all of which divide 6, but not all of which are multiples of 2, so 975 is not in the sequence.
		

Crossrefs

The first condition alone gives A342193.
The second condition alone gives A343337.
The half-opposite versions are A343339 and A343340.
The partitions with these Heinz numbers are counted by A343342.
The opposite version is the complement of A343343.
A000005 counts divisors.
A000070 counts partitions with a selected part.
A001055 counts factorizations.
A056239 adds up prime indices, row sums of A112798.
A067824 counts strict chains of divisors starting with n.
A253249 counts strict chains of divisors.
A339564 counts factorizations with a selected factor.

Programs

  • Mathematica
    Select[Range[100],#==1||With[{p=PrimePi/@First/@FactorInteger[#]},!And@@IntegerQ/@(Max@@p/p)&&!And@@IntegerQ/@(p/Min@@p)]&]

Formula

Intersection of A342193 and A343337.

A101391 Triangle read by rows: T(n,k) is the number of compositions of n into k parts x_1, x_2, ..., x_k such that gcd(x_1,x_2,...,x_k) = 1 (1<=k<=n).

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 2, 3, 1, 0, 4, 6, 4, 1, 0, 2, 9, 10, 5, 1, 0, 6, 15, 20, 15, 6, 1, 0, 4, 18, 34, 35, 21, 7, 1, 0, 6, 27, 56, 70, 56, 28, 8, 1, 0, 4, 30, 80, 125, 126, 84, 36, 9, 1, 0, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1, 0, 4, 42, 154, 325, 461, 462, 330, 165, 55, 11, 1, 0, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12, 1
Offset: 1

Views

Author

Emeric Deutsch, Jan 26 2005

Keywords

Comments

If instead we require that the individual parts (x_i,x_j) be relatively prime, we get A282748. This is the question studied by Shonhiwa (2006). - N. J. A. Sloane, Mar 05 2017.

Examples

			T(6,3)=9 because we have 411,141,114 and the six permutations of 123 (222 does not qualify).
T(8,3)=18 because binomial(0,2)*mobius(8/1)+binomial(1,2)*mobius(8/2)+binomial(3,2)*mobius(8/4)+binomial(7,2)*mobius(8/8)=0+0+(-3)+21=18.
Triangle begins:
   1;
   0,  1;
   0,  2,  1;
   0,  2,  3,   1;
   0,  4,  6,   4,   1;
   0,  2,  9,  10,   5,   1;
   0,  6, 15,  20,  15,   6,   1;
   0,  4, 18,  34,  35,  21,   7,   1;
   0,  6, 27,  56,  70,  56,  28,   8,   1;
   0,  4, 30,  80, 125, 126,  84,  36,   9,   1;
   0, 10, 45, 120, 210, 252, 210, 120,  45,  10,  1;
   0,  4, 42, 154, 325, 461, 462, 330, 165,  55, 11,  1;
   0, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12, 1;
  ...
From _Gus Wiseman_, Oct 19 2020: (Start)
Row n = 6 counts the following compositions:
  (15)  (114)  (1113)  (11112)  (111111)
  (51)  (123)  (1122)  (11121)
        (132)  (1131)  (11211)
        (141)  (1212)  (12111)
        (213)  (1221)  (21111)
        (231)  (1311)
        (312)  (2112)
        (321)  (2121)
        (411)  (2211)
               (3111)
Missing are: (42), (24), (33), (222).
(End)
		

Crossrefs

Mirror image of A039911.
Row sums are A000740.
A000837 counts relatively prime partitions.
A135278 counts compositions by length.
A282748 is the pairwise coprime instead of relatively prime version.
A282750 is the unordered version.
A291166 ranks these compositions (evidently).
T(2n+1,n+1) gives A000984.

Programs

  • Maple
    with(numtheory): T:=proc(n,k) local d, j, b: d:=divisors(n): for j from 1 to tau(n) do b[j]:=binomial(d[j]-1,k-1)*mobius(n/d[j]) od: sum(b[i],i=1..tau(n)) end: for n from 1 to 14 do seq(T(n,k),k=1..n) od; # yields the sequence in triangular form
    # second Maple program:
    b:= proc(n, g) option remember; `if`(n=0, `if`(g=1, 1, 0),
          expand(add(b(n-j, igcd(g, j))*x, j=1..n)))
        end:
    T:= (n, k)-> coeff(b(n,0),x,k):
    seq(seq(T(n,k), k=1..n), n=1..14);  # Alois P. Heinz, May 05 2025
  • Mathematica
    t[n_, k_] := Sum[Binomial[d-1, k-1]*MoebiusMu[n/d], {d, Divisors[n]}]; Table[t[n, k], {n, 2, 14}, {k, 2, n}] // Flatten (* Jean-François Alcover, Jan 20 2014 *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],GCD@@#==1&]],{n,10},{k,2,n}] (* change {k,2,n} to {k,1,n} for the version with zeros. - Gus Wiseman, Oct 19 2020 *)
  • PARI
    T(n, k) = sumdiv(n, d, binomial(d-1, k-1)*moebius(n/d)); \\ Michel Marcus, Mar 09 2016

Formula

T(n,k) = Sum_{d|n} binomial(d-1,k-1)*mobius(n/d).
Sum_{k=1..n} k * T(n,k) = A085411(n). - Alois P. Heinz, May 05 2025

Extensions

Definition clarified by N. J. A. Sloane, Mar 05 2017
Edited by Alois P. Heinz, May 05 2025
Showing 1-10 of 20 results. Next