

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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

2,1


LINKS



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 !! (n2)
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
(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


CROSSREFS



KEYWORD

nonn


AUTHOR



STATUS

approved



