login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

Starting with a(1) = 1 instead leads to a(n) = n for every positive integer n.

LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..1000

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: A087039 A102096 A322813 * A329888 A266161 A072203

Adjacent sequences:  A137863 A137864 A137865 * A137867 A137868 A137869

KEYWORD

nonn

AUTHOR

Leroy Quet, Apr 29 2008

EXTENSIONS

More terms from Sean A. Irvine, Feb 14 2011

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 3 19:17 EDT 2021. Contains 346441 sequences. (Running on oeis4.)