%I #20 Jan 07 2024 10:09:02
%S 2,3,5,3,17,3,5,3,97,3,5,3,17,3,5,3,193,3,5,3,17,3,5,3,97,3,5,3,17,3,
%T 5,3,641,3,5,3,17,3,5,3,97,3,5,3,17,3,5,3,193,3,5,3,17,3,5,3,97,3,5,3,
%U 17,3,5,3,769,3,5,3,17,3,5,3,97,3,5,3,17,3,5
%N Smallest prime dividing 8^n + 1.
%C a(n) = 3 if n is odd. a(n) = 5 if n == 2 (mod 4). - _Robert Israel_, Nov 20 2023
%H Max Alekseyev, <a href="/A366671/b366671.txt">Table of n, a(n) for n = 0..16383</a>
%F a(n) = A020639(A062395(n)). - _Paul F. Marrero Romero_, Oct 20 2023
%F a(n) = A002586(3*n) for n >= 1. - _Robert Israel_, Nov 20 2023
%p P1000:= mul(ithprime(i),i= 4..1000):
%p f:= proc(n) local t;
%p if n::odd then return 3 elif n mod 4 = 2 then return 5 fi;
%p t:= igcd(8^n+1,P1000);
%p if t <> 1 then min(numtheory:-factorset(t)) else min(numtheory:-factorset(8^n+1)) fi
%p end proc:
%p map(f, [$0..100]); # _Robert Israel_, Nov 20 2023
%t Table[FactorInteger[8^n + 1][[1,1]], {n, 0, 78}] (* _Paul F. Marrero Romero_, Oct 20 2023 *)
%o (Python)
%o from sympy import primefactors
%o def A366671(n): return min(primefactors((1<<3*n)+1)) # _Chai Wah Wu_, Oct 16 2023
%Y Cf. A002586, A366609, A052536, A366655, A274905, A366670, A038371, A366719.
%K nonn
%O 0,1
%A _Sean A. Irvine_, Oct 15 2023