OFFSET
1,2
COMMENTS
I conjecture a(n) always exists. That means sequence (b(k)) becomes ultimately regular for any n. i.e. there is always k0 such that b(k0)=1, so b(k0+1)=b(k0)+k0=k0+1 since gcd(k0,b(k0))=1 and gcd(k0+1,b(k0+1))=k0+1 implies b(k0+2)=b(k0+1)/(k0+1)=1 and from that point k0 sequence (b(k)) continues : 1, k0+1, 1, k0+2, 1, k0+3,1,... and is "regular".
PROG
(PARI) a(n)=if(n<0, 0, s=1; b=n; while(b>1, s++; b=if(gcd(s, b)-1, b/gcd(b, s), b+s)); s)
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Mar 03 2004
STATUS
approved