login
Smallest missing number within the first n terms in A109890.
4

%I #12 Jan 05 2015 07:13:27

%S 4,4,5,5,5,5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,11,11,11,11,11,11,11,11,11,

%T 11,11,11,11,11,11,11,11,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,

%U 17,17,17,17,17,17,17,17,17,17,17,17,34,37,37,37,37,37

%N Smallest missing number within the first n terms in A109890.

%C A253584(n) occurs exactly A253444(n) times.

%H Reinhard Zumkeller, <a href="/A253443/b253443.txt">Table of n, a(n) for n = 4..10000</a>

%o (Haskell)

%o import Data.List (insert)

%o a253443 n = a253443_list !! (n-4)

%o a253443_list = f (4, []) 6 where

%o f (m,ys) z = g $ dropWhile (< m) $ a027750_row' z where

%o g (d:ds) | elem d ys = g ds

%o | otherwise = m : f (ins [m, m+1 ..] (insert d ys)) (z + d)

%o ins (u:us) vs'@(v:vs) = if u < v then (u, vs') else ins us vs

%o -- _Reinhard Zumkeller_, Jan 03 2015

%Y Cf. A095258, A095259, A253444 (run lengths), A253584 (range), A253415.

%K nonn

%O 4,1

%A _Reinhard Zumkeller_, Jan 01 2015