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.

A079458 Number of Gaussian integers in a reduced system modulo n.

Original entry on oeis.org

1, 2, 8, 8, 16, 16, 48, 32, 72, 32, 120, 64, 144, 96, 128, 128, 256, 144, 360, 128, 384, 240, 528, 256, 400, 288, 648, 384, 784, 256, 960, 512, 960, 512, 768, 576, 1296, 720, 1152, 512, 1600, 768, 1848, 960, 1152, 1056, 2208, 1024, 2352, 800, 2048, 1152, 2704
Offset: 1

Views

Author

Vladeta Jovovic, Jan 14 2003

Keywords

Comments

Number of units in the ring consisting of the Gaussian integers modulo n. - Jason Kimberley, Dec 07 2015

Examples

			{1, i, 1+2i, 2+i, 3, 3i, 3+2i, 2+3i} is the set of eight units in the Gaussian integers modulo 4. - _Jason Kimberley_, Dec 07 2015
		

Crossrefs

Equals four times A218147. - Jason Kimberley, Nov 14 2015
Sequences giving the number of solutions to the equation GCD(x_1^2+...+x_k^2, n) = 1 with 0 < x_i <= n: A000010 (k=1), A079458 (k=2), A053191 (k=3), A227499 (k=4), A238533 (k=5), A238534 (k=6), A239442 (k=7), A239441 (k=8), A239443 (k=9).
Equivalent of arithmetic functions in the ring of Gaussian integers (the corresponding functions in the ring of integers are in the parentheses): A062327 ("d", A000005), A317797 ("sigma", A000203), this sequence ("phi", A000010), A227334 ("psi", A002322), A086275 ("omega", A001221), A078458 ("Omega", A001222), A318608 ("mu", A008683).
Equivalent in the ring of Eisenstein integers: A319445.

Programs

  • Magma
    A079458 := func)>; // Jason Kimberley, Nov 14 2015
    
  • Maple
    with(GaussInt): seq(GIphi(n), n=1..100);
  • Mathematica
    phi[1]=1;phi[p_, s_] := Which[Mod[p, 4] == 3, p^(2 s - 2) (p^2 - 1), Mod[p, 4] == 1, p^(2 s - 2) ((p - 1))^2, True, 2^(2 s - 1)];phi[n_] := Product[phi[FactorInteger[n][[i, 1]], FactorInteger[n][[i, 2]]], {i, Length[FactorInteger[n]]}];Table[phi[n], {n, 1, 33}] (* José María Grau Ribas, Mar 16 2014 *)
    f[p_, e_] := (p - 1)*p^(2*e - 1) * If[p == 2, 1, 1 - (-1)^((p-1)/2)/p]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Feb 13 2024 *)
  • PARI
    a(n)=
    {
        my(r=1, f=factor(n));
        for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]);
            if(p==2, r*=2^(2*e-1));
            if(p%4==1, r*=(p-1)^2*p^(2*e-2));
            if(p%4==3, r*=(p^2-1)*p^(2*e-2));
        );
        return(r);
    } \\ Jianing Song, Sep 16 2018

Formula

Multiplicative with a(2^e) = 2^(2*e-1), a(p^e) = (p^2-1)*p^(2*e-2) if p mod 4=3 and a(p^e) = (p-1)^2*p^(2*e-2) if p mod 4=1.
a(n) = A003557(n)^2 * a(A007947(n)), where a(2)=2, a(p)=(p-1)^2 for prime p=1(mod 4), a(p)=p^2-1 for prime p=3(mod 4), and a(n*m)=a(n)*a(m) for n coprime to m. - Jason Kimberley, Nov 16 2015
From Amiram Eldar, Feb 13 2024: (Start)
Dirichlet g.f.: zeta(s-2) * (1 - 1/2^(s-1)) * Product_{p prime > 2} (1 - 1/p^(s-1) - (-1)^((p-1)/2)*(p-1)/p^s).
Sum_{k=1..n} a(k) = c * n^3 / 3 + O(n^2 * log(n)), where c = (3/4) * Product_{p prime > 2} (1 - 1/p^2 - (-1)^((p-1)/2)*(p-1)/p^3) = (3/4) * A334427 * Product_{p prime == 1 (mod 4)} (1 - 2/p^2 + 1/p^3) = 0.6498027559... (Calderón et al., 2015). (End)
a(n) = A204617(n)*A062570(n). - Ridouane Oudra, Jun 05 2024

A086227 a(n) = Sum_{1<=k<=4*n, gcd(k,n)=1} (i^k*tan(k*Pi/(4*n)))/(4*i), where i is the imaginary unit.

Original entry on oeis.org

-1, 2, -2, 2, -4, 4, -4, 6, -4, 6, -8, 6, -8, 8, -8, 8, -12, 10, -8, 16, -12, 12, -16, 10, -12, 18, -16, 14, -16, 16, -16, 24, -16, 16, -24, 18, -20, 24, -16, 20, -32, 22, -24, 24, -24, 24, -32, 28, -20, 32, -24, 26, -36, 24, -32, 40, -28, 30, -32, 30, -32, 48, -32, 24, -48, 34, -32, 48, -32, 36, -48, 36, -36, 40, -40, 48, -48
Offset: 2

Views

Author

Benoit Cloitre, Aug 28 2003

Keywords

Comments

This seems to be (-1)^(n+1) times h(-4n^2) = (-1)^(n+1)*A000003(n^2), where h(k) is the class number. Verified for n <= 10^5. - Charles R Greathouse IV, Apr 28 2013

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^(e - 1) * Switch[Mod[p, 4], 2, 1, 1, p - 1, 3, p + 1]; s[n_] := Times @@ f @@@ FactorInteger[n]; a[n_] := If[EvenQ[n], -s[n], s[n]/2]; Array[a, 100, 2] (* Amiram Eldar, Mar 07 2022 *)
  • PARI
    a(n)=round(real(1/4/I*sum(k=1,4*n,(I^k)*tan(Pi/4/n*if(gcd(k,n)-1,0,k)))))
    
  • PARI
    a(n)=round(imag(sum(k=1,4*n,if(gcd(k,n)==1,I^k*tan(k*Pi/4/n))))/4) \\ Charles R Greathouse IV, Apr 25 2013
    
  • PARI
    a(n)=my(s);for(k=1,2*n,if(gcd(2*k-1,n)==1,s-=(-1)^k*tan((2*k-1)*Pi/4/n))); round(s/4) \\ Charles R Greathouse IV, Apr 25 2013

Formula

a(n) = -A204617(n) if n is even, and A204617(n)/2 if n is odd (Rabinowitz, 1996). - Amiram Eldar, Mar 07 2022
a(n) = (-1)^(n+1)*A079458(n)/A140434(n). - Ridouane Oudra, Jun 23 2024

Extensions

Definition corrected by Charles R Greathouse IV, Apr 25 2013
Showing 1-2 of 2 results.