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

A319993 a(n) = A319997(n) / A173557(n).

Original entry on oeis.org

1, -1, 1, 0, 1, -1, 1, 0, 3, -1, 1, 0, 1, -1, 1, 0, 1, -3, 1, 0, 1, -1, 1, 0, 5, -1, 9, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 3, -1, 1, 0, 7, -5, 1, 0, 1, -9, 1, 0, 1, -1, 1, 0, 1, -1, 3, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 5, 0, 1, -1, 1, 0, 27, -1, 1, 0, 1, -1, 1, 0, 1, -3, 1, 0, 1, -1, 1, 0, 1, -7, 3, 0, 1, -1, 1, 0, 1
Offset: 1

Views

Author

Antti Karttunen, Nov 08 2018

Keywords

Crossrefs

Programs

  • PARI
    A319993(n) =  { my(f=factor(n)); prod(i=1,#f~,if(2==f[i,1],-(1==f[i,2]),(f[i,1]^(f[i,2]-1)))); };
    
  • PARI
    A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1]));
    A319997(n) = sumdiv(n,d,(d%2)*moebius(n/d)*d);
    A319993(n) = (A319997(n)/A173557(n));

Formula

Multiplicative with a(2^1) = -1, a(2^e) = 0 for e > 1, and a(p^e) = p^(e-1) when p is an odd prime.
a(n) = A319997(n) / A173557(n).
a(2n) = A003557(2n) - 2*A003557(n), a(2n+1) = A003557(2n+1).

A319998 a(n) = Sum_{d|n, d is even} mu(n/d)*d, where mu(n) is Moebius function A008683.

Original entry on oeis.org

0, 2, 0, 2, 0, 4, 0, 4, 0, 8, 0, 4, 0, 12, 0, 8, 0, 12, 0, 8, 0, 20, 0, 8, 0, 24, 0, 12, 0, 16, 0, 16, 0, 32, 0, 12, 0, 36, 0, 16, 0, 24, 0, 20, 0, 44, 0, 16, 0, 40, 0, 24, 0, 36, 0, 24, 0, 56, 0, 16, 0, 60, 0, 32, 0, 40, 0, 32, 0, 48, 0, 24, 0, 72, 0, 36, 0, 48, 0, 32, 0, 80, 0, 24, 0, 84, 0, 40, 0, 48, 0, 44, 0, 92, 0, 32, 0, 84, 0, 40, 0, 64, 0, 48, 0
Offset: 1

Views

Author

Antti Karttunen, Oct 31 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Rest[CoefficientList[Series[Sum[2*MoebiusMu[k]*x^(2*k)/(1 - x^(2*k))^2, {k, 1, 100}], {x, 0, 100}], x]] (* Vaclav Kotesovec, Nov 03 2018 *)
  • PARI
    A319998(n) = sumdiv(n,d,(!(d%2))*moebius(n/d)*d);
    
  • PARI
    A319998(n) = if(n%2, 0, 2*eulerphi(n/2));

Formula

a(n) = Sum_{d|n} A059841(d)*A008683(n/d)*d.
a(n) = A000010(n) - A319997(n).
a(2n) = 2*A000010(n), a(2n+1) = 0.
G.f.: Sum_{k>=1} 2*mu(k)*x^(2*k)/(1 - x^(2*k))^2. - Ilya Gutkovskiy, Nov 02 2018
Sum_{k=1..n} a(k) ~ c * n^2, where c = 3/(2*Pi^2) = 0.151981... . - Amiram Eldar, Nov 12 2022

A325596 a(n) = Sum_{d|n} mu(n/d) * (-1)^(d + 1) * d.

Original entry on oeis.org

1, -3, 2, -2, 4, -6, 6, -4, 6, -12, 10, -4, 12, -18, 8, -8, 16, -18, 18, -8, 12, -30, 22, -8, 20, -36, 18, -12, 28, -24, 30, -16, 20, -48, 24, -12, 36, -54, 24, -16, 40, -36, 42, -20, 24, -66, 46, -16, 42, -60, 32, -24, 52, -54, 40, -24, 36, -84, 58, -16, 60, -90, 36, -32, 48
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 07 2019

Keywords

Comments

Moebius transform of A181983.

Crossrefs

Programs

  • Magma
    [&+[MoebiusMu(Floor(n/d))*(-1)^(d+1)*d:d in Divisors(n)]:n in [1..70]]; // Marius A. Burtea, Sep 07 2019
  • Mathematica
    a[n_] := Sum[MoebiusMu[n/d] (-1)^(d + 1) d, {d, Divisors[n]}]; Table[a[n], {n, 1, 65}]
    a[n_] := If[OddQ[n], EulerPhi[n], EulerPhi[n] - 4 EulerPhi[n/2]]; Table[a[n], {n, 1, 65}]
    nmax = 65; CoefficientList[Series[Sum[MoebiusMu[k] x^k/(1 + x^k)^2, {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    f[p_, e_] := (p - 1)*p^(e - 1); f[2, 1] = -3; f[2, e_] := -2^(e - 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 15 2022 *)
  • PARI
    a(n) = sumdiv(n, d, moebius(n/d)*(-1)^(d+1)*d); \\ Michel Marcus, Sep 07 2019
    

Formula

G.f.: Sum_{k>=1} mu(k) * x^k / (1 + x^k)^2.
G.f. A(x) satisfies: A(x) = x / (1 + x)^2 - Sum_{k>=2} A(x^k).
a(n) = phi(n) if n odd, phi(n) - 4*phi(n/2) if n even, where phi = A000010.
a(n) = A319997(n) - A319998(n).
Multiplicative with a(2) = -3, a(2^e) = -2^(e-1) for e > 1, and a(p^e) = (p-1)*p^(e-1) for p > 2. - Amiram Eldar, Nov 15 2022

A319999 Filter sequence combining A173557(n) with A319993(n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 4, 8, 9, 10, 11, 12, 13, 14, 4, 15, 16, 17, 18, 12, 19, 20, 11, 21, 22, 23, 24, 25, 26, 27, 4, 28, 29, 30, 11, 31, 32, 30, 18, 33, 22, 34, 35, 36, 37, 38, 11, 39, 40, 41, 42, 43, 44, 33, 24, 31, 45, 46, 47, 48, 49, 50, 4, 51, 52, 53, 54, 55, 56, 57, 11, 58, 59, 60, 61, 48, 56, 62, 18, 63, 64, 65, 42, 66, 67, 68, 35, 69, 70, 58, 71, 48, 72, 58, 11, 73, 74, 75, 18, 76, 77, 78, 42
Offset: 1

Views

Author

Antti Karttunen, Nov 08 2018

Keywords

Comments

Restricted growth sequence transform of ordered pair [A173557(n), A319993(n)].
For all i, j: a(i) = a(j) => A319997(i) = A319997(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A173557(n) = factorback(apply(p -> p-1, factor(n)[, 1]));
    A319993(n) =  { my(f=factor(n)); prod(i=1,#f~,if(2==f[i,1],-(1==f[i,2]),(f[i,1]^(f[i,2]-1)))); };
    v319999 = rgs_transform(vector(up_to,n,[A173557(n),A319993(n)]));
    A319999(n) = v319999[n];

A345082 Number of elements of order n in R/Z X Z/2Z.

Original entry on oeis.org

1, 3, 2, 4, 4, 6, 6, 8, 6, 12, 10, 8, 12, 18, 8, 16, 16, 18, 18, 16, 12, 30, 22, 16, 20, 36, 18, 24, 28, 24, 30, 32, 20, 48, 24, 24, 36, 54, 24, 32, 40, 36, 42, 40, 24, 66, 46, 32, 42, 60, 32, 48, 52, 54, 40, 48, 36, 84, 58, 32, 60, 90, 36, 64, 48, 60, 66, 64
Offset: 1

Views

Author

Michel Marcus, Jul 30 2021

Keywords

Comments

From Peter Bala, Dec 30 2023: (Start)
Denoted phi_2(n) in van der Kamp.
The number of solutions of the congruence x*y == 2 (mod n), 1 <= x, y <= n.
Can be regarded as a generalization of Euler's totient function phi(n) = Sum_{k = 1..n, gcd(k,n) = 1} gcd(k,n) since a(n) = Sum_{k = 1..n, gcd(k,n) divides 2} gcd(k,n). (End)

Crossrefs

Programs

  • Maple
    with(numtheory):
    seq(add(d*phi(n/d), d in divisors(igcd(2, n))), n = 1..70); # Peter Bala, Dec 30 2023
  • Mathematica
    Table[If[OddQ[n],EulerPhi[n],If[Mod[n,4]==0,2EulerPhi[n],2EulerPhi[n]+EulerPhi[n/2]]],{n,68}] (* Stefano Spezia, Jul 30 2021 *)
  • PARI
    a(n) = if (n%2, eulerphi(n), if (n%4, 2*eulerphi(n) + eulerphi(n/2), 2*eulerphi(n)));
    
  • Python
    from sympy import totient as phi
    def a(n): return phi(n) if n%2 else 2*phi(n)+phi(n//2) if n%4 else 2*phi(n)
    print([a(n) for n in range(1, 69)]) # Michael S. Branicky, Jul 30 2021

Formula

a(n) = phi(n) if n is odd; 2*phi(n) if n == 0 (mod 4); 2*phi(n) + phi(n/2) if n == 2 (mod 4).
From Ridouane Oudra, Oct 17 2021: (Start)
a(n) = A000010(n) + A319998(n);
a(n) = 2*A000010(n) - A319997(n);
a(n) = Sum_{j = 1..n} gcd(n,j)*cos(4*Pi*j/n). (End)
From Peter Bala, Dec 30 2023: (Start)
a(n) = Sum_{d divides gcd(2,n)} d*phi(n/d), where phi(n) = A000010(n) denotes Euler's totient function.
Sum_{d divides n} a(d) = 2*n for n even, else equals n (van der Kamp, equation 26).
Dirichlet g.f.: zeta(s-1)*(1 + 2^(1-s))/zeta(s).
The Lambert series Sum_{n >= 1} a(n)*x^n/(1 - x^n) = x*(1 + 4*x + x^2)/(1 - x^2)^2. See A022998.
Multiplicative with a(2) = 3, a(2^k) = 2^k for k >= 2 and a(p^k) = p*k - p^(k-1) for odd primes p.
If n divides m then a(n) divides 3*a(m). (End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = 9/(2*Pi^2) = 0.455945... (A088245). - Amiram Eldar, Jan 18 2024
Showing 1-5 of 5 results.