OFFSET
0,1
EXAMPLE
a(8)=9 because b(0)=8, b(1)=9, b(2)=10, 11, 6, 7, 4, 5, 3, b(9)=2;
a(10)=7 because b(0)=10, b(1)=11, 6, 7, 4, 5, 3, b(7)=2, etc
MATHEMATICA
b=c=1; re={{0, 2}, {1, 1}, {2, 0}}; Do[i=0; a=n; While[a!=2, i++; If[PrimeQ[a], a=(a+c)/2, a=a+b]]; AppendTo[re, i], {n, 3, 100}]; re
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Aug 02 2006
STATUS
approved