(i=pr mod (p^2)+⌊(r/p)⌋pN+s(27))