login
a(n) = smallest prime greater than the smallest prime dividing n.
5

%I #12 Feb 06 2019 00:01:37

%S 2,3,5,3,7,3,11,3,5,3,13,3,17,3,5,3,19,3,23,3,5,3,29,3,7,3,5,3,31,3,

%T 37,3,5,3,7,3,41,3,5,3,43,3,47,3,5,3,53,3,11,3,5,3,59,3,7,3,5,3,61,3,

%U 67,3,5,3,7,3,71,3,5,3,73,3,79,3,5,3,11,3,83,3,5,3,89,3,7,3,5,3,97,3,11,3,5

%N a(n) = smallest prime greater than the smallest prime dividing n.

%C All even-indexed terms are 3.

%H Michael De Vlieger, <a href="/A117367/b117367.txt">Table of n, a(n) for n = 1..10000</a>

%e 5 is the smallest prime dividing 35. So a(35) is the smallest prime > 5, which is 7.

%p with(numtheory): a:=proc(n): if n=1 then 2 else nextprime(factorset(n)[1]) fi: end: seq(a(n),n=1..100); # _Emeric Deutsch_, Apr 22 2006

%t Table[NextPrime[FactorInteger[n][[1, 1]]], {n, 93}] (* _Michael De Vlieger_, Sep 16 2017 *)

%Y Cf. A117364, A117365, A117366.

%K nonn

%O 1,1

%A _Leroy Quet_, Mar 10 2006

%E More terms from _Emeric Deutsch_, Apr 22 2006