A125769 a(n) is the least number j such that j*T_k +/- 1 is n-th prime for some k-th triangular number.
1, 2, 1, 1, 1, 2, 3, 2, 4, 1, 2, 1, 2, 2, 8, 9, 4, 4, 1, 2, 2, 1, 3, 2, 16, 10, 17, 3, 2, 4, 6, 2, 1, 5, 10, 10, 2, 27, 6, 29, 4, 2, 1, 32, 3, 3, 1, 8, 38, 23, 3, 2, 2, 7, 43, 4, 6, 2, 1, 10, 47, 14, 2, 4, 4, 53, 5, 12, 58, 35, 59, 3, 61, 62, 1, 64, 5, 6, 40, 3, 2, 2, 12, 12, 8, 74, 10, 76, 2, 2, 6, 4
Offset: 1
Keywords
Examples
a(1) = 1 because 1*1+1 = 2 which is the first prime, a(2) = 2 because 2*1+1 = 3 which is the second prime, a(3) = 4 because 1*6-1 = 5 which is the third prime, a(8) = 3 because 2*10-1 = 19 which is the eighth prime, ...
Programs
-
Mathematica
triQ[n_] := IntegerQ@ Sqrt[8n + 1]; f[n_] := Block[{j = 1, p = Prime@n}, While[ !triQ[(p - 1)/j] && !triQ[(p + 1)/j], j++ ]; j]; Array[f, 92]
Comments