OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
B. Cloitre, N. J. A. Sloane and M. J. Vandermast, Numerical analogues of Aronson's sequence, J. Integer Seqs., Vol. 6 (2003), #03.2.2.
B. Cloitre, N. J. A. Sloane and M. J. Vandermast, Numerical analogues of Aronson's sequence (math.NT/0305308)
MATHEMATICA
a[1] = 1; a[n_] := a[n] = If[MemberQ[Array[a, n-1], n], a[n-1]+1, a[n-1]+4]; Array[a, 60] (* Jean-François Alcover, Oct 08 2018 *)
PROG
(Haskell)
a080579 n = a080579_list !! (n-1)
a080579_list = 1 : f 2 [1] where
f x zs@(z:_) = y : f (x + 1) (y : zs) where
y = if x `elem` zs then z + 1 else z + 4
-- Reinhard Zumkeller, Sep 26 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Mar 23 2003
STATUS
approved