login
A253415
Smallest missing number within the first n terms in A095258.
4
2, 4, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 22, 22, 22, 22, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31
OFFSET
2,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 2..10000 (terms 2..797 from Reinhard Zumkeller)
MATHEMATICA
c[_] = 0; c[1] = j = 1; u = 2; s = 3; Reap[Do[d = Divisors[s]; k = 1; While[c[d[[k]]] > 0, k++]; Set[k, d[[k]]]; Set[c[k], i]; If[k == u, While[c[u] > 0, u++]]; Sow[u]; j = k; s += k, {i, 2, 2^12}]][[-1, -1]] (* Michael De Vlieger, Jan 23 2022 *)
PROG
(Haskell)
import Data.List (delete)
a253415 n = a253415_list !! (n-2)
a253415_list = f [2..] 1 where
f xs z = g xs where
g (y:ys) = if mod z' y > 0 then g ys else x : f xs' (z + y)
where xs'@(x:_) = delete y xs
z' = z + 2
-- Reinhard Zumkeller, Dec 31 2014
(Python)
from itertools import islice
from sympy import divisors
def A253415_gen(): # generator of terms, first term is a(2)
bset, m, s = {1}, 2, 3
while True:
for d in divisors(s):
if d not in bset:
bset.add(d)
while m in bset:
m += 1
yield m
s += d
break
A253415_list = list(islice(A253415_gen(), 30)) # Chai Wah Wu, Jan 25 2022
CROSSREFS
Cf. A095258, A095259, A253425 (run lengths).
Sequence in context: A278300 A034214 A317749 * A227401 A131813 A083038
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Dec 31 2014
STATUS
approved