A329585 Irregular triangle read by rows: representative solutions of the congruences x^2 - 1 == 0 (mod m) or (inclusive) x^2 + 1 == 0 (mod m), for m >= 1.
0, 1, 1, 2, 1, 3, 1, 2, 3, 4, 1, 5, 1, 6, 1, 3, 5, 7, 1, 8, 1, 3, 7, 9, 1, 10, 1, 5, 7, 11, 1, 5, 8, 12, 1, 13, 1, 4, 11, 14, 1, 7, 9, 15, 1, 4, 13, 16, 1, 17, 1, 18, 1, 9, 11, 19
Offset: 1
Examples
The irregular triangle T(m, k) begins: (a bar after a number indicates a solution of x^2 == -1 (mod m)) m/k 1 2 3 4 ... A329586(m) ----------------------------------------- 1: 0 1 2: 1 1| 2 3: 1 2 2 4: 1 3 2 5: 1 2| 3| 4 2 + 2 = 4 6: 1 5 2 7: 1 6 2 8: 1 3 5 7 4 9: 1 8 2 10: 1 3| 7| 9 2 + 2 = 4 11: 1 10 2 12: 1 5 7 11 4 13: 1 5| 8| 12 2 + 2 = 4 14: 1 13 2 15: 1 4 11 14 4 16: 1 7 9 15 4 17: 1 4| 13| 16 2 + 2 = 4 18: 1 17 2 19: 1 18 2 20: 1 9 11 19 4 ... ----------------------------------------- Number of solutions: m = 2, 2 solutions (z = 1, z = i) (special case). m = 6 = 2*3: r1 = 0, e2 = 1, r2(e2) = 0, r3 = 1, hence 2^1 + 0 = 2 solutions. m = 13 == 1 (mod 4): r1 = 1, e2 = 0 = r2(e2), r3 = 0, hence 2^{0+1+0} + 1*1*2^1 = 2 + 2 = 4 solutions. m = 20 = 2^2*5: e2 = 2, r2(e2) = 1, r1 = 1, r3 = 0, hence 2^{1+1+0} + 0*1*2^1 = 2^2 = 4 solutions of x^2 == +1 (mod 20) only. m = 120 = 2^3*3*5: e2 =3, r2(e2) = 2, r3 = 1, r1 = 1, hence 2^{2+1+1} + 0*0*2^1 = 2^4 = 16 solutions of x^2 == +1 (mod 120) only. ----------------------------------------------------------------------------- The first instance with 8 solutions is m = 24: 1 5 7 11 13 17 19 23. The first instance with 8 solutions involving both congruences is m = 65: 1 8| 14 18| 47| 51 57| 64. The first instance with 16 solutions is m = 120: 1, 11, 19, 29, 31, 41, 49, 59, 61, 71, 79, 89, 91, 101, 109, 119. The first instance for even m with 16 solutions involving both congruences is m = 2*5*13*17 = 2210: 1 47| 339 441 463| 781 837| 863| 1347| 1373| 1429 1747| 1769 1871 2163| 2209. ------------------------------------------------------------------------------
References
- T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1986
Formula
Row m of length A329586(m): Combined representative solutions of x^2 == +1 (mod m) or x^2 == -1 (mod m), sorted increasingly. The smallest nonnegative residue system modulo m is used: [0, 1, ..., m-1]. For the special m = 1 and m = 2 cases see the comment section.
Comments