OFFSET
1,1
COMMENTS
A099427(a(n)) = 2;
a(n) = A038179(n) for n <= 22.
The next term divisible by 3 is a(137)=429. - Joe Slater, Jan 10 2017
All terms after the first are odd, since A099427(n) == n+1 (mod 2) for n >= 3. - Robert Israel, Jan 10 2017
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
MAPLE
A099427:= proc(n) option remember; 1 + igcd(n, procname(n-1)) end proc:
A099427(1):= 1:
select(A099427=2, [$1..1000]); # Robert Israel, Jan 10 2017
MATHEMATICA
(* b = A099427 *) b[1] = 1; b[n_] := b[n] = GCD[n, b[n - 1]] + 1;
Select[Range[200], b[#] == 2&] (* Jean-François Alcover, Mar 10 2019 *)
PROG
(Haskell)
a192489 n = a192489_list !! (n-1)
a192489_list = f 2 1 where
f n x | x' == 2 = n : f (n+1) x'
| otherwise = f (n+1) x'
where x' = 1 + gcd n x
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 02 2011
STATUS
approved