OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
EXAMPLE
a(8) = 10 because the first few terms of Hofstadter's Q-sequence are 1,1,2,3,3,4,5,5,6,6,6,8,8,8,10,9 and 10 is the 8th record value.
PROG
(Haskell)
a226244 n = a226244_list !! (n-1)
(a226244_list, a226245_list) = unzip $ (1, 1) : f 1 1 a005185_list where
f i v (q:qs) | q > v = (q, i) : f (i + 1) q qs
| otherwise = f (i + 1) v qs
-- Reinhard Zumkeller, Jun 02 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Jun 01 2013
STATUS
approved