A356027 Duplicate of 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, 34, 35, 21, 7, 1, 0, 6, 27, 56, 70, 56, 28, 8, 1
Offset: 1
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.
For n=4, there are 6 compositions of n into coprime parts: <3,1>, <2,1,1>, <1,3>, <1,2,1>, <1,1,2>, and <1,1,1,1>. From _Gus Wiseman_, Dec 19 2017: (Start) The a(6) = 27 aperiodic compositions are: (11112), (11121), (11211), (12111), (21111), (1113), (1122), (1131), (1221), (1311), (2112), (2211), (3111), (114), (123), (132), (141), (213), (231), (312), (321), (411), (15), (24), (42), (51), (6). The a(6) = 27 compositions into relatively prime parts are: (111111), (11112), (11121), (11211), (12111), (21111), (1113), (1122), (1131), (1212), (1221), (1311), (2112), (2121), (2211), (3111), (114), (123), (132), (141), (213), (231), (312), (321), (411), (15), (51). The a(6) = 27 compositions with relatively prime run-lengths are: (11112), (11121), (11211), (12111), (21111), (1113), (1131), (1212), (1221), (1311), (2112), (2121), (3111), (114), (123), (132), (141), (213), (231), (312), (321), (411), (15), (24), (42), (51), (6). (End)
with(numtheory): a[1]:=1: a[2]:=1: for n from 3 to 32 do div:=divisors(n): a[n]:=2^(n-1)-sum(a[n/div[j]],j=2..tau(n)) od: seq(a[n],n=1..32); # Emeric Deutsch, Apr 27 2007 with(numtheory); A000740:=n-> add(mobius(n/d)*2^(d-1), d in divisors(n)); # N. J. A. Sloane, Oct 18 2012
a[n_] := Sum[ MoebiusMu[n/d]*2^(d - 1), {d, Divisors[n]}]; Table[a[n], {n, 1, 32}] (* Jean-François Alcover, Feb 03 2012, after PARI *)
a(n) = sumdiv(n,d,moebius(n/d)*2^(d-1))
from sympy import mobius, divisors def a(n): return sum([mobius(n // d) * 2**(d - 1) for d in divisors(n)]) [a(n) for n in range(1, 101)] # Indranil Ghosh, Jun 28 2017
From _Gus Wiseman_, Oct 14 2020: (Start) The a(3) = 1 through a(8) = 18 triples: (1,1,1) (1,1,2) (1,1,3) (1,1,4) (1,1,5) (1,1,6) (1,2,1) (1,2,2) (1,2,3) (1,2,4) (1,2,5) (2,1,1) (1,3,1) (1,3,2) (1,3,3) (1,3,4) (2,1,2) (1,4,1) (1,4,2) (1,4,3) (2,2,1) (2,1,3) (1,5,1) (1,5,2) (3,1,1) (2,3,1) (2,1,4) (1,6,1) (3,1,2) (2,2,3) (2,1,5) (3,2,1) (2,3,2) (2,3,3) (4,1,1) (2,4,1) (2,5,1) (3,1,3) (3,1,4) (3,2,2) (3,2,3) (3,3,1) (3,3,2) (4,1,2) (3,4,1) (4,2,1) (4,1,3) (5,1,1) (4,3,1) (5,1,2) (5,2,1) (6,1,1) (End)
with(numtheory): mobtr:= proc(p) proc(n) option remember; add(mobius(n/d)*p(d), d=divisors(n)) end end: A000217:= n-> n*(n+1)/2: a:= mobtr(n-> A000217(n-2)): seq(a(n), n=1..58); # Alois P. Heinz, Feb 08 2011
mobtr[p_] := Module[{f}, f[n_] := f[n] = Sum[MoebiusMu[n/d]*p[d], {d, Divisors[n]}]; f]; A000217[n_] := n*(n+1)/2; a = mobtr[A000217[#-2]&]; Table[a[n], {n, 1, 58}] (* Jean-François Alcover, Mar 12 2014, after Alois P. Heinz *) Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],GCD@@#==1&]],{n,0,30}] (* Gus Wiseman, Oct 14 2020 *)
Triangle begins: n/k: 1, 2, 3, 4, 5, 6, 7, 8, ... 1: 1; 2: 0, 1; 3: 0, 1, 1; 4: 0, 1, 1, 1; 5: 0, 2, 2, 1, 1; 6: 0, 1, 2, 2, 1, 1; 7: 0, 3, 4, 3, 2, 1, 1; 8: 0, 2, 4, 4, 3, 2, 1, 1; 9: 0, 3, 6, 6, 5, 3, 2, 1, 1; 10: 0, 2, 6, 8, 6, 5, 3, 2, 1, 1; 11: 0, 5, 10, 11, 10, 7, 5, 3, 2, 1, 1; 12: 0, 2, 8, 12, 12, 10, 7, 5, 3, 2, 1, 1; ... The partitions with their gcd value for n=8, k=2..5: (1, 7)=1, (2, 6)=2, (3, 5)=1, (4, 4)=4, so T(8,2)=2. (1, 1, 6)=1, (1, 2, 5)=1, (1, 3, 4)=1, (2, 2, 4)=2, (2, 3, 3)=1, so T(8,2)=4. (1, 1, 1, 5)=1, (1, 1, 2, 4)=1, (1, 1, 3, 3)=1, (1, 2, 2, 3)=1, (2, 2, 2, 2)=2, so T(8,3)=4. (1, 1, 1, 1, 4)=1, (1, 1, 1, 2, 3)=1, (1, 1, 2, 2, 2)=1, so T(8,4)=3. (1, 1, 1, 1, 1, 3)=1, (1, 1, 1, 1, 2, 2)=1, so T(8,5)=2.
Table[Length@ Select[IntegerPartitions[n, {k}], GCD @@ # == 1 &], {n, 13}, {k, n}] // Flatten (* Michael De Vlieger, Mar 08 2017 *)
# uses[DivisorTriangle from A327029, A008284] DivisorTriangle(moebius, A008284, 13) # Peter Luschny, Aug 24 2019
f[n_] := Block[{d = Divisors[n]}, (Plus @@ (MoebiusMu[n/d]*(d + 1)*2^(d - 2)))]; Table[ f[n], {n, 1, 30}]
Triangle begins: 1; 1, 1; 1, 2, 1; 1, 2, 3, 1; 1, 4, 3, 4, 1; 1, 2, 9, 4, 5, 1; 1, 6, 3, 16, 5, 6, 1; 1, 4, 15, 4, 25, 6, 7, 1; 1, 6, 9, 28, 5, 36, 7, 8, 1; 1, 4, 21, 16, 45, 6, 49, 8, 9, 1; 1, 10, 9, 52, 25, 66, 7, 64, 9, 10, 1; 1, 4, 39, 16, 105, 36, 91, 8, 81, 10, 11, 1; 1, 12, 9, 100, 25, 186, 49, 120, 9, 100, 11, 12, 1; ... From _Gus Wiseman_, Nov 12 2020: (Start) Row n = 6 counts the following compositions: (6) (15) (114) (1113) (11112) (111111) (51) (123) (1131) (11121) (132) (1311) (11211) (141) (3111) (12111) (213) (21111) (231) (312) (321) (411) (End)
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],Length[#]==1||CoprimeQ@@#&]],{n,10},{k,n}] (* Gus Wiseman, Nov 12 2020 *)
The a(1) = 1 through a(7) = 15 partitions: (1) (2) (3) (4) (5) (6) (7) (11) (21) (22) (32) (33) (43) (111) (31) (41) (51) (52) (211) (221) (222) (61) (1111) (311) (321) (322) (2111) (411) (331) (11111) (2211) (421) (3111) (511) (21111) (2221) (111111) (3211) (4111) (22111) (31111) (211111) (1111111)
Table[Length[Select[IntegerPartitions[n],SameQ@@#||GCD@@#==1&]],{n,0,30}]
(Let s(k) = sqrt(k) for brevity.) For n = 14, the a(14) = 8 valid compositions are: 14 = 2+2+2+2+2+3+1 and 2 = s(2+s(2+s(2+s(2+s(2+s(3+s(1))))))) 14 = 1+7+2+3+1 and 2 = s(1+s(7+s(2+s(3+s(1))))) 14 = 2+1+7+3+1 and 2 = s(2+s(1+s(7+s(3+s(1))))) 14 = 2+2+1+8+1 and 2 = s(2+s(2+s(1+s(8+s(1))))) 14 = 2+2+2+2+2+4 and 2 = s(2+s(2+s(2+s(2+s(2+s(4)))))) 14 = 1+7+2+4 and 2 = s(1+s(7+s(2+s(4)))) 14 = 2+1+7+4 and 2 = s(2+s(1+s(7+s(4)))) 14 = 2+2+1+9 and 2 = s(2+s(2+s(1+s(9))))
Triangle begins: 1; 1, 0; 1, 2, 0; 1, 3, 2, 0; 1, 4, 6, 4, 0; 1, 5, 10, 9, 2, 0; 1, 6, 15, 20, 15, 6, 0; ...
with(numtheory): R:=proc(n,k) local s,d: s:=0: for d from 1 to n do if irem(n,d)=0 then s:=s+binomial(d-1,k-1)*mobius(n/d) fi od: RETURN(s) : end: seq(seq(R(n,n-k+1),k=1..n),n=1..15); # second Maple program: R:=proc(n,k) options remember: local j: if k=1 then RETURN(piecewise(n=1,1)) else RETURN(binomial(n,k)-add(floor(n/j)*R(j,k),j=k..n-1)) fi: end: seq(seq(R(n,n-k+1),k=1..n),n=1..15); # C. Ronaldo
Comments