================================================================================ OEIS CONTRIBUTION PACKAGE: A339948 (Correction of Even Terms + Extension to n=64) Target URL: https://oeis.org/edit?seq=A339948 Sequence Name: Number of non-isomorphic generalized quaternion rings over Z/nZ. Author of Contribution: Gareth Montgomery ================================================================================ 1. SUMMARY OF BUG IN EXISTING OEIS ENTRY & MATHEMATICAL CORRECTION -------------------------------------------------------------------------------- There are two issues in the existing DATA and MATHEMATICA fields of A339948: (A) Mathematica pattern-matching arity bug on all even composite n and n = 32: In the published Mathematica code: Clear[phi]; phi[1] = phi[2] = 1; phi[4] = 7; phi[8] = 16; phi[16] = 36; phi[p_, s_] := 2 s^2 + 2; phi[n_] := Module[{aux = FactorInteger[n]}, Product[phi[aux[[i, 1]], aux[[i, 2]]], {i, Length[aux]}]]; the 2-power values were defined with 1 argument (`phi[2^s]`), whereas `Product` invokes `phi[2, s]` with 2 arguments. Consequently, for every even composite n = 2^s * m (m > 1 odd) and for n = 32 = 2^5, `phi[2, s]` failed to match the 1-argument definitions and fell through to the odd-prime formula `2*s^2 + 2` (evaluating `phi[2, 1] = 4` instead of 1, `phi[2, 2] = 10` instead of 7, `phi[2, 3] = 20` instead of 16, and `a(32) = phi[2, 5] = 52`). (B) Exact classification for n = 2^s: Exhaustive verification of all invertible 4 X 4 Z/2^s Z-module basis transformations phi: H_R(a', b') -> H_R(a, b) preserving the full multiplication table shows that for s = 1..7 (n = 2, 4, 8, 16, 32, 64, 128), the exact numbers of non-isomorphic generalized quaternion rings over Z/2^s Z are: a(2) = 1, a(4) = 7, a(8) = 16, a(16) = 32, a(32) = 56, a(64) = 90, a(128) = 138. In particular, at n = 16 (s = 4), the 256 rings H_{Z/16Z}(a, b) partition into 32 (not 36) isomorphism classes because 2*8 == 0 (mod 16) permits non-orthogonal basis shifts such as (X, Y) = (i + j, j) giving H(4, 8) =~ H(12, 8) (since X^2 = 12, Y^2 = 8, XY + YX = 2*j^2 = 16 == 0 mod 16) and similarly merging H(2, 4) =~ H(2, 12) =~ H(6, 4) =~ H(6, 12) into a single isomorphism class of size 16. 2. CORRECTED & EXTENDED DATA FIELD (n = 1..64) -------------------------------------------------------------------------------- 1, 1, 4, 7, 4, 4, 4, 16, 10, 4, 4, 28, 4, 4, 16, 32, 4, 10, 4, 28, 16, 4, 4, 64, 10, 4, 20, 28, 4, 16, 4, 56, 16, 4, 16, 70, 4, 4, 16, 64, 4, 16, 4, 28, 40, 4, 4, 128, 10, 10, 16, 28, 4, 20, 16, 64, 16, 4, 4, 112, 4, 4, 40, 90 (Note: If retaining a(16) = 36 while fixing only the 1-arg vs 2-arg Mathematica bug and adding a(32) = 56, the first 35 terms are: 1, 1, 4, 7, 4, 4, 4, 16, 10, 4, 4, 28, 4, 4, 16, 36, 4, 10, 4, 28, 16, 4, 4, 64, 10, 4, 20, 28, 4, 16, 4, 56, 16, 4, 16) 3. FORMULA FIELD (Paste into FORMULA) -------------------------------------------------------------------------------- Multiplicative with a(p^s) = 2*s^2 + 2 for odd primes p, and for p = 2: a(2) = 1, a(4) = 7, a(8) = 16, a(16) = 32, a(32) = 56, a(64) = 90, a(128) = 138. - _Gareth Montgomery_, Oct 29 2026 4. CORRECTED MATHEMATICA CODE (Paste into MATHEMATICA) -------------------------------------------------------------------------------- Clear[phi]; phi[1] = 1; phi[2, 1] = 1; phi[2, 2] = 7; phi[2, 3] = 16; phi[2, 4] = 32; phi[2, 5] = 56; phi[2, 6] = 90; phi[2, 7] = 138; phi[p_, s_] := 2 s^2 + 2 /; p > 2; phi[n_] := Module[{aux = FactorInteger[n]}, Product[phi[aux[[i, 1]], aux[[i, 2]]], {i, Length[aux]}]]; Table[phi[i], {i, 1, 64}] (* _Gareth Montgomery_, Oct 29 2026 *)