%I #13 Nov 23 2022 08:57:32
%S 3,2,5,2,7,2,3,2,5,2,13,2,3,2,13,2,19,2,3,2,7,2,5,2,3,2,29,2,5,2,3,2,
%T 73,2,23,2,3,2,29,2,43,2,3,2,47,2,7,2,3,2,37,2,113,2,3,2,11,2,61,2,3,
%U 2,5,2,67,2,3,2,5,2,73,2,3,2,53,2,79,2,3,2,11,2,5,2,3,2,61,2,5,2,3,2
%N a(n) is the least prime factor of 2^n-n-2.
%C a(n) = 2 if n is even.
%C a(n) = 3 if n == 3 (mod 6).
%C a(n) = 5 if n == 5 or 11 (mod 20) and is not divisible by 3.
%C a(n) <= n if n is prime.
%C a(n) = A000247(n) for n = 3 and (subject to confirmation of probable primes) 39137 and 59819. The latter two were discovered by Henri Lifchitz in 2005.
%H Robert Israel, <a href="/A358536/b358536.txt">Table of n, a(n) for n = 3..516</a>
%H R. Israel and R. Fernando, <a href="https://math.stackexchange.com/questions/4581358/primes-2n-n-2">Primes 2^n-n-2</a>, Mathematics StackExchange (2022).
%F a(n) = A020639(A000247(n)).
%e a(5) = 5 because 2^5 - 5 - 2 = 25 has least prime factor 5.
%p f:= proc(n) local F;
%p F:= select(type,map(t -> t[1],ifactors(2^n-n-2,easy)[2]),posint);
%p if F = [] then F:= map(t -> t[1], ifactors(2^n-n-2)[2])) fi;
%p min(F);
%p end proc:
%p map(f, [$3..100]);
%Y Cf. A000247, A020639.
%K nonn
%O 3,1
%A _J. M. Bergot_ and _Robert Israel_, Nov 21 2022