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

A047996 Triangle read by rows: T(n,k) is the (n,k)-th circular binomial coefficient, where 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 4, 3, 1, 1, 1, 1, 3, 5, 5, 3, 1, 1, 1, 1, 4, 7, 10, 7, 4, 1, 1, 1, 1, 4, 10, 14, 14, 10, 4, 1, 1, 1, 1, 5, 12, 22, 26, 22, 12, 5, 1, 1, 1, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 1, 1, 6, 19, 43, 66, 80, 66, 43, 19, 6, 1, 1, 1, 1, 6, 22
Offset: 0

Views

Author

Keywords

Comments

Equivalently, T(n,k) = number of necklaces with k black beads and n-k white beads (binary necklaces of weight k).
The same sequence arises if we take the table U(n,k) = number of necklaces with n black beads and k white beads and read it by antidiagonals (cf. A241926). - Franklin T. Adams-Watters, May 02 2014
U(n,k) is also equal to the number of ways to express 0 as a sum of k elements in Z/nZ. - Jens Voß, Franklin T. Adams-Watters, N. J. A. Sloane, Apr 30 2014 - May 05 2014. See link ("A Note on Modular Partitions and Necklaces") for proof.
The generating function for column k is given by the substitution x_j -> x^j/(1-x^j) in the cycle index of the Symmetric Group of order k. - R. J. Mathar, Nov 15 2018
From Petros Hadjicostas, Jul 12 2019: (Start)
Regarding the comments above by Voss, Adams-Watters, and Sloane, note that Fredman (1975) proved that the number S(n, k, v) of vectors (a_0, ..., a_{n-1}) of nonnegative integer components that satisfy a_0 + ... + a_{n-1} = k and Sum_{i=0..n-1} i*a_i = v (mod n) is given by S(n, k, v) = (1/(n + k)) * Sum_{d | gcd(n, k)} A054535(d, v) * binomial((n + k)/d, k/d) = S(k, n, v).
This result was also proved by Elashvili et al. (1999), who also proved that S(n, k, v) = Sum_{d | gcd(n, k, v)} S(n/d, k/d, 1). Here, S(n, k, 0) = A241926(n, k) = U(n, k) = T(n + k, k) (where T(n, k) is the current array). Also, S(n, k, 1) = A245558(n, k). See also Panyushev (2011) for more general results and for generating functions.
Finally, note that A054535(d, v) = c_d(v) = Sum_{s | gcd(d,v)} s*Moebius(d/s). These are the Ramanujan sums, which equal also the von Sterneck function c_d(v) = phi(d) * Moebius(d/gcd(d, v))/phi(d/gcd(d, v)). We have A054535(d, v) = A054534(v, d).
It would be interesting to see whether there is a proof of the results by Fredman (1975), Elashvili et al. (1999), and Panyushev (2011) for a general v using Molien series as it is done by Sloane (2014) for the case v = 0 (in which case, A054535(d, 0) = phi(d)). (Even though the columns of array A054535(d, v) start at v = 1, we may start the array at column v = 0 as well.)
(End)
U(n, k) is the number of equivalence classes of k-tuples of residues modulo n, identifying those that differ componentwise by a constant and those that differ by a permutation. - Álvar Ibeas, Sep 21 2021

Examples

			Triangle starts:
[ 0]  1,
[ 1]  1,  1,
[ 2]  1,  1,  1,
[ 3]  1,  1,  1,  1,
[ 4]  1,  1,  2,  1,  1,
[ 5]  1,  1,  2,  2,  1,  1,
[ 6]  1,  1,  3,  4,  3,  1,  1,
[ 7]  1,  1,  3,  5,  5,  3,  1,  1,
[ 8]  1,  1,  4,  7, 10,  7,  4,  1,  1,
[ 9]  1,  1,  4, 10, 14, 14, 10,  4,  1,  1,
[10]  1,  1,  5, 12, 22, 26, 22, 12,  5,  1, 1,
[11]  1,  1,  5, 15, 30, 42, 42, 30, 15,  5, 1, 1,
[12]  1,  1,  6, 19, 43, 66, 80, 66, 43, 19, 6, 1, 1, ...
		

References

  • N. G. de Bruijn, Polya's theory of counting, in: Applied Combinatorial Mathematics (E. F. Beckenbach, ed.), John Wiley and Sons, New York, 1964, pp. 144-184 (implies g.f. for this triangle).
  • Richard Stanley, Enumerative Combinatorics, 2nd. ed., Vol 1, Chapter I, Problem 105, pp. 122 and 168, discusses the number of subsets of Z/nZ that add to 0. - N. J. A. Sloane, May 06 2014
  • J. Voß, Posting to Sequence Fans Mailing List, April 30, 2014.
  • H. S. Wilf, personal communication to N. J. A. Sloane, Nov., 1990.
  • See A000031 for many additional references and links.

Crossrefs

Row sums: A000031. Columns 0-12: A000012, A000012, A004526, A007997(n+5), A008610, A008646, A032191-A032197.
See A037306 and A241926 for essentially identical triangles.
See A245558, A245559 for a closely related array.

Programs

  • Maple
    A047996 := proc(n,k) local C,d; if k= 0 then return 1; end if; C := 0 ; for d in numtheory[divisors](igcd(n,k)) do C := C+numtheory[phi](d)*binomial(n/d,k/d) ; end do: C/n ; end proc:
    seq(seq(A047996(n,k),k=0..n),n=0..10) ; # R. J. Mathar, Apr 14 2011
  • Mathematica
    t[n_, k_] := Total[EulerPhi[#]*Binomial[n/#, k/#] & /@ Divisors[GCD[n, k]]]/n; t[0, 0] = 1; Flatten[Table[t[n, k], {n, 0, 13}, {k, 0, n}]] (* Jean-François Alcover, Jul 19 2011, after given formula *)
  • PARI
    p(n) = if(n<=0, n==0, 1/n * sum(i=0,n-1, (x^(n/gcd(i,n))+1)^gcd(i,n) ));
    for (n=0,17, print(Vec(p(n)))); /* print triangle */
    /* Joerg Arndt, Sep 28 2012 */
    
  • PARI
    T(n,k) = if(n<=0, n==0, 1/n * sumdiv(gcd(n,k), d, eulerphi(d)*binomial(n/d,k/d) ) );
    /* print triangle: */
    { for (n=0, 17, for (k=0, n, print1(T(n,k),", "); ); print(); ); }
    /* Joerg Arndt, Oct 21 2012 */

Formula

T(n, k) = (1/n) * Sum_{d | (n, k)} phi(d)*binomial(n/d, k/d).
T(2*n,n) = A003239(n); T(2*n+1,n) = A000108(n). - Philippe Deléham, Jul 25 2006
G.f. for row n (n>=1): (1/n) * Sum_{i=0..n-1} ( x^(n/gcd(i,n)) + 1 )^gcd(i,n). - Joerg Arndt, Sep 28 2012
G.f.: Sum_{n, k >= 0} T(n, k)*x^n*y^k = 1 - Sum_{s>=1} (phi(s)/s)*log(1-x^s*(1+y^s)). - Petros Hadjicostas, Oct 26 2017
Product_{d >= 1} (1 - x^d - y^d) = Product_{i,j >= 0} (1 - x^i*y^j)^T(i+j, j), where not both i and j are zero. (It follows from Somos' infinite product for array A051168.) - Petros Hadjicostas, Jul 12 2019

Extensions

Name edited by Petros Hadjicostas, Nov 16 2017

A054533 Triangular array giving Ramanujan sum T(n,k) = c_n(k) = Sum_{m=1..n, (m,n)=1} exp(2 Pi i m k / n) for n >= 1 and 1 <= k <= n.

Original entry on oeis.org

1, -1, 1, -1, -1, 2, 0, -2, 0, 2, -1, -1, -1, -1, 4, 1, -1, -2, -1, 1, 2, -1, -1, -1, -1, -1, -1, 6, 0, 0, 0, -4, 0, 0, 0, 4, 0, 0, -3, 0, 0, -3, 0, 0, 6, 1, -1, 1, -1, -4, -1, 1, -1, 1, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 0, 2, 0, -2, 0, -4, 0, -2, 0, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 1
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

From Wolfdieter Lang, Jan 06 2017: (Start)
Periodicity: c_n(k+n) = c_n(k). See the Apostol reference p. 161.
Multiplicativity: c_n(k)*c_m(k) = c_{n*m}(k), if gcd(n,m) = 1. For the proof see the Hardy reference, p. 138.
Dirichlet g.f. for fixed k: D(n,s) := Sum_{n>=1} c_n(k)/n^s = sigma_{1-s}(k)/zeta(s) = sigma_{s-1}(k)/(k^(s-1)*zeta(s)) for s > 1, with sigma_m(k) the sum of the m-th power of the divisors of k. See the Hardy reference, eqs. (9.6.1) and (9.6.2), pp. 139-140, or Hardy-Wright, Theorem 292, p. 250.
Sum_{n>=1} c_n(k)/n = 0. See the Hardy reference, p. 141. (End)
Right border gives A000010. - Omar E. Pol, May 08 2018
Fredman (1975) proved that the number S(n, k, v) of vectors (a_0, ..., a_{n-1}) of nonnegative integer components that satisfy a_0 + ... + a_{n-1} = k and Sum_{i=0..n-1} i*a_i = v (mod n) is given by S(n, k, v) = (1/(n + k)) * Sum_{d | gcd(n, k)} T(d, v) * binomial((n + k)/d, k/d) = S(k, n, v). This was also proved by Elashvili et al. (1999), who also proved that S(n, k, v) = Sum_{d | gcd(n, k, v)} S(n/d, k/d, 1). Here, S(n, k, 1) = A051168(n + k, k). - Petros Hadjicostas, Jul 09 2019
We have T(n, k) = c_n(k) = Sum_{m=1..n, (m,n)=1} exp(2 Pi i m k / n) and A054532(n, k) = c_k(n) = Sum_{m=1..k, (m,k)=1} exp(2 Pi i m n / k) for n >= 1 and 1 <= k <= n. - Petros Hadjicostas, Jul 27 2019

Examples

			Triangle begins
   1;
  -1,  1;
  -1, -1,  2;
   0, -2,  0,  2;
  -1, -1, -1, -1,  4;
   1, -1, -2, -1,  1,  2;
  -1, -1, -1, -1, -1, -1,  6;
   0,  0,  0, -4,  0,  0,  0,  4;
   0,  0, -3,  0,  0, -3,  0,  0,  6;
   1, -1,  1, -1, -4, -1,  1, -1,  1,  4;
  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10;
   0,  2,  0, -2,  0, -4,  0, -2,  0,  2,  0,  4;
  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12;
   ...
[Edited by _Jon E. Schoenfield_, Jan 03 2017]
Periodicity and multiplicativity: c_6(k) = c_2(k)*c_3(k), e.g.: 2 = c_6(6) = c_2(6)*c_3(6) = c_2(2)*c_3(3) = 1*2 = 2. - _Wolfdieter Lang_, Jan 05 2017
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, pp. 160-161.
  • G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, AMS Chelsea Publishing, Providence, Rhode Island, 2002, pp. 137-139.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. Fifth ed., Oxford Science Publications, Clarendon Press, Oxford, 2003, pp. 237-238.

Crossrefs

Programs

  • Mathematica
    c[k_, n_] := Sum[ If[GCD[m, k] == 1, Exp[2 Pi*I*m*n/k], 0], {m, 1, k}]; A054533 = Flatten[ Table[c[n, k] // FullSimplify, {n, 1, 14}, {k, 1, n}] ] (* Jean-François Alcover, Jun 27 2012 *)
    (* to get the triangle in the example above *)
    FormTable[Table[c[n, k] // FullSimplify, {n, 1, 13}, {k, 1, n}]]
    (* Petros Hadjicostas, Jul 28 2019 *)
  • PARI
    T(n,k) = sumdiv(gcd(n,k), d, d*moebius(n/d));
    tabl(nn) = {for(n=1, nn, for(k=1, n, print1(T(n,k), ", "); ); print(); ); }; \\ Michel Marcus, Jun 14 2018

Formula

T(n, k) = Sum_{m=1..n, gcd(m,n) = 1} exp(2*Pi*i*m*k / n), n >= 1, 1 <= k <= n, where i is the imaginary unit.
T(n, k) = Sum_{d | gcd(n,k)} d*Moebius(n/d), n >= 1, 1 <= k <= n.

Extensions

Name edited by Petros Hadjicostas, Jul 27 2019

A054535 Square array giving Ramanujan sum T(n,k) = c_n(k) = Sum_{m=1..n, (m,n)=1} exp(2 Pi i m k / n), read by antidiagonals upwards (n >= 1, k >= 1).

Original entry on oeis.org

1, -1, 1, -1, 1, 1, 0, -1, -1, 1, -1, -2, 2, 1, 1, 1, -1, 0, -1, -1, 1, -1, -1, -1, 2, -1, 1, 1, 0, -1, -2, -1, 0, 2, -1, 1, 0, 0, -1, -1, 4, -2, -1, 1, 1, 1, 0, 0, -1, 1, -1, 0, -1, -1, 1, -1, -1, -3, -4, -1, 2, -1, 2, 2, 1, 1, 0, -1, 1, 0, 0, -1, 1, -1, 0, -1, -1, 1, -1, 2, -1, -1, 0, 0, 6, -1, -1, -2, -1, 1, 1, 1, -1
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

Replace the first column in A077049 with any k-th column in A177121 to get a new array. Then the matrix inverse of the new array will have the k-th column of A054535 (this array) as its first column. - Mats Granvik, May 03 2010
We have T(n, k) = c_n(k) = Sum_{m=1..n, (m,n)=1} exp(2 Pi i m k / n) and
A054534(n, k) = c_k(n) = Sum_{m=1..k, (m,k)=1} exp(2 Pi i m n / k). That is, the current array is the transpose of array A054534. Dirichlet g.f.'s for these two arrays are given below by R. J. Mathar and Mats Granvik. - Petros Hadjicostas, Jul 27 2019

Examples

			Square array T(n,k) = c_n(k) (with rows n >= 1 and columns k >= 1) starts as follows:
   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
  -1,  1, -1,  1, -1,  1, -1,  1, -1,  1, -1,  1, -1, ...
  -1, -1,  2, -1, -1,  2, -1, -1,  2, -1, -1,  2, -1, ...
   0, -2,  0,  2,  0, -2,  0,  2,  0, -2,  0,  2,  0, ...
  -1, -1, -1, -1,  4, -1, -1, -1, -1,  4, -1, -1, -1, ...
   1, -1, -2, -1,  1,  2,  1, -1, -2, -1,  1,  2,  1, ...
  -1, -1, -1, -1, -1, -1,  6, -1, -1, -1, -1, -1, -1, ...
   0,  0,  0, -4,  0,  0,  0,  4,  0,  0,  0, -4,  0, ...
   ... [example edited by _Petros Hadjicostas_, Jul 27 2019]
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, page 160.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. Fifth ed., Oxford Science Publications, Clarendon Press, Oxford, 2003.
  • E. C. Titchmarsh and D. R. Heath-Brown, The theory of the Riemann zeta-function, 2nd ed., 1986.

Crossrefs

Transpose of array in A054534. Cf. A054532, A054533, A282634.
Cf. A086831=c_n(2) (2nd column), A085097=c_n(3) (3rd column), A085384=c_n(4) (4th column), A085639=c_n(5) (fifth column), A085906=c_n(6) (sixth column), A099837=c_3(n) (third row), A176742=c_4(n) (fourth row), A100051=c_6(n) (sixth row).

Programs

  • Maple
    with(numtheory): c:=(n,k)->phi(n)*mobius(n/gcd(n,k))/phi(n/gcd(n,k)): for n from 1 to 13 do seq(c(n+1-j,j),j=1..n) od; # gives the sequence in triangular form # Emeric Deutsch
    # to get the example above
    for n to 8 do
        seq(c(n, k), k = 1 .. 13);
    end do
    # Petros Hadjicostas, Jul 27 2019
  • Mathematica
    nmax = 14; t[n_, k_] := EulerPhi[n]*(MoebiusMu[n / GCD[n, k]] / EulerPhi[n / GCD[n, k]]); Flatten[ Table[t[n - k + 1, k], {n, 1, nmax}, {k, 1, n}]] (* Jean-François Alcover, Nov 10 2011, after Emeric Deutsch *)
    (* To get the example above in table format *)
    TableForm[Table[t[n, k], {n, 1, 8}, {k, 1, 13}]]
    (* Petros Hadjicostas, Jul 27 2019 *)

Formula

T(n,k) = c_n(k) = phi(n) * Moebius(n/gcd(n, k))/phi(n/gcd(n, k)). - Emeric Deutsch, Dec 23 2004 [The r.h.s. of this formula is known as the von Sterneck function, and it was introduced by him around 1900. - Petros Hadjicostas, Jul 20 2019]
Dirichlet series: Sum_{n>=1} c_n(k)/n^s = sigma_{1-s}(k)/zeta(s) where sigma is the sum-of-divisors function. Sum_{n>=1} c_k(n)/n^s = zeta(s)*Sum_{d|k} mu(k/d)*d^(1-s). [Hardy & Wright, Titchmarsh] - R. J. Mathar, Apr 01 2012 [We have sigma_{1-s}(k) = Sum_{d|k} d^{1-s} = Sum_{d|k} (k/d)^{1-s} = sigma_{s-1}(k) / k^{s-1}. - Petros Hadjicostas, Jul 27 2019]
From Mats Granvik, Oct 10 2016: (Start)
For n >= 1 and k >= 1 let
A(n,k) := if n mod k = 0 then k^r, otherwise 0;
B(n,k) := if n mod k = 0 then k/n^s, otherwise 0.
Then the Ramanujan's sum matrix equals
inverse(A).transpose(B) evaluated at s=0 and r=0.
Equals inverse(A051731).transpose(A127093).
Dirichlet g.f.: Sum_{n>=1} Sum_{k>=1} T(n,k)/(n^r*k^s) = zeta(s)*zeta(s + r - 1)/zeta(r) as in Wikipedia. (End)
T(n,k) = c_n(k) = Sum_{s | gcd(n,k)} s * Moebius(n/s). - Petros Hadjicostas, Jul 27 2019
Lambert series and a consequence: Sum_{n >= 1} c_n(k) * z^n / (1 - z^n) = Sum_{s|k} s * z^s and -Sum_{n >= 1} (c_n(k) / n) * log(1 - z^n) = Sum_{s|k} z^s for |z| < 1 (using the principal value of the logarithm). - Petros Hadjicostas, Aug 15 2019

Extensions

Name edited by Petros Hadjicostas, Jul 27 2019

A054532 Ramanujan sum T(n, k) = c_k(n) = Sum_{m=1..k, (m,k)=1} exp(2*Pi*i*m*n / k), triangular array read by rows for n >= 1 and 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, -1, 2, 1, 1, -1, 2, 1, -1, -1, 0, 4, 1, 1, 2, -2, -1, 2, 1, -1, -1, 0, -1, 1, 6, 1, 1, -1, 2, -1, -1, -1, 4, 1, -1, 2, 0, -1, -2, -1, 0, 6, 1, 1, -1, -2, 4, -1, -1, 0, 0, 4, 1, -1, -1, 0, -1, 1, -1, 0, 0, 1, 10, 1, 1, 2, 2, -1, 2, -1, -4, -3, -1, -1, 4, 1, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, 12, 1
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

T(n, k) = c_k(n) = sum of the n-th powers of the k-th primitive roots of unity. - Petros Hadjicostas, Jul 27 2019

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:
  1;
  1,  1;
  1, -1,  2;
  1,  1, -1,  2;
  1, -1, -1,  0,  4;
  1,  1,  2, -2, -1,  2;
  1, -1, -1,  0, -1,  1,  6;
  1,  1, -1,  2, -1, -1, -1, 4;
  1, -1,  2,  0, -1, -2, -1, 0, 6;
  ...
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, page 160.

Crossrefs

Programs

  • Mathematica
    t[n_, k_] := Sum[ c = Exp[2*Pi*I*m*(n/k)]; If[ GCD[m, k] == 1, c, 0], {m, 1, k}] // FullSimplify; Flatten[ Table[ t[n, k], {n, 1, 15}, {k, 1, n}]] (* Jean-François Alcover, Mar 15 2012 *)
    (* to get the triangle in the example *)
    TableForm[Table[t[n, k], {n, 1, 9}, {k, 1, n}]]
    (* Petros Hadjicostas, Jul 27 2019 *)

Formula

T(n, k) = c_k(n) = Sum_{m=1..k, (m,k)=1} cos(2*Pi*m*n / k) = mu(k/gcd(k,n)) * phi(k) / phi(k/gcd(k,n)) = Sum_{d | gcd(k,n)} mu(k/d) * d. (All formulas were proved by Kluyver (1906, p. 410).) - Petros Hadjicostas, Aug 20 2019

A086831 Ramanujan sum c_n(2).

Original entry on oeis.org

1, 1, -1, -2, -1, -1, -1, 0, 0, -1, -1, 2, -1, -1, 1, 0, -1, 0, -1, 2, 1, -1, -1, 0, 0, -1, 0, 2, -1, 1, -1, 0, 1, -1, 1, 0, -1, -1, 1, 0, -1, 1, -1, 2, 0, -1, -1, 0, 0, 0, 1, 2, -1, 0, 1, 0, 1, -1, -1, -2, -1, -1, 0, 0, 1, 1, -1, 2, 1, 1, -1, 0, -1, -1, 0, 2, 1, 1, -1, 0, 0, -1, -1, -2, 1, -1, 1, 0, -1, 0, 1, 2, 1, -1, 1, 0, -1, 0, 0, 0, -1, 1, -1, 0, -1
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 07 2003

Keywords

Comments

Mobius transform of 1,2,0,0,0,0,... (A130779). - R. J. Mathar, Mar 24 2012

Examples

			a(4) = -2 because the primitive fourth roots of unity are i and -i.  We sum their squares to get i^2 + (-i)^2 = -1 + -1 = -2. - _Geoffrey Critzer_, Dec 30 2015
		

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976.
  • E. C. Titchmarsh and D. R. Heath-Brown, The theory of the Riemann zeta-function, 2nd edn., 1986.

Crossrefs

Cf. A085097, A085384, A085639, A085906 for Ramanujan sums c_n(3), c_n(4), c_n(5), c_n(6).

Programs

  • Maple
    with(numtheory):a:=n->phi(n)*mobius(n/gcd(n,2))/phi(n/gcd(n,2)): seq(a(n),n=1..130); # Emeric Deutsch, Dec 23 2004
  • Mathematica
    f[list_, i_] := list[[i]]; nn = 105; a = Table[MoebiusMu[n], {n, 1, nn}]; b =Table[If[IntegerQ[2/n], n, 0], {n, 1,nn}];Table[DirichletConvolve[f[a, n], f[b, n], n, m], {m, 1, nn}] (* Geoffrey Critzer, Dec 30 2015 *)
    f[p_, e_] := If[e == 1, -1, 0]; f[2, e_] := Switch[e, 1, 1, 2, -2, , 0]; a[1] = 1; a[n] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 21 2024 *)
  • PARI
    A086831(n) = (eulerphi(n)*moebius(n/gcd(n, 2))/eulerphi(n/gcd(n, 2))); \\ Antti Karttunen, Sep 27 2018

Formula

For a general k >= 1, c_n(k) = phi(n)*mu(n/gcd(n, k)) / phi(n/gcd(n, k)); so c_n(1) = mu(n) = A008683(n).
a(n) = phi(n)*mu(n/gcd(n, 2)) / phi(n/gcd(n, 2)).
Dirichlet g.f.: (1+2^(1-s))/zeta(s). [Titchmarsh eq. (1.5.4)] - R. J. Mathar, Mar 26 2011
Multiplicative with a(2) = 1, a(2^2) = -2, and a(2^e) = 0 for e >= 3, and for an odd prime p, a(p) = -1 and a(p^e) = 0 for e >= 2. - Amiram Eldar, Sep 14 2023
Sum_{k=1..n} abs(a(k)) ~ (8/Pi^2) * n. - Amiram Eldar, Jan 21 2024

Extensions

Corrected and extended by Emeric Deutsch, Dec 23 2004

A085384 Ramanujan sum c_n(4).

Original entry on oeis.org

1, 1, -1, 2, -1, -1, -1, -4, 0, -1, -1, -2, -1, -1, 1, 0, -1, 0, -1, -2, 1, -1, -1, 4, 0, -1, 0, -2, -1, 1, -1, 0, 1, -1, 1, 0, -1, -1, 1, 4, -1, 1, -1, -2, 0, -1, -1, 0, 0, 0, 1, -2, -1, 0, 1, 4, 1, -1, -1, 2, -1, -1, 0, 0, 1, 1, -1, -2, 1, 1, -1, 0, -1, -1, 0, -2, 1, 1, -1, 0, 0, -1, -1, 2
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 12 2003

Keywords

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976.
  • E. C. Titchmarsh and D. R. Heath-Brown, The Theory of the Riemann Zeta-function, 2nd ed., 1986.
  • R. D. von Sterneck, Ein Analogon zur additiven Zahlentheorie, Sitzungsber. Acad. Wiss. Sapientiae Math.-Naturwiss. Kl. 111 (1902), 1567-1601 (Abt. IIa).

Crossrefs

Programs

  • Mathematica
    a[n_] := EulerPhi[n] * MoebiusMu[n/GCD[n, 4]] / EulerPhi[n/GCD[n, 4]]; Table[ a[n], {n, 1, 105}]
    f[p_, e_] := If[e == 1, -1, 0]; f[2, e_] := Switch[e, 1, 1, 2, 2, 3, -4, , 0]; a[1] = 1; a[n] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 21 2024 *)
  • PARI
    a(n)=eulerphi(n)*moebius(n/gcd(n,4))/eulerphi(n/gcd(n,4))

Formula

a(n) = phi(n)*mu(n/gcd(n, 4)) / phi(n/gcd(n, 4)).
Dirichlet g.f.: (1+2^(1-s)+4^(1-s))/zeta(s). [Titchmarsh] - R. J. Mathar, Mar 26 2011
Lambert series and a consequence: Sum_{n >= 1} c_n(4) * z^n / (1 - z^n) = Sum_{s|4} s * z^s and -Sum_{n >= 1} (c_n(4) / n) * log(1 - z^n) = Sum_{s|4} z^s for |z| < 1 (using the principal value of the logarithm). - Petros Hadjicostas, Aug 24 2019
From Amiram Eldar, Jan 21 2024: (Start)
Multiplicative with a(2) = 1, a(2^2) = 2, a(2^3) = -4, and a(2^e) = 0 for e >= 4, and for an odd prime p, a(p) = -1, and a(p^e) = 0 for e >= 2.
Sum_{k=1..n} abs(a(k)) ~ (10/Pi^2) * n. (End)

Extensions

More terms from Robert G. Wilson v and Benoit Cloitre, Aug 17 2003

A085639 Ramanujan sum c_n(5).

Original entry on oeis.org

1, -1, -1, 0, 4, 1, -1, 0, 0, -4, -1, 0, -1, 1, -4, 0, -1, 0, -1, 0, 1, 1, -1, 0, -5, 1, 0, 0, -1, 4, -1, 0, 1, 1, -4, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 5, 1, 0, -1, 0, -4, 0, 1, 1, -1, 0, -1, 1, 0, 0, -4, -1, -1, 0, 1, 4, -1, 0, -1, 1, 5, 0, 1, -1, -1, 0, 0, 1, -1, 0, -4, 1, 1, 0, -1
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 15 2003

Keywords

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976.

Crossrefs

Programs

  • Mathematica
    a[n_] := EulerPhi[n] * MoebiusMu[n/GCD[n, 5]] / EulerPhi[n/GCD[n, 5]]; Table[ a[n], {n, 1, 105}]
    f[p_, e_] := If[e == 1, -1, 0]; f[5, e_] := Switch[e, 1, 4, 2, -5, , 0]; a[1] = 1; a[n] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 21 2024 *)
  • PARI
    a(n)=eulerphi(n)*moebius(n/gcd(n,5))/eulerphi(n/gcd(n,5))

Formula

a(n) = phi(n)*mu(n/gcd(n, 5)) / phi(n/gcd(n, 5)).
Dirichlet g.f.: (1+5^(1-s))/zeta(s). - R. J. Mathar, Mar 26 2011
Lambert series and a consequence: Sum_{n >= 1} c_n(5) * z^n / (1 - z^n) = z + 5*z^5 and -Sum_{n >= 1} (c_n(5) / n) * log(1 - z^n) = z + z^5 for |z| < 1 (using the principal value of the logarithm). - Petros Hadjicostas, Aug 24 2019
From Amiram Eldar, Jan 21 2024: (Start)
Multiplicative with a(5) = 4, a(5^2) = -5, and a(5^e) = 0 for e >= 3, and for a prime p != 5, a(p) = -1, and a(p^e) = 0 for e >= 2.
Sum_{k=1..n} abs(a(k)) ~ (10/Pi^2) * n. (End)

Extensions

More terms from Robert G. Wilson v and Benoit Cloitre, Aug 17 2003

A282634 Recursive 2-parameter sequence allowing the Ramanujan's sum calculation.

Original entry on oeis.org

1, 1, -1, 2, -1, -1, 2, 0, -2, 0, 4, -1, -1, -1, -1, 2, 1, -1, -2, -1, 1, 6, -1, -1, -1, -1, -1, -1, 4, 0, 0, 0, -4, 0, 0, 0, 6, 0, 0, -3, 0, 0, -3, 0, 0, 4, 1, -1, 1, -1, -4, -1, 1, -1, 1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 0, 2, 0, -2, 0, -4, 0
Offset: 1

Views

Author

Gevorg Hmayakyan, Feb 20 2017

Keywords

Comments

a(n,0) = phi(n), where phi(n) is Euler's totient function A000010(n).
a(n,1) = mu(n), where mu(n) is the Möbius function A008683(n).

Examples

			The few first rows follow:            c_n(t)
  t   0   1   2   3   4   5   6     |  t   1   2   3   4   5   6   7
n                                   |n
1     1;                            |1     1;
2     1, -1;                        |2    -1,  1;
3     2, -1, -1;                    |3    -1, -1,  2;
4     2,  0, -2,  0;                |4     0, -2,  0,  2;
5     4, -1, -1, -1, -1;            |5    -1, -1, -1, -1,  4;
6     2,  1, -1, -2, -1,  1;        |6     1, -1, -2, -1,  1,  2;
7     6, -1, -1, -1, -1, -1, -1;    |7    -1, -1, -1, -1, -1, -1,  6;
      ...                           |     ...
[Edited by _Seiichi Manyama_, Mar 05 2018]
		

Crossrefs

Cf. A000010 (phi(n)), A008683 (mu(n)), A054532, A054533, A054534, A054535, A231599.

Programs

  • Mathematica
    b[n_, m_] := b[n, m] = If[n > 1, b[n - 1, m] - b[n - 1, m - n + 1], 0]
    b[1, m_] := b[1, m] = If[m == 0, 1, 0]
    nt[n_, t_] := Round[(n - 1)/2 - t/n]
    a[n_, t_] := Sum[b[n, k*n + t], {k, 0, nt[n, t]}]
    Flatten[Table[Table[a[n, m], {m, 0, n - 1}], {n, 1, 20}]]

Formula

a(n,t) = Sum(b(n, k*n + t), k=0..N(n, t)), where b(n,k) = A231599(n-1,k) and N(n,t) = [(n - 1)/2 - t/n].
a(n,t) = c_n(t) for t >= 1, where c_n(t) is a Ramanujan's sum A054533.
a(n,t) = a(n,-t)
From Seiichi Manyama, Mar 05 2018: (Start)
a(n,t) = c_n(n-t) = Sum_{d | gcd(n,n-t)} d*mu(n/d) for 0 <= t <= n-1.
So a(n,t) = Sum_{d | gcd(n,t)} d*mu(n/d) for 1 <= t <= n-1. (End)

A267632 Triangle T(n, k) read by rows: the k-th column of the n-th row lists the number of ways to select k distinct numbers (k >= 1) from [1..n] so that their sum is divisible by n.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 2, 2, 1, 1, 1, 2, 4, 3, 1, 0, 1, 3, 5, 5, 3, 1, 1, 1, 3, 7, 9, 7, 3, 1, 0, 1, 4, 10, 14, 14, 10, 4, 1, 1, 1, 4, 12, 22, 26, 20, 12, 5, 1, 0, 1, 5, 15, 30, 42, 42, 30, 15, 5, 1, 1, 1, 5, 19, 42, 66, 76, 66, 43, 19, 5, 1, 0
Offset: 1

Views

Author

Dimitri Papadopoulos, Jan 18 2016

Keywords

Comments

Row less the last element is palindrome for n=odd or n=power of 2 where n is the row number (observation-conjecture).
From Petros Hadjicostas, Jul 13 2019: (Start)
By reading carefully the proof of Lemma 5.1 (pp. 65-66) in Barnes (1959), we see that he actually proved a general result (even though he does not state it in the lemma).
According to the definition of this sequence, for 1 <= k <= n, T(n, k) is the number of unordered sets b_1, b_2, ..., b_k of k distinct integers from 1..n such that b_1 + b_2 + ... + b_k = 0 (mod n). The proof of Lemma 5.1 in Barnes (1959) implies that T(n, k) = (1/n) * Sum_{s | gcd(n, k)} (-1)^(k - (k/s)) * phi(s) * binomial(n/s, k/s) for 1 <= k <= n.
For fixed k >= 1, the g.f. of the column (T(n, k): n >= 1) (with T(n, k) = 0 for 1 <= n < k) is (x^k/k) * Sum_{s|k} phi(s) * (-1)^(k - (k/s)) / (1 - x^s)^(k/s), which generalizes Herbert Kociemba's formula from A032801.
Barnes' (1959) formula is a special case of Theorem 4 (p. 66) in Ramanathan (1944). If R(n, k, v) is the number of unordered sets b_1, b_2, ..., b_k of k distinct integers from 1..n such that b_1 + b_2 + ... + b_k = v (mod n), then he proved that R(n, k, v) = (1/n) * Sum_{s | gcd(n,k)} (-1)^(k - (k/s)) * binomial(n/s, k/s) * C_s(v), where C_s(v) = A054535(s, v) = Sum_{d | gcd(s,v)} d * Moebius(s/d) is Ramanujan's sum (even though it was first discovered around 1900 by the Austrian mathematician R. D. von Sterneck).
Because C_s(v = 0) = phi(s), we get Barnes' (implicit) result; i.e., R(n, k, v=0) = T(n, k) for 1 <= k <= n.
For k=2, we have R(n, k=2, v=0) = T(n, k=2) = A004526(n-1) for n >= 1. For k=3, we have R(n, k=3, v=0) = T(n, k=3) = A058212(n) for n >= 1. For k=4, we have R(n, k=4, v=0) = A032801(n) for n >= 1. For k=5, we have R(n, k=5, v=0) = T(n, k=5) = A008646(n-5) for n >= 5.
The reason we have T(2*m+1, k) = A037306(2*m+1, k) = A047996(2*m+1, k) for m >= 0 and k >= 1 is the following. When n = 2*m + 1, all divisors s of gcd(n, k) are odd. In such a case, k - (k/s) is even for all k >= 1, and thus (-1)^(k - (k/s)) = 1, and thus T(n = 2*m+1, k) = (1/n) * Sum_{s | gcd(n, k)} phi(s) * binomial(n/s, k/s) = A037306(2*m+1, k) = A047996(2*m+1, k).
By summing the products of the g.f. of column k times y^k from k = 1 to k = infinity, we get the bivariate g.f. for the array: Sum_{n, k >= 1} T(n, k)*x^n*y^k = Sum_{s >= 1} (phi(s)/s) * log((1 - x^s + (-x*y)^s)/(1 - x^s)) = -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x*y)^s).
Letting y = 1 in the above bivariate g.f., we get the g.f. of the sequence (Sum_{1 <= k <= n} T(n, k): n >= 1) is -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x)^s) = -x/(1 - x) + Sum_{m >= 0} (phi(2*m + 1)/(2*m + 1)) * log(1 - 2*x^(2*m+1)), which is the g.f. of sequence A082550. Hence, sequence A082550 consists of the row sums.
There is another important interpretation of this array T(n, k) which is related to some of the references for sequence A047996, but because the discussion is too lengthy, we omit the details.
(End)

Examples

			For n = 5, there is one way to pick one number (5), two ways to pick two numbers (1+4, 2+3), two ways to pick 3 numbers (1+4+5, 2+3+5), one way to pick 4 numbers (1+2+3+4), and one way to pick 5 numbers (1+2+3+4+5) so that their sum is divisible by 5. Therefore, T(5,1) = 1, T(5,2) = 2, T(5,3) = 2, T(5,4) = 1, and T(5,5) = 1.
Table for T(n,k) begins as follows:
n\k 1 2   3    4    5    6    7    8    9   10
1   1
2   1 0
3   1 1   1
4   1 1   1    0
5   1 2   2    1    1
6   1 2   4    3    1    0
7   1 3   5    5    3    1    1
8   1 3   7    9    7    3    1    0
9   1 4  10   14   14   10    4    1    1
10  1 4  12   22   26   20   12    5    1    0
...
		

Crossrefs

Programs

  • Maple
    A267632 := proc(n,k)
        local a,msel,p;
        a := 0 ;
        for msel in combinat[choose](n,k) do
            if modp(add(p,p=msel),n) = 0 then
                a := a+1 ;
            end if;
        end do:
        a;
    end proc: # R. J. Mathar, May 15 2016
    # second Maple program:
    b:= proc(n, m, s) option remember; expand(`if`(n=0,
          `if`(s=0, 1, 0), b(n-1, m, s)+x*b(n-1, m, irem(s+n, m))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n$2, 0)):
    seq(T(n), n=1..14);  # Alois P. Heinz, Aug 27 2018
  • Mathematica
    f[k_, n_] :=  Length[Select[Select[Subsets[Range[n]], Length[#] == k &], IntegerQ[Total[#]/n] &]];MatrixForm[Table[{n, Table[f[k, n], {k, n}]}, {n, 10}]] (* Dimitri Papadopoulos, Jan 18 2016 *)

Formula

T(2n+1, k) = A037306(2n+1, k) = A047996(2n+1, k).
From Petros Hadjicostas, Jul 13 2019: (Start)
T(n, k) = (1/n) * Sum_{s | gcd(n, k)} (-1)^(k - (k/s)) * phi(s) * binomial(n/s, k/s) for 1 <= k <= n.
G.f. for column k >= 1: (x^k/k) * Sum_{s|k} phi(s) * (-1)^(k - (k/s)) / (1 - x^s)^(k/s).
Bivariate g.f.: Sum_{n, k >= 1} T(n, k)*x^n*y^k = -x/(1 - x) - Sum_{s >= 1} (phi(s)/s) * log(1 - x^s + (-x*y)^s).
(End)
Sum_{k=1..n} k * T(n,k) = A309122(n). - Alois P. Heinz, Jul 13 2019

A127332 A126988 * A002321.

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 5, 4, 4, 5, 9, 1, 10, 8, 3, 7, 15, 3, 16, 2, 6, 17, 21, -6, 13, 19, 11, 8, 27, -5, 27, 10, 13, 28, 10, -10, 35, 31, 17, -6, 40, -3, 40, 20, -4, 40, 44, -18, 32, 18, 26, 23, 50, 4, 21, 0, 28, 54, 58, -45, 59, 53, 3, 19, 24, 11, 65, 37, 39, 1
Offset: 1

Views

Author

Gary W. Adamson, Jan 10 2007

Keywords

Examples

			a(6) = 3 = 6*1 + 3*0 + 2*(-1) + 0*(-1) + 0*(-2) + 1*(-1), where (6, 3, 2, 0, 0, 1) = row 6 of A126988.
		

Crossrefs

Programs

  • Mathematica
    Block[{nn = 70, m}, m = Table[Sum[MoebiusMu@k, {k, n}], {n, nn}]; Table[Total@ Array[m[[#]] If[Mod[n, #] == 0, n/#, 0] &, n], {n, nn}]] (* Michael De Vlieger, Jun 14 2018 *)
  • PARI
    lista(nn) = {mat = matrix(nn, nn, n, k, if (n % k, 0, n/k)); vec = matrix(nn, 1, n, k, if (k==1, mertens(n), 0)); res = (mat*vec); for (n = 1, nn, print1(res[n, 1], ", "););} \\ Michel Marcus, Sep 25 2013
    
  • PARI
    a(n) = sum(k=1, n, moebius(k / gcd(n, k)) * eulerphi(k) / eulerphi(k / gcd(n, k))); \\ Daniel Suteu, Jun 23 2018

Formula

M * V where M = A126988 as an infinite lower triangular matrix and V = the Mertens sequence, A002321 as a vector: [1, 0, -1, -1, -2, -1, ...].
a(n) = Sum_{q=1..n} c_q(n), where c_q(n) is the Ramanujan's sum function given in A054533. - Daniel Suteu, Jun 14 2018

Extensions

Corrected and extended by Michel Marcus, Sep 25 2013
Showing 1-10 of 14 results. Next