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!)
A099427 a(1) = 1; for n > 1, a(n) = 1 + greatest common divisor of n and a(n-1). 3
1, 2, 2, 3, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 6, 7, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(A060401(n)) = n + 1; a(A192489(n)) = 2. - Reinhard Zumkeller, Jul 02 2011

For n >= 3, a(n) == n+1 (mod 2). - Robert Israel, Jan 10 2017

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

EXAMPLE

a(9)=4 because 1+gcd(a(8),9)=1+gcd(3,9)=1+3.

MAPLE

f:= proc(n) option remember; 1 + igcd(n, procname(n-1)) end proc:

f(1):= 1:

map(f, [$1..1000]); # Robert Israel, Jan 10 2017

MATHEMATICA

a[1] = 1; a[n_] := a[n] = GCD[n, a[n - 1]] + 1; Table[ a[n], {n, 105}] (* Robert G. Wilson v, Nov 18 2004 *)

nxt[{n_, a_}]:={n+1, GCD[n+1, a]+1}; Transpose[NestList[nxt, {1, 1}, 110]] [[2]] (* Harvey P. Dale, Nov 22 2014 *)

PROG

(Haskell)

a099427 n = a099427_list !! (n-1)

a099427_list = 1 : map (+ 1) (zipWith gcd [2..] a099427_list)

-- Reinhard Zumkeller, Jun 23 2015, Jul 02 2011

CROSSREFS

For position of first occurrence of n see A060401.

Sequence in context: A185816 A324901 A295568 * A059964 A308050 A248147

Adjacent sequences:  A099424 A099425 A099426 * A099428 A099429 A099430

KEYWORD

easy,nonn,nice

AUTHOR

Gaetan Polard (gaetan27(AT)hotmail.com), Nov 18 2004

EXTENSIONS

Edited and extended by Robert G. Wilson v, Nov 18 2004

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 21:13 EDT 2021. Contains 346441 sequences. (Running on oeis4.)