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

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

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Apr 09 2000

Keywords

Comments

The Ramanujan sum is also known as the von Sterneck arithmetic function. Robert Daublebsky von Sterneck introduced it around 1900. - Petros Hadjicostas, Jul 20 2019
T(n, k) = c_k(n) is the sum of the n-th powers of the k-th primitive roots of unity. - Petros Hadjicostas, Jul 27 2019

Examples

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

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, page 160.
  • H. Rademacher, Collected Papers of Hans Rademacher, vol. II, MIT Press, 1974, p. 435.
  • S. Ramanujan, On Certain Trigonometrical Sums and their Applications in the Theory of Numbers, pp. 179-199 of Collected Papers of Srinivasa Ramanujan, Ed. G. H. Hardy et al., AMS Chelsea Publishing 2000.
  • 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
    nmax = 14; mu[n_Integer] = MoebiusMu[n]; mu[] = 0; t[n, k_] := Total[ #*mu[k/#]& /@ Divisors[n]]; Flatten[ Table[ t[n-k+1, k], {n, 1, nmax}, {k, 1, n}]] (* Jean-François Alcover, Nov 14 2011, after Pari *)
    TableForm[Table[t[n, k], {n, 1, 7}, {k, 1, 11}]] (* to print a table like the one in the example - Petros Hadjicostas, Jul 27 2019 *)
  • PARI
    {T(n, k) = if( n<1 || k<1, 0, sumdiv( n, d, if( k%d==0, d * moebius(k / d))))} /* Michael Somos, Dec 05 2002 */
    
  • PARI
    {T(n, k) = if( n<1 || k<1, 0, polsym( polcyclo( k), n) [n + 1])} /* Michael Somos, Mar 21 2011 */
    
  • PARI
    /*To get an array like in the example above using Michael Somos' programs:*/
    {for (n=1, 20, for (k=1, 40, print1(T(n,k), ","); ); print(); ); } /* Petros Hadjicostas, Jul 27 2019 */

Formula

T(n, 1) = c_1(n) = 1. T(n, 2) = c_2(n) = A033999(n). T(n, 3) = c_3(n) = A099837(n) if n>1. T(n, 4) = c_4(n) = A176742(n) if n>1. T(n, 6) = c_6(n) = A100051(n) if n>1. - Michael Somos, Mar 21 2011
T(1, n) = c_n(1) = A008683(n). T(2, n) = c_n(2) = A086831(n). T(3, n) = c_n(3) = A085097(n). T(4, n) = c_n(4) = A085384(n). T(5, n) = c_n(5) = A085639(n). T(6, n) = c_n(6) = A085906(n). - Michael Somos, Mar 21 2011
T(n, n) = T(k * n, n) = A000010(n), T(n, 2*n) = -A062570(n). - Michael Somos, Mar 21 2011
Lambert series and a consequence: Sum_{k >= 1} c_k(n) * z^k / (1 - z^k) = Sum_{s|n} s * z^s and -Sum_{k >= 1} (c_k(n) / k) * log(1 - z^k) = Sum_{s|n} z^s for |z| < 1 (using the principal value of the logarithm). - Petros Hadjicostas, Aug 15 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

A159936 Triangle read by rows, A051731 * A054533 * transpose(A101688), provided A101688 is read as a square array.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 4, 1, 1, 2, 2, 3, 2, 1, 1, 2, 3, 4, 5, 6, 1, 1, 2, 2, 4, 4, 4, 4, 1, 1, 2, 3, 3, 3, 6, 6, 6, 1, 1, 2, 2, 4, 4, 5, 4, 5, 4, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 2, 2, 3, 2, 4, 4, 6, 6, 4, 4, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 1, 2, 2, 4, 4, 6, 6, 7, 6, 7, 6, 7, 6
Offset: 1

Views

Author

Gary W. Adamson, Apr 26 2009

Keywords

Comments

Row sums = A057661: (1, 2, 4, 6, 11, 11, 22,...). Right border = A000010, phi(n).

Examples

			First few rows of the triangle are as follows:
  1;
  1, 1;
  1, 1, 2;
  1, 1, 2, 2;
  1, 1, 2, 3, 4;
  1, 1, 2, 2, 3, 2;
  1, 1, 2, 3, 4, 5, 6;
  1, 1, 2, 2, 4, 4, 4, 4;
  1, 1, 2, 3, 3, 3, 6, 6, 6;
  1, 1, 2, 2, 4, 4, 5, 4, 5, 4;
  1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
  1, 1, 2, 2, 3, 2, 4, 4, 6, 6,  4,  4;
  1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;
  1, 1, 2, 2, 4, 4, 6, 6, 7, 6,  7,  6,  7, 6;
  1, 1, 2, 3, 3, 3, 5, 4, 3, 5,  9,  8, 10, 9, 8;
  1, 1, 2, 2, 4, 4, 4, 4, 8, 8,  8,  8,  8, 8, 8, 8;
  ...
		

Crossrefs

Formula

Triangle read by rows, A051731 * A054533 * A000012. A051731 = the inverse Mobius transform. A054533 = the lower left half of the Ramanujan sum table. The operation (* transpose(A101688)) takes partial sums of (A051731 * A054533) starting from the right. [Edited by Petros Hadjicostas, Jul 30 2019]

Extensions

Name edited by Petros Hadjicostas, Jul 30 2019
Showing 1-10 of 13 results. Next