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.

Previous Showing 11-18 of 18 results.

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

A023033 Number of compositions of n into 8 ordered relatively prime parts.

Original entry on oeis.org

1, 8, 36, 120, 330, 792, 1716, 3432, 6434, 11440, 19440, 31824, 50352, 77520, 116160, 170544, 244826, 346104, 479908, 657792, 886314, 1184040, 1557312, 2035800, 2623140, 3365736, 4260608, 5379616, 6704742, 8347680, 10263648, 12619464
Offset: 8

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [&+[MoebiusMu(n div d)*Binomial(d-1,7):d in Divisors(n)]:n in[8..40]]; // Marius A. Burtea, Feb 07 2020
  • Maple
    with(numtheory):
    a:= n-> add(mobius(n/d)*binomial(d-1, 7), d=divisors(n)):
    seq(a(n), n=8..50);  # Alois P. Heinz, Feb 05 2020
  • Mathematica
    a[n_]:=DivisorSum[n, Binomial[# - 1, 7] MoebiusMu[n/#]&]; Array[a, 37, 8] (* or *) a[n_]:=Sum[Boole[Divisible[n, k]] MoebiusMu[n/k] Binomial[k - 1, 7], {k, 1, n}]; Table[a[n], {n, 8, 45}] (* Vincenzo Librandi, Feb 07 2020 *)

Formula

Moebius transform of C(n-1,7).
G.f.: Sum_{k>=1} mu(k) * x^(8*k) / (1 - x^k)^8. - Ilya Gutkovskiy, Feb 05 2020

A023034 Number of compositions of n into 9 ordered relatively prime parts.

Original entry on oeis.org

1, 9, 45, 165, 495, 1287, 3003, 6435, 12870, 24309, 43758, 75573, 125970, 203445, 319770, 490149, 735471, 1081080, 1562274, 2218788, 3108105, 4289133, 5852925, 7882290, 10518255, 13871286, 18156204, 23511345, 30260340, 38564262, 48902997
Offset: 9

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [&+[MoebiusMu(n div d)*Binomial(d-1,8):d in Divisors(n)]:n in[9..39]]; // Marius A. Burtea, Feb 07 2020
  • Maple
    with(numtheory):
    a:= n-> add(mobius(n/d)*binomial(d-1, 8), d=divisors(n)):
    seq(a(n), n=9..50);  # Alois P. Heinz, Feb 05 2020
  • Mathematica
    Table[a[n],{n,9,45}]a[n_]:=DivisorSum[n, Binomial[#-1, 8] MoebiusMu[n/#]&]; Array[a, 37, 9] (* or *) a[n_]:=Sum[Boole[Divisible[n,k]] MoebiusMu[n/k] Binomial[k-1,8],{k,1,n}];Table[a[n],{n,9,45}] (* Vincenzo Librandi, Feb 08 2020 *)

Formula

Moebius transform of C(n-1,8).
G.f.: Sum_{k>=1} mu(k) * x^(9*k) / (1 - x^k)^9. - Ilya Gutkovskiy, Feb 05 2020

A048240 Number of new colors that can be mixed with n units of yellow, blue, red.

Original entry on oeis.org

1, 3, 3, 7, 9, 18, 15, 33, 30, 45, 42, 75, 54, 102, 81, 108, 108, 168, 117, 207, 156, 210, 195, 297, 204, 330, 270, 351, 306, 462, 300, 525, 408, 510, 456, 612, 450, 738, 567, 708, 600, 900, 594, 987, 750, 900, 825, 1173, 792, 1239, 930, 1200
Offset: 0

Views

Author

Jurjen N.E. Bos, N. J. A. Sloane, Robin Trew (trew(AT)hcs.harvard.edu)

Keywords

Crossrefs

A032125(n) = a(2^n).

Programs

  • Maple
    A048240 := proc(n) local ans, i, j, k; ans := 0; for i from n by -1 to 0 do for j from n by -1 to 0 do k := n - i - j; if 0 <= k and k <= n and gcd(gcd(i, j), k) = 1 then ans := ans + 1; fi; od; od; RETURN(ans); end;
  • Mathematica
    a[n_] := Sum[ MoebiusMu[n/d]*(d+1)*(d+2)/2, {d, Divisors[n]}]; a[0] = 1; Table[a[n], {n, 0, 51}] (* Jean-François Alcover, Jun 14 2012, after Vladeta Jovovic *)

Formula

a(n) = number of triples (i, j, k) with i+j+k = n and gcd(i, j, k) = 1.
a(n) = Sum_{d|n} mu(n/d)*(d+1)*(d+2)/2. G.f.: Sum_{k>0} mu(k)/(1-x^k)^3. - Vladeta Jovovic, Dec 22 2002

A015616 Number of triples (i,j,k) with 1 <= i < j < k <= n and gcd(i,j,k) = 1.

Original entry on oeis.org

0, 0, 1, 4, 10, 19, 34, 52, 79, 109, 154, 196, 262, 325, 409, 493, 613, 712, 865, 997, 1171, 1336, 1567, 1747, 2017, 2251, 2548, 2818, 3196, 3472, 3907, 4267, 4717, 5125, 5665, 6079, 6709, 7222, 7858, 8410, 9190, 9748, 10609, 11299, 12127
Offset: 1

Views

Author

Keywords

Examples

			For n=6, the a(6) = 19 solutions are the binomial(6,3) = (6*5*4)/(1*2*3) = 20 possible triples minus the triple (2,4,6) with GCD=2.
		

Crossrefs

Programs

  • Maple
    f:=proc(n) local i,j,k,t1,t2,t3; t1:=0; for i from 1 to n-2 do for j from i+1 to n-1 do t2:=gcd(i,j); for k from j+1 to n do t3:=gcd(t2,k); if t3 = 1 then t1:=t1+1; fi; od: od: od: t1; end;
    # program based on Moebius transform, partial sums of A000741:
    with(numtheory):
    b:= proc(n) option remember;
          add(mobius(n/d)*(d-2)*(d-1)/2, d=divisors(n))
        end:
    a:= proc(n) option remember;
          b(n) +`if`(n=1, 0, a(n-1))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 08 2011
  • Mathematica
    a[n_] := (cnt = 0; Do[cnt += Boole[GCD[i, j, k] == 1], {i, 1, n-2}, {j, i+1, n-1}, {k, j+1, n}]; cnt); Table[a[n], {n, 1, 45}] (* Jean-François Alcover, Mar 05 2013 *)
  • PARI
    print1(c=0);for(k=1,99,for(j=1,k-1, gcd(j,k)==1 && (c+=j-1) && next; for(i=1,j-1, gcd([i,j,k])>1 || c++)); print1(", "c))
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A015616(n):
        if n <= 1:
            return 0
        c, j = n*(n-1)*(n-2)//6, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c -= (j2-j)*A015616(k1)
            j, k1 = j2, n//j2
        return c # Chai Wah Wu, Mar 30 2021

Formula

a(n) = (A071778(n) - 3*A018805(n) + 2)/6. - Vladeta Jovovic, Dec 01 2004
a(n) = Sum_{i=1..n} A000741(i). - Alois P. Heinz, Feb 08 2011
For n > 1, a(n) = n(n-1)(n-2)/6 - Sum_{j=2..n} a(floor(n/j)) = A000292(n-2) - Sum_{j=2..n} a(floor(n/j)). - Chai Wah Wu, Mar 30 2021

A338333 Number of relatively prime 3-part strict integer partitions of n with no 1's.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 4, 4, 7, 6, 10, 8, 14, 12, 18, 16, 24, 18, 30, 25, 34, 30, 44, 31, 52, 42, 56, 49, 69, 50, 80, 64, 83, 70, 102, 71, 114, 90, 112, 100, 140, 98, 153, 117, 153, 132, 184, 128, 195, 154, 196, 169, 234, 156, 252, 196, 241
Offset: 0

Views

Author

Gus Wiseman, Oct 30 2020

Keywords

Comments

The Heinz numbers of these partitions are the intersection of A005117 (strict), A005408 (no 1's), A014612 (length 3), and A289509 (relatively prime).

Examples

			The a(9) = 1 through a(19) = 14 triples (A = 10, B = 11, C = 12, D = 13, E = 14):
  432   532   542   543   643   653   654   754   764   765   865
              632   732   652   743   753   763   854   873   874
                          742   752   762   853   863   954   964
                          832   932   843   943   872   972   973
                                      852   952   953   A53   982
                                      942   B32   962   B43   A54
                                      A32         A43   B52   A63
                                                  A52   D32   A72
                                                  B42         B53
                                                  C32         B62
                                                              C43
                                                              C52
                                                              D42
                                                              E32
		

Crossrefs

A001399(n-9) does not require relative primality.
A005117 /\ A005408 /\ A014612 /\ A289509 gives the Heinz numbers.
A055684 is the 2-part version.
A284825 counts the case that is also pairwise non-coprime.
A337452 counts these partitions of any length.
A337563 is the pairwise coprime instead of relatively prime version.
A337605 is the pairwise non-coprime instead of relative prime version.
A338332 is the not necessarily strict version.
A338333*6 is the ordered version.
A000837 counts relatively prime partitions.
A008284 counts partitions by sum and length.
A078374 counts relatively prime strict partitions.
A101271 counts 3-part relatively prime strict partitions.
A220377 counts 3-part pairwise coprime strict partitions.
A337601 counts 3-part partitions whose distinct parts are pairwise coprime.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n,{3}],UnsameQ@@#&&!MemberQ[#,1]&&GCD@@#==1&]],{n,0,30}]

A338332 Number of relatively prime 3-part integer partitions of n with no 1's.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 5, 3, 8, 6, 9, 9, 16, 10, 21, 15, 22, 20, 33, 21, 38, 30, 41, 35, 56, 34, 65, 49, 64, 56, 79, 55, 96, 72, 93, 77, 120, 76, 133, 99, 122, 110, 161, 105, 172, 126, 167, 143, 208, 136, 213, 165, 212, 182, 261, 163, 280, 210, 257
Offset: 0

Views

Author

Gus Wiseman, Oct 30 2020

Keywords

Comments

The Heinz numbers of these partitions are the intersection of A005408 (no 1's), A014612 (length 3), and A289509 (relatively prime).

Examples

			The a(7) = 1 through a(17) = 16 triples (A = 10, B = 11, C = 12, D = 13):
  322   332   432   433   443   543   544   554   654   655   665
              522   532   533   552   553   653   744   754   755
                          542   732   643   743   753   763   764
                          632         652   752   762   772   773
                          722         733   833   843   853   854
                                      742   932   852   943   863
                                      832         942   952   872
                                      922         A32   A33   944
                                                  B22   B32   953
                                                              962
                                                              A43
                                                              A52
                                                              B33
                                                              B42
                                                              C32
                                                              D22
		

Crossrefs

A001399(n-6) does not require relative primality.
A005408 /\ A014612 /\ A289509 gives the Heinz numbers of these partitions.
A055684 is the 2-part version.
A284825 counts the case that is also pairwise non-coprime.
A302698 counts these partitions of any length.
A337563 is the pairwise coprime instead of relatively prime version.
A338333 is the strict version.
A000837 counts relatively prime partitions, with strict case A078374.
A008284 counts partitions by sum and length.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n,{3}],!MemberQ[#,1]&&GCD@@#==1&]],{n,0,30}]

A344574 Number of ordered pairs (i,j) with 0 < i < j < n such that gcd(i,j,n) > 1.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 3, 1, 6, 0, 13, 0, 15, 7, 21, 0, 37, 0, 39, 16, 45, 0, 73, 6, 66, 28, 81, 0, 130, 0, 105, 46, 120, 21, 181, 0, 153, 67, 189, 0, 262, 0, 213, 118, 231, 0, 337, 15, 306, 121, 303, 0, 433, 51, 369, 154, 378, 0, 583, 0, 435, 217, 465
Offset: 1

Views

Author

Andres Cicuttin, May 23 2021

Keywords

Comments

A 4-regular circulant graph of order n, C(n,i,j), is connected if and only if gcd(n,i,j) = 1, where 0 < i < j < n.
a(n) >= 1 iff n is a composite > 4. - Robert Israel, Nov 26 2024

Examples

			a(8) = 3 via (i, j, n) in {(2, 4, 8), (2, 6, 8), (4, 6, 8)} and that's three such tuples. - _David A. Corneth_, Nov 27 2024
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t,i,g;
    t:= 0:
    for i from 1 to n-2 do
      g:= igcd(i,n);
      if g > 1 then t:= t + nops(select(s -> igcd(s,g) > 1, [$i+1..n-1])) fi
    od:
    t;
    end proc:
    map(f, [$1..80]); # Robert Israel, Nov 26 2024
  • Mathematica
    npairs[n_]:=Module[{k=0},
    Do[Do[
    If[GCD[i,j,n]>1,k++]
    ,{i,1,j-1}],{j,2,n-1}];
    Return[k]];
    Table[npairs[n],{n,1,60}]
  • PARI
    a(n) = {my(res = 0, d = divisors(factorback(factor(n)[,1]))); for(i = 2, #d, res+= moebius(d[i])*binomial((n-1)\d[i], 2)); -res} \\ David A. Corneth, Nov 27 2024
Previous Showing 11-18 of 18 results.