A091508 Let b(1)=n; b(k+1)=b(k)/gcd(k,b(k)) if gcd(k,b(k))>1; b(k+1)=b(k)+k otherwise, sequence gives least k such that b(k)=1.
1, 2, 111, 7, 5, 3, 25, 22, 25, 111, 111, 4, 7, 5, 5, 6, 22, 25, 22, 9, 111, 25, 25, 4, 111, 111, 11, 111, 9, 7, 6, 8, 19, 5, 6, 19, 9, 22, 22, 111, 8, 22, 19, 9, 9, 111, 111, 111, 111, 25, 15, 11, 9, 111, 8, 111, 16, 11, 7, 5, 9, 9, 9, 15, 111, 6, 111, 10, 7, 19, 19, 19, 9, 6, 25
Offset: 1
Keywords
Links
- Michel Marcus, Table of n, a(n) for n = 1..10000
Programs
-
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)
Comments