OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Amiram Eldar, Plot of a(n)/n for n = 10000..100000
FORMULA
It seems that a(n)/n -> 2.4799.... = 62/25 ?
MATHEMATICA
a[1] = 2; a[n_] := a[n] = Module[{s = Array[a, n-1]}, a[n-1] + If[MemberQ[s, n], If[OddQ[a[n-1]], 1, 2], 3]]; Array[a, 100] (* Amiram Eldar, May 14 2022 *)
PROG
(PARI) for(n=2, 400, an[n]=if(setsearch(Set(vector(n-1, i, a(i))), n), if(a(n-1)%2, a(n-1)+1, a(n-1)+2), a(n-1)+3))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Mar 01 2003
STATUS
approved