OFFSET
1,4
COMMENTS
EXAMPLE
Prime(1) = 2 is in the diagonal (w(n,n+1)), so a(1) = 1.
Prime(13) = 43 is in the diagonal (w(n,n-4)), so a(7) = -4.
MATHEMATICA
Map[1 + #[[1]] - 2 #[[2]] &[{#[[2]], #[[1]] - ((#[[2]] - 1) + (#[[2]] - 1)^2)/
2} &[{#, Floor[(1 + Sqrt[8 # - 7])/2]}] &[Prime[#]]] &, Range[1000]]
(* Peter J. C. Moses, Feb 07 2023 *)
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Clark Kimberling, Feb 10 2023
STATUS
approved