login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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