A057060 a(n) = number of the row of (R(i,j)) that contains prime(n), where R(i,j) is the rectangle with descending antidiagonals 1; 2,3; 4,5,6; ...
1, 2, 2, 1, 1, 3, 2, 4, 2, 1, 3, 1, 5, 7, 2, 8, 4, 6, 1, 5, 7, 1, 5, 11, 6, 10, 12, 2, 4, 8, 7, 11, 1, 3, 13, 15, 4, 10, 14, 2, 8, 10, 1, 3, 7, 9, 1, 13, 17, 19, 2, 8, 10, 20, 4, 10, 16, 18, 1, 5, 7, 17, 7, 11, 13, 17, 6, 12, 22, 24, 2, 8, 16, 22, 1, 5, 11
Offset: 1
Keywords
Examples
The 8th prime, 19, is in row 4, so a(8) = 4.
Programs
-
Mathematica
s = Flatten[Table[Range[n], {n, 1, 40}]]; Table[s[[Prime[n]]], {n, 1, 100}]
-
PARI
f(n) = n-binomial((sqrtint(8*n)+1)\2, 2); \\ A002260 a(n) = f(prime(n)); \\ Michel Marcus, Feb 24 2023
Formula
a(n) = A002260(prime(n)). - Kevin Ryde, Feb 12 2023
Extensions
Edited by Clark Kimberling, Feb 13 2023
Comments