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.

A235872 Number of solutions to the equation x^2=0 in the ring of Gaussian integers modulo n.

Original entry on oeis.org

1, 2, 1, 4, 1, 2, 1, 8, 9, 2, 1, 4, 1, 2, 1, 16, 1, 18, 1, 4, 1, 2, 1, 8, 25, 2, 9, 4, 1, 2, 1, 32, 1, 2, 1, 36, 1, 2, 1, 8, 1, 2, 1, 4, 9, 2, 1, 16, 49, 50, 1, 4, 1, 18, 1, 8, 1, 2, 1, 4, 1, 2, 9, 64, 1, 2, 1, 4, 1, 2, 1, 72, 1, 2, 25, 4, 1, 2, 1, 16, 81, 2
Offset: 1

Views

Author

Keywords

Comments

Numbers of solutions to x^2 == y^2 (mod n), 2*x*y == 0 (mod n). - Andrew Howroyd, Aug 06 2018

Crossrefs

Programs

  • Mathematica
    invoG[n_] := invoG[n] = Sum[If[Mod[(x + I y)^2, n] == 0, 1, 0], {x, 0, n - 1}, {y, 0, n - 1}]; Table[invoG[n], {n, 1, 104}]
    f[p_, e_] := p^(2*Floor[e/2]); f[2, e_] := 2^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 13 2022 *)
  • PARI
    a(n)={sum(i=0, n-1, sum(j=0, n-1, (i^2 - j^2)%n == 0 && 2*i*j%n == 0))} \\ Andrew Howroyd, Aug 06 2018
    
  • PARI
    a(n)={my(f=factor(n)); prod(i=1, #f~, my([p,e]=f[i,]); p^if(p==2, e, e - e%2))} \\ Andrew Howroyd, Aug 06 2018

Formula

Multiplicative with a(2^e) = 2^e, a(p^e) = p^(2*floor(e/2)). - Andrew Howroyd, Aug 06 2018
Sum_{k=1..n} a(k) ~ c * n^(3/2), where c = (2/21)*(3+sqrt(2))*zeta(3/2)/zeta(3) = 0.91363892007.... - Amiram Eldar, Nov 13 2022