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.

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

This page as a plain text file.
%I A101391 #48 May 05 2025 10:39:20
%S A101391 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,
%T A101391 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,
%U A101391 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
%N 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).
%C A101391 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.
%H A101391 Alois P. Heinz, <a href="/A101391/b101391.txt">Rows n = 1..200, flattened</a>
%H A101391 H. W. Gould, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/2-4/gould.pdf">Binomial coefficients, the bracket function and compositions with relatively prime summands</a>, Fib. Quart. 2(4) (1964), 241-260.
%H A101391 Temba Shonhiwa, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Papers1/44-4/quarttemba04_2006.pdf">Compositions with pairwise relatively prime summands within a restricted setting</a>, Fibonacci Quart. 44 (2006), no. 4, 316-323.
%F A101391 T(n,k) = Sum_{d|n} binomial(d-1,k-1)*mobius(n/d).
%F A101391 Sum_{k=1..n} k * T(n,k) = A085411(n). - _Alois P. Heinz_, May 05 2025
%e A101391 T(6,3)=9 because we have 411,141,114 and the six permutations of 123 (222 does not qualify).
%e A101391 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.
%e A101391 Triangle begins:
%e A101391    1;
%e A101391    0,  1;
%e A101391    0,  2,  1;
%e A101391    0,  2,  3,   1;
%e A101391    0,  4,  6,   4,   1;
%e A101391    0,  2,  9,  10,   5,   1;
%e A101391    0,  6, 15,  20,  15,   6,   1;
%e A101391    0,  4, 18,  34,  35,  21,   7,   1;
%e A101391    0,  6, 27,  56,  70,  56,  28,   8,   1;
%e A101391    0,  4, 30,  80, 125, 126,  84,  36,   9,   1;
%e A101391    0, 10, 45, 120, 210, 252, 210, 120,  45,  10,  1;
%e A101391    0,  4, 42, 154, 325, 461, 462, 330, 165,  55, 11,  1;
%e A101391    0, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12, 1;
%e A101391   ...
%e A101391 From _Gus Wiseman_, Oct 19 2020: (Start)
%e A101391 Row n = 6 counts the following compositions:
%e A101391   (15)  (114)  (1113)  (11112)  (111111)
%e A101391   (51)  (123)  (1122)  (11121)
%e A101391         (132)  (1131)  (11211)
%e A101391         (141)  (1212)  (12111)
%e A101391         (213)  (1221)  (21111)
%e A101391         (231)  (1311)
%e A101391         (312)  (2112)
%e A101391         (321)  (2121)
%e A101391         (411)  (2211)
%e A101391                (3111)
%e A101391 Missing are: (42), (24), (33), (222).
%e A101391 (End)
%p A101391 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
%p A101391 # second Maple program:
%p A101391 b:= proc(n, g) option remember; `if`(n=0, `if`(g=1, 1, 0),
%p A101391       expand(add(b(n-j, igcd(g, j))*x, j=1..n)))
%p A101391     end:
%p A101391 T:= (n, k)-> coeff(b(n,0),x,k):
%p A101391 seq(seq(T(n,k), k=1..n), n=1..14);  # _Alois P. Heinz_, May 05 2025
%t A101391 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 *)
%t A101391 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 *)
%o A101391 (PARI) T(n, k) = sumdiv(n, d, binomial(d-1, k-1)*moebius(n/d)); \\ _Michel Marcus_, Mar 09 2016
%Y A101391 Mirror image of A039911.
%Y A101391 Row sums are A000740.
%Y A101391 Columns 2-9 are: A000010, A000741, A000742, A000743, A023031, A023032, A023033, A023034.
%Y A101391 A000837 counts relatively prime partitions.
%Y A101391 A135278 counts compositions by length.
%Y A101391 A282748 is the pairwise coprime instead of relatively prime version.
%Y A101391 A282750 is the unordered version.
%Y A101391 A291166 ranks these compositions (evidently).
%Y A101391 T(2n+1,n+1) gives A000984.
%Y A101391 Cf. A007359, A008683, A085411, A101268, A289508, A289509, A302697, A332004, A337485, A337563.
%K A101391 nonn,tabl,easy
%O A101391 1,5
%A A101391 _Emeric Deutsch_, Jan 26 2005
%E A101391 Definition clarified by _N. J. A. Sloane_, Mar 05 2017
%E A101391 Edited by _Alois P. Heinz_, May 05 2025