A269597 Irregular triangle giving in row n the larger of the two roots of x^2 + b modulo prime(n) from {0, 1, ..., prime(n)-1} corresponding to b from row n of A269595.
1, 2, 3, 4, 5, 4, 6, 8, 7, 9, 6, 10, 8, 7, 10, 11, 9, 12, 13, 10, 9, 14, 12, 15, 11, 16, 13, 15, 12, 16, 11, 14, 10, 17, 18, 15, 19, 17, 14, 20, 13, 12, 21, 16, 18, 22, 17, 24, 16, 20, 15, 22, 25, 19, 26, 23, 21, 18, 27, 28
Offset: 1
Examples
The irregular triangle begins (P(n) stands here for prime(n)): n, P(n)\k 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1, 2: 1 2, 3: 2 3, 5: 3 4 4, 7: 5 4 6 5, 11: 8 7 9 6 10 6: 13: 8 7 10 11 9 12 7, 17: 13 10 9 14 12 15 11 16 8, 19: 13 15 12 16 11 14 10 17 18 9, 23: 15 19 17 14 20 13 12 21 16 18 22 10, 29: 17 24 16 20 15 22 25 19 26 23 21 18 27 28 ... Row n=7, prime 17 has the permutation (in cycle notation) (9,13,12,14,15,11) (10) (16) of {9, 10, ..., 16}.
Links
Programs
-
Mathematica
nn = 12; s = Table[Select[Range[Prime@ n - 1], JacobiSymbol[#, Prime@ n] == 1 &], {n, nn}]; t = Table[Prime@ n - s[[n, (Prime@ n - 1)/2 - k + 1]], {n, Length@ s}, {k, (Prime@ n - 1)/2}] /. {} -> {1}; Prepend[Table[SelectFirst[Range[#, 1, -1], Function[x, Mod[x^2 + t[[n, k]], #] == 0]] &@ Prime@ n, {n, 2, Length@ t}, {k, (Prime@ n - 1)/2}], {1}] // Flatten (* Michael De Vlieger, Apr 04 2016, Version 10 *)
Comments