%I #18 Jul 14 2021 09:13:04
%S 2,5,7,11,15,23,26,27,28,31,33,35,36,47,50,56,57,63,66,78,81,82,95,96,
%T 106,116,119,120,122,129,136,156,162,166,167,190,193,215,218,219,227,
%U 236,244,254,263,286,289,330,335,342,352,359,387,393,395,396,414
%N Positive integers having no representation of the form 1 + p1 * (1 + p2* ... * (1 + p_j)...), where [p1, ..., p_j] is a (possibly empty) list of distinct primes.
%H Alois P. Heinz, <a href="/A317242/b317242.txt">Table of n, a(n) for n = 1..20000</a>
%F A317241(a(n)) = 0.
%p q:= proc(n, s) option remember; is (n=1 or ormap(p->
%p q((n-1)/p, s union {p}), numtheory[factorset](n-1) minus s))
%p end:
%p a:= proc(n) option remember; local k; for k from
%p `if`(n=1, 2, 1+a(n-1)) while q(k, {}) do od; k
%p end:
%p seq(a(n), n=1..100);
%t b[n_, s_] := b[n, s] = If[n == 1, 1, Sum[If[p == 1, 0, b[(n - 1)/p, s ~Union~ {p}]], {p, FactorInteger[n - 1][[All, 1]] ~Complement~ s}]];
%t Position[Array[b[#, {}]&, 10^5], 0] // Flatten (* _Jean-François Alcover_, Jul 14 2021, after _Alois P. Heinz_ in A317241 *)
%Y Column k=0 of A317390.
%Y Cf. A180337 (subsequence), A317241.
%K nonn
%O 1,1
%A _Alois P. Heinz_, Jul 24 2018