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-9 of 9 results.

A356027 Duplicate of A101391.

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
Offset: 1

Views

Author

Keywords

A000740 Number of 2n-bead balanced binary necklaces of fundamental period 2n, equivalent to reversed complement; also Dirichlet convolution of b_n=2^(n-1) with mu(n); also number of components of Mandelbrot set corresponding to Julia sets with an attractive n-cycle.

Original entry on oeis.org

1, 1, 3, 6, 15, 27, 63, 120, 252, 495, 1023, 2010, 4095, 8127, 16365, 32640, 65535, 130788, 262143, 523770, 1048509, 2096127, 4194303, 8386440, 16777200, 33550335, 67108608, 134209530, 268435455, 536854005, 1073741823, 2147450880
Offset: 1

Views

Author

Keywords

Comments

Also number of compositions of n into relatively prime parts (that is, the gcd of all the parts is 1). Also number of subsets of {1,2,..,n} containing n and consisting of relatively prime numbers. - Vladeta Jovovic, Aug 13 2003
Also number of perfect parity patterns that have exactly n columns (see A118141). - Don Knuth, May 11 2006
a(n) is odd if and only if n is squarefree (Tim Keller). - Emeric Deutsch, Apr 27 2007
a(n) is a multiple of 3 for all n>=3 (see Problem 11161 link). - Emeric Deutsch, Aug 13 2008
Row sums of triangle A143424. - Gary W. Adamson, Aug 14 2008
a(n) is the number of monic irreducible polynomials with nonzero constant coefficient in GF(2)[x] of degree n. - Michel Marcus, Oct 30 2016
a(n) is the number of aperiodic compositions of n, the number of compositions of n with relatively prime parts, and the number of compositions of n with relatively prime run-lengths. - Gus Wiseman, Dec 21 2017

Examples

			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)
		

References

  • H. O. Peitgen and P. H. Richter, The Beauty of Fractals, Springer-Verlag; contribution by A. Douady, p. 165.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Equals A027375/2.
See A056278 for a variant.
First differences of A085945.
Column k=2 of A143325.
Row sums of A101391.

Programs

  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    a(n) = sumdiv(n,d,moebius(n/d)*2^(d-1))
    
  • Python
    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

Formula

a(n) = Sum_{d|n} mu(n/d)*2^(d-1), Mobius transform of A011782. Furthermore, Sum_{d|n} a(d) = 2^(n-1).
a(n) = A027375(n)/2 = A038199(n)/2.
a(n) = Sum_{k=0..n} A051168(n,k)*k. - Max Alekseyev, Apr 09 2013
Recurrence relation: a(n) = 2^(n-1) - Sum_{d|n,d>1} a(n/d). (Lafayette College Problem Group; see the Maple program and Iglesias eq (6)). - Emeric Deutsch, Apr 27 2007
G.f.: Sum_{k>=1} mu(k)*x^k/(1 - 2*x^k). - Ilya Gutkovskiy, Oct 24 2018
G.f. satisfies Sum_{n>=1} A( (x/(1 + 2*x))^n ) = x. - Paul D. Hanna, Apr 02 2025

Extensions

Connection with Mandelbrot set discovered by Warren D. Smith and proved by Robert Munafo, Feb 06 2000
Ambiguous term a(0) removed by Max Alekseyev, Jan 02 2012

A000741 Number of compositions of n into 3 ordered relatively prime parts.

Original entry on oeis.org

0, 0, 1, 3, 6, 9, 15, 18, 27, 30, 45, 42, 66, 63, 84, 84, 120, 99, 153, 132, 174, 165, 231, 180, 270, 234, 297, 270, 378, 276, 435, 360, 450, 408, 540, 414, 630, 513, 636, 552, 780, 558, 861, 690, 828, 759, 1035, 744, 1113, 870, 1104, 972, 1326, 945, 1380, 1116, 1386, 1218
Offset: 1

Views

Author

Keywords

Examples

			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)
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A000010 is the length-2 version.
A000217(n-2) does not require relative primality.
A000740 counts these compositions of any length.
A000742 is the length-4 version.
A000837 counts relatively prime partitions.
A023023 is the unordered version.
A101271 is the strict case.
A101391 has this as column k = 3.
A284825*6 is the pairwise non-coprime case.
A291166 intersected with A014311 ranks these compositions.
A337461 is the pairwise coprime instead of relatively prime version.
A337603 counts length-3 compositions whose distinct parts are pairwise coprime.
A337604 is the pairwise non-coprime instead of relatively prime version.

Programs

  • Maple
    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
  • Mathematica
    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 *)

Formula

Moebius transform of A000217(n-2).
G.f.: 1 + Sum_{n>=1} a(n)*x^n/(1 - x^n) = (1 - 3*x + 3*x^2)/(1 - x)^3. - Ilya Gutkovskiy, Apr 26 2017

Extensions

Edited by Alois P. Heinz, Feb 08 2011

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

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 0, 1, 2, 2, 1, 1, 0, 3, 4, 3, 2, 1, 1, 0, 2, 4, 4, 3, 2, 1, 1, 0, 3, 6, 6, 5, 3, 2, 1, 1, 0, 2, 6, 8, 6, 5, 3, 2, 1, 1, 0, 5, 10, 11, 10, 7, 5, 3, 2, 1, 1, 0, 2, 8, 12, 12, 10, 7, 5, 3, 2, 1, 1, 0, 6, 14, 18, 18, 14
Offset: 1

Views

Author

N. J. A. Sloane, Mar 05 2017

Keywords

Comments

Columns 2-10 are A023022-A023030. - Lars Blomberg Mar 08 2017
To base the triangle on (0, 0) a column (1, 0, 0, ...) has to be appended to the left hand side of the triangle. To compute this triangle with Michael De Vlieger's Mathematica program only the ranges of the indices have to be adapted. The SageMath program computes the extended triangle by default. - Peter Luschny, Aug 24 2019

Examples

			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.
		

Crossrefs

Cf. A023022-A023030, A101391 (analog for compositions), A282749 (triangle of partitions into pairwise relatively prime parts).
Row sums = A000837. See also A051424.
For ordinary partition table see A008284.

Programs

  • Mathematica
    Table[Length@ Select[IntegerPartitions[n, {k}], GCD @@ # == 1 &], {n, 13}, {k, n}] // Flatten (* Michael De Vlieger, Mar 08 2017 *)
  • Sage
    # uses[DivisorTriangle from A327029, A008284]
    DivisorTriangle(moebius, A008284, 13) # Peter Luschny, Aug 24 2019

Formula

T(n, k) = Sum_{d|n} Moebius(d) * A008284(n/d, k) for n >= 1, T(0, 0) = 1. - Peter Luschny, Aug 24 2019

Extensions

Corrected a(30)-a(32) and more terms from Lars Blomberg, Mar 08 2017

A085411 Total number of parts in all compositions of n into relatively prime parts.

Original entry on oeis.org

1, 2, 7, 17, 47, 102, 255, 556, 1272, 2766, 6143, 13183, 28671, 61182, 131017, 277952, 589823, 1243800, 2621439, 5502191, 11534073, 24111102, 50331647, 104843732, 218103760, 452956158, 939522816, 1946095599, 4026531839, 8321365194, 17179869183, 35433201664
Offset: 1

Views

Author

Vladeta Jovovic, Aug 13 2003

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{d = Divisors[n]}, (Plus @@ (MoebiusMu[n/d]*(d + 1)*2^(d - 2)))]; Table[ f[n], {n, 1, 30}]

Formula

Sum_{d|n} mu(n/d)*(d+1)*2^(d-2).
G.f.: Sum_{k>=0} mu(k)*x^k*(1-x^k)/(1-2*x^k)^2.
Equals A054525 * A007318 * [1,2,3,...]. - Gary W. Adamson, Jun 11 2007
a(n) = Sum_{k=1..n} k * A101391(n,k). - Alois P. Heinz, May 05 2025

Extensions

More terms from Robert G. Wilson v, Aug 15 2003

A282748 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_i, x_j) = 1 for all i != j (where 1 <= k <= n).

Original entry on oeis.org

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, 1, 6, 45, 16, 205, 36, 301, 64, 153, 10, 121, 12, 13, 1
Offset: 1

Views

Author

N. J. A. Sloane, Mar 05 2017

Keywords

Comments

See A101391 for the triangle T(n,k) = number of compositions of n into k parts x_1, x_2, ..., x_k such that gcd(x_1,x_2,...,x_k) = 1 (2 <= k <= n).

Examples

			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)
		

Crossrefs

A072704 counts the unimodal instead of coprime version.
A087087 and A335235 rank these compositions.
A101268 gives row sums.
A101391 is the relatively prime instead of pairwise coprime version.
A282749 is the unordered version.
A000740 counts relatively prime compositions, with strict case A332004.
A007360 counts pairwise coprime or singleton strict partitions.
A051424 counts pairwise coprime or singleton partitions, ranked by A302569.
A097805 counts compositions by sum and length.
A178472 counts compositions with a common divisor.
A216652 and A072574 count strict compositions by sum and length.
A305713 counts pairwise coprime strict partitions.
A327516 counts pairwise coprime partitions, ranked by A302696.
A335235 ranks pairwise coprime or singleton compositions.
A337462 counts pairwise coprime compositions, ranked by A333227.
A337562 counts pairwise coprime or singleton strict compositions.
A337665 counts compositions whose distinct parts are pairwise coprime, ranked by A333228.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],Length[#]==1||CoprimeQ@@#&]],{n,10},{k,n}] (* Gus Wiseman, Nov 12 2020 *)

Formula

It seems that no general formula or recurrence is known, although Shonhiwa gives formulas for a few of the early diagonals.

A338553 Number of integer partitions of n that are either constant or relatively prime.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 10, 15, 20, 29, 37, 56, 68, 101, 122, 170, 213, 297, 352, 490, 587, 778, 948, 1255, 1488, 1953, 2337, 2983, 3585, 4565, 5393, 6842, 8123, 10088, 12015, 14865, 17534, 21637, 25527, 31085, 36701, 44583, 52262, 63261, 74175, 88936, 104305, 124754
Offset: 0

Views

Author

Gus Wiseman, Nov 03 2020

Keywords

Comments

The Heinz numbers of these partitions are given by A338555 = A000961 \/ A289509. 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 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)
		

Crossrefs

A023022(n) + A059841(n) is the 2-part version.
A078374(n) + 1 is the strict case (n > 1).
A338554 counts the complement, with Heinz numbers A338552.
A338555 gives the Heinz numbers of these partitions.
A000005 counts constant partitions, with Heinz numbers A000961.
A000837 counts relatively prime partitions, with Heinz numbers A289509.
A282750 counts relatively prime partitions by sum and length.

Programs

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

Formula

For n > 0, a(n) = A000005(n) + A000837(n) - 1.

A338271 a(n) is the number of compositions of n, b_1 + ... + b_t = n such that sqrt(b_1 + sqrt(b_2 + ... + sqrt(b_t)...)) is an integer.

Original entry on oeis.org

1, 0, 0, 2, 0, 2, 0, 2, 2, 4, 2, 6, 2, 8, 4, 14, 6, 20, 8, 28, 14, 44, 20, 66, 30, 96, 46, 146, 70, 220, 102, 326, 154, 490, 232, 740, 346, 1102, 520, 1652, 782, 2484, 1166, 3716, 1750, 5568, 2628, 8358, 3936, 12518, 5900, 18760, 8848, 28138, 13256, 42170
Offset: 1

Views

Author

Peter Kagey, Oct 19 2020

Keywords

Comments

a(n) <= Sum_{k=1..floor(sqrt(n)/2)} A338286(floor((n-4*k^2)/2)) when n is even.
a(n) <= Sum_{k=1..floor((sqrt(n) - 1)/2)} A338286(floor((n-4*k^2-4*k-1)/2)) when n is odd and greater than 1.

Examples

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

Crossrefs

Formula

a(n) = Sum_{i=k..A000196(n)} A338268(n,k).

A039911 Triangle read by rows: number of compositions of n into relatively prime summands.

Original entry on oeis.org

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, 1, 7, 21, 35, 34, 18, 4, 0, 1, 8, 28, 56, 70, 56, 27, 6, 0, 1, 9, 36, 84, 126, 125, 80, 30, 4, 0, 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 0, 1, 11, 55, 165, 330, 462, 461, 325, 154, 42, 4, 0, 1, 12, 66, 220, 495, 792, 924, 792, 495, 220, 66, 12, 0
Offset: 1

Views

Author

Keywords

Comments

From C. Ronaldo: (Start)
Let R_k(n) be the number of compositions (ordered partitions) of n with k relatively prime parts. We have the following expressions for R:
Formula: R_k(n) = Sum_{d|n} C(d-1,k-1)*mobius(n/d).
Recurrence: C(n,k) = Sum_{j=k..n} floor(n/j)*R_k(j) for k > 1 and R_1(j) = delta_j1 (the Kronecker delta).
G.f.: Sum_{j>=1} R_k(j)(x^j/(1-x^j)) = (x/(1-x))^k. (End)

Examples

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

Crossrefs

Emeric Deutsch points out that the mirror-image, A101391, is a better version of this triangle.
Row sums give A000740.

Programs

  • Maple
    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

Extensions

More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 28 2004
Edited by Alois P. Heinz, May 06 2025
Showing 1-9 of 9 results.