login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A247799
a(0) = 1; a(n) = a(n-1) + (if n = a(k) for some k then k else n).
1
0, 1, 3, 5, 9, 12, 18, 25, 33, 37, 47, 58, 63, 76, 90, 105, 121, 138, 144, 163, 183, 204, 226, 249, 273, 280, 306, 333, 361, 390, 420, 451, 483, 491, 525, 560, 596, 605, 643, 682, 722, 763, 805, 848, 892, 937, 983, 993, 1041, 1090, 1140, 1191, 1243, 1296
OFFSET
0,3
COMMENTS
a(n) <= A000217(n).
LINKS
PROG
(Haskell)
import Data.List (elemIndex); import Data.Maybe (maybe)
a247799 n = a247799_list !! n
a247799_list = 0 : f 1 [0] where
f x zs@(z:_) = y : f (x + 1) (y : zs) where
y = z + maybe x id (elemIndex x $ reverse zs)
CROSSREFS
Cf. A000217.
Sequence in context: A005766 A211538 A368613 * A265702 A190310 A046746
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Sep 26 2014
STATUS
approved