OFFSET
1,1
COMMENTS
a(p) = p, p is a prime. If the process is continued until a 1 is subtracted the result is n^2. Conjecture: No term is zero.
FORMULA
The k-th step of the process used to generate the n-th term is 2n+(k^2)/4 if k is even and n+(k^2-1)/4 if k is odd. - Adam M. Kalman (mocha(AT)clarityconnect.com), Nov 09 2004
EXAMPLE
a(4) = 17 and the steps are 4, 4+5, 4+5-3, 4+5-3+6, 4+5-3+6-2, 4+5-3+6-2+7= 17. a(6) = 6+7 =13.
MATHEMATICA
For[a=1, a<100, x:=a; s:=1; While[(!PrimeQ[x])\[And](s<=2a-1), If[OddQ[s], x+=a+(s+1)/2, x+=-a+s/2]; s++ ]; If[PrimeQ[x], Print[x], Print[0]]; a++ ]; (Kalman)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Mar 24 2004
EXTENSIONS
More terms from Adam M. Kalman (mocha(AT)clarityconnect.com), Nov 09 2004
STATUS
approved