%I #35 Aug 01 2018 09:21:31
%S 2,3,4,5,5,5,5,5,6,7,7,7,7,7,10,11,11,11,11,11,11,13,17,17,17,17,17,
%T 17,17,18,19,19,19,19,19,19,19,19,19,19,19,19,23,23,23,23,23,23,23,23,
%U 29,29,29,29,29,29,29,29,29,29,31
%N a(n) = smallest number not in {A098550(1), A098550(2), ..., A098550(n)}.
%C a(n) = smallest missing number in A098550 once we have found A098550(n).
%C _Bradley Klee_ conjectures that after a(30)=18, all further terms are primes, that every prime appears, and the primes appear in increasing order.
%D Bradley Klee, Posting to Sequence Fans Mailing List, Dec 03 2014
%H N. J. A. Sloane and Reinhard Zumkeller, <a href="/A251416/b251416.txt">Table of n, a(n) for n = 1..100000</a> (first 1000 terms from N. J. A. Sloane)
%F a(n) = Min{A251546(n), A251549(n)}. - _Reinhard Zumkeller_, Dec 19 2014
%p # This produces the first 100 terms. Uses b1 = list of terms in A098550, from b-file
%p b2:={$3..5000}:
%p b3:=[2]:
%p for i from 2 to 100 do
%p b2:=remove('x->x=b1[i]',b2):
%p b3:=[op(b3),b2[1]];
%p od:
%p b3;
%t terms = 100;
%t f[lst_List] := Block[{k = 4}, While[GCD[lst[[-2]], k] == 1 || GCD[lst[[-1]], k] > 1 || MemberQ[lst, k], k++]; Append[lst, k]];
%t A098550 = Nest[f, {1, 2, 3}, terms-3];
%t a[1] = 2;
%t a[n_] := a[n] = For[k = a[n - 1], True, k++, If[FreeQ[A098550[[1 ;; n]], k], Return[k]]];
%t Array[a, terms] (* _Jean-François Alcover_, Aug 01 2018, after _Robert G. Wilson v_ *)
%o (Haskell)
%o import Data.List (delete)
%o a251416 n = a251416_list !! (n-1)
%o a251416_list = 2 : 3 : f 2 3 [4..] where
%o f u v ws = h ws where
%o h (x:xs) = if gcd x u > 1 && gcd x v == 1
%o then (head ws) : f v x (delete x ws) else h xs
%o -- _Reinhard Zumkeller_, Dec 05 2014
%Y Cf. A098550, A251415. See A251417 for lengths of runs.
%Y Cf. A251595 (distinct terms).
%Y Cf. A251546, A251549.
%K nonn
%O 1,1
%A _N. J. A. Sloane_, Dec 03 2014
|