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

A062570 a(n) = phi(2*n).

Original entry on oeis.org

1, 2, 2, 4, 4, 4, 6, 8, 6, 8, 10, 8, 12, 12, 8, 16, 16, 12, 18, 16, 12, 20, 22, 16, 20, 24, 18, 24, 28, 16, 30, 32, 20, 32, 24, 24, 36, 36, 24, 32, 40, 24, 42, 40, 24, 44, 46, 32, 42, 40, 32, 48, 52, 36, 40, 48, 36, 56, 58, 32, 60, 60, 36, 64, 48, 40, 66, 64, 44, 48, 70, 48, 72
Offset: 1

Views

Author

Jason Earls, Jul 03 2001

Keywords

Comments

a(n) is also the number of non-congruent solutions to x^2 - y^2 == 1 (mod n). - Yuval Dekel (dekelyuval(AT)hotmail.com), Sep 21 2003
a(n) is the size of a square companion matrix of the minimal cyclotomic polynomial of (-1)^(1/n). - Eric Desbiaux, Dec 08 2015
a(n) is the degree of the (2n)-th cyclotomic field Q(zeta_(2n)). Note that Q(zeta_n) = Q(zeta_(2n)) for odd n. - Jianing Song, May 17 2021
The number of integers k from 1 to n such that gcd(n,k) is a power of 2. - Amiram Eldar, May 18 2025

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 28.

Crossrefs

Column 1 of A129559, column 2 of A372673.
Row 1 of A379010.
Row sums of A129558 and of A129564.

Programs

  • Maple
    [phi(2*n)$n=1..80]; # Muniru A Asiru, Mar 18 2019
  • Mathematica
    Table[EulerPhi[2 n], {n, 80}] (* Vincenzo Librandi, Aug 23 2013 *)
  • PARI
    a(n) = eulerphi(2*n)
    
  • Python
    from sympy import totient
    def A062570(n): return totient(n) if n&1 else totient(n)<<1 # Chai Wah Wu, Aug 04 2024
  • Sage
    [euler_phi(2*n) for n in range(1,74)] # Zerinvary Lajos, Jun 06 2009
    

Formula

a(n) = Sum_{d|n and d is odd} n/d*mu(d).
Multiplicative with a(2^e) = 2^e and a(p^e) = p^e-p^(e-1), p>2.
Dirichlet g.f.: zeta(s-1)/zeta(s)*2^s/(2^s-1). - Ralf Stephan, Jun 17 2007
a(n) = A000010(2*n).
a(n) = phi(n)*(1+((n+1) mod 2)). - Gary Detlefs, Jul 13 2011
a(n) = A173557(n)*b(n) where b(n) = 1, 2, 1, 4, 1, 2, 1, 8, 3, 2, 1, 4, 1, 2, ... is the multiplicative function defined by b(p^e) = p^(e-1) if p<>2 and b(2^e)=2^e. b(n) = n/A204455(n). - R. J. Mathar, Jul 02 2013
a(n) = -c_{2n}(n) where c_q(n) is Ramanujan's sum. - Michael Somos, Aug 23 2013
a(n) = A055034(2*n), for n >= 2. - Wolfdieter Lang, Nov 30 2013
O.g.f.: Sum_{n >= 1} mu(2*n-1)*x^(2*n-1)/(1 - x^(2*n-1))^2. - Peter Bala, Mar 17 2019
a(n) = A000010(4*n)/2, for n > = 1 (see Apostol, Theorem 2.5, (b), p. 28). - Wolfdieter Lang, Nov 17 2019
a(n) = n - Sum_{d|n, n/d odd, d < n} a(d). - Ilya Gutkovskiy, May 30 2020
Dirichlet convolution of A000010 and A209229. - Werner Schulte, Jan 17 2021
From Richard L. Ollerton, May 07 2021: (Start)
a(n) = Sum_{k=1..n} A209229(gcd(n,k)).
a(n) = Sum_{k=1..n} A209229(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). (End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = 4/Pi^2 = 0.405284... (A185199). - Amiram Eldar, Oct 22 2022
a(n) = A000034(n) * A000010(n). - Amiram Eldar, May 18 2025

Extensions

Corrected by Vladeta Jovovic, Dec 04 2002

A129527 a(2n) = a(n) + 2n, a(2n+1) = 2n + 1.

Original entry on oeis.org

0, 1, 3, 3, 7, 5, 9, 7, 15, 9, 15, 11, 21, 13, 21, 15, 31, 17, 27, 19, 35, 21, 33, 23, 45, 25, 39, 27, 49, 29, 45, 31, 63, 33, 51, 35, 63, 37, 57, 39, 75, 41, 63, 43, 77, 45, 69, 47, 93, 49, 75, 51, 91, 53, 81, 55, 105, 57, 87, 59, 105, 61, 93, 63, 127, 65, 99, 67
Offset: 0

Views

Author

Ralf Stephan, May 29 2007

Keywords

Comments

Sum of odd part of n and its double, fourfold, eightfold etc. <= n.
Starting with 1 = the ruler function triangle A115361 * [1, 2, 3, ...]. - Gary W. Adamson, Nov 27 2009
Starting with 1 and parsed into subsets of 1, 2, 4, 8, ... terms, sum of terms in the subsets = A006516: (1, 6, 28, 120, ...). Example: 120 = (15 + 9 + 15 + 11 + 21 + 13 + 21 + 15). - Gary W. Adamson Mar 18 2011
a(n) = Sum(even divisors of 2(n-1) not including 2(n-1) that are obtained dividing repeatedly by 2) + (greatest odd divisor of 2(n-1), including 1), for the initial case 2(1-1)=0 will be set to 0. E.g., (offset is starting with n=1) a(3) = Sum(even divisors of 2*(3-1)=2*2=4 not including 4 obtained dividing repeatedly by 2) + greatest odd divisor of 4 = (2)+(1)=3; a(4) = Sum(even divisors of 2*(4-1)=6 not including 6 obtained dividing repeatedly by 2) + greatest odd divisor of 6 = (0) + (3) = 3; a(5) = Sum(even divisors of 2*(5-1)=8 not including 8 obtained dividing repeatedly by 2) + greatest odd divisor of 8 = (4+2) + (1) = 7, etc. - David Morales Marciel, Dec 21 2015
For n >=1, a(n) is the sum of divisors d of n such that n/d is a power of 2. - Amiram Eldar, Nov 17 2022

Crossrefs

Row sums of A129265 and A129559.

Programs

  • Maple
    f:= proc(n) option remember;
      if n::odd then n else n + procname(n/2) fi
    end proc:
    f(0):= 0:
    seq(f(n),n=0..100); # Robert Israel, Dec 20 2015
  • Mathematica
    a[n_] := a[n] = If[EvenQ@ n, a[n/2] + n, n]; {0}~Join~Array[a, 67] (* Michael De Vlieger, Jun 26 2017 *)
  • PARI
    a(n)=if (n==0, 0, sum(k=0,valuation(n,2),n/2^k)); \\ corrected by Michel Marcus, Dec 22 2021
    
  • PARI
    a(n)=if(n<2,return(n)); my(k=valuation(n,2)); 2*n-n>>k \\ Charles R Greathouse IV, Feb 09 2016
    
  • PARI
    a(n)=sumdiv(n, d, eulerphi(2*d)) \\ Andrew Howroyd, Aug 07 2018

Formula

G.f.: Sum_{k>=0} x^(2^k)/(1-x^(2^k))^2.
Dirichlet g.f.: zeta(s-1)*2^s/(2^s-1). - Ralf Stephan, Jun 17 2007
G.f. satisfies g(x) = g(x^2) + x/(1-x)^2. - Robert Israel, Dec 20 2015
n <= a(n) <= 2n - 1 for n > 0. - Charles R Greathouse IV, Feb 09 2016
Conjecture: a(n) = 2*n-A000265(n) for n > 0. - Velin Yanev, Jun 23 2017. [Joerg Arndt, Jun 23 2017: For odd n the conjecture holds, for even n induction should work.
Andrey Zabolotskiy, Aug 03 2017: Confirm: induction works, the conjecture holds for all n.]
a(n) for n > 0 is multiplicative with a(2^e) = 2^(e+1)-1 and a(p^e) = p^e for prime p > 2 and e >= 0. - Werner Schulte, Jul 02 2018
Inverse Moebius transform of A062570. - Andrew Howroyd, Aug 07 2018
Sum_{k=1..n} a(k) ~ 2*n^2/3. - Vaclav Kotesovec, Jun 11 2020
a(n) = A038712(n)*A000265(n), for n > 0. - Ivan N. Ianakiev, Feb 24 2025
Showing 1-2 of 2 results.