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.

A263320 Number of regular elements in Z_n[i].

This page as a plain text file.
%I A263320 #38 Aug 31 2023 05:33:33
%S A263320 1,3,9,9,25,27,49,33,73,75,121,81,169,147,225,129,289,219,361,225,441,
%T A263320 363,529,297,441,507,649,441,841,675,961,513,1089,867,1225,657,1369,
%U A263320 1083,1521,825,1681,1323,1849,1089,1825,1587,2209,1161,2353,1323,2601,1521
%N A263320 Number of regular elements in Z_n[i].
%C A263320 A Gaussian integer z is called regular (mod n) if there is a Gaussian integer x such that z^2 * x == z (mod n).
%C A263320 From _Robert Israel_, Nov 30 2015: (Start)
%C A263320 a(2^k) = 1 + 2^(2k-1) for k >= 1.
%C A263320 a(p) = p^2 if p is an odd prime.
%C A263320 a(p^k) = 1 - p^(2k-2) + p^(2k) if p is a prime == 3 mod 4.
%C A263320 a(p^k) = 1 - 2 p^(k-1) + 2 p^k + p^(2k-2) - 2 p^(2k-1) + p^(2k) if p is a prime == 1 mod 4.(End)
%H A263320 Robert Israel, <a href="/A263320/b263320.txt">Table of n, a(n) for n = 1..10000</a>
%H A263320 Wikipedia, <a href="http://en.wikipedia.org/wiki/Gaussian_integer">Gaussian Integer</a>.
%e A263320 a(2) = 3 because the regular elements in Z_2[i] are {0, 1, i}.
%t A263320 regularQ[a_, b_, n_] := ! {0} == Union@Flatten@Table[If[Mod[(a + b I) - (a +  b I)^2 (x + y I),  n] == 0, x + I y, 0], {x, 0, n - 1}, {y, 0, n -1}]; Ho[1]=1; Ho[n_] := Ho[n] = Sum[If[regularQ[a, b, n], 1, 0], {a, 1, n}, {b, 1, n}]; Table[Ho[n], {n, 1, 33}]
%t A263320 f[p_, e_] := If[Mod[p, 4] == 1, 1 - 2*p^(e-1) + 2*p^e + p^(2*e-2) - 2*p^(2*e-1) + p^(2*e), 1 - p^(2*e-2) + p^(2*e)]; f[2, e_] := 1 + 2^(2*e-1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Aug 31 2023 *)
%Y A263320 Cf. A055653.
%K A263320 nonn,easy,mult
%O A263320 1,2
%A A263320 _José María Grau Ribas_, Oct 14 2015