login
A137866
a(1)=0. For n >= 2, a(n) = gcd(a(n-1)+1, n).
1
0, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 2
OFFSET
1,4
COMMENTS
Starting with a(1) = 1 instead leads to a(n) = n for every positive integer n.
LINKS
MATHEMATICA
a[1] := 0; a[n_] := a[n] = GCD[a[n - 1] + 1, n]; Table[a[n], {n, 82}] (* Alonso del Arte, Feb 14 2011 *)
RecurrenceTable[{a[1]==0, a[n]==GCD[a[n-1]+1, n]}, a, {n, 90}] (* Harvey P. Dale, Aug 02 2016 *)
CROSSREFS
Sequence in context: A102096 A322813 A366189 * A361200 A329888 A352202
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 29 2008
EXTENSIONS
More terms from Sean A. Irvine, Feb 14 2011
STATUS
approved