%I #18 Aug 27 2024 09:14:54
%S 4,9,25,49,81,169,243,361,729,841,1369,1849,2209,2401,3721,5041,6859,
%T 7921,10609,11449,14641,16129,17161,19321,19683,28561,29791,29929,
%U 36481,44521,49729,50653,54289,57121,66049,85849,97969,113569,128881
%N Prime powers p^w (w >= 2) such that p^w-2 is prime.
%C Terms k of A025475 such that k - 2 is prime.
%H Amiram Eldar, <a href="/A053704/b053704.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A053705(n) + 2. - _Amiram Eldar_, Aug 27 2024
%e 4 = 2^2 is a term since 4-2 = 2 is prime.
%e 243 = 3^5 is a term because 241 is prime.
%t Select[Range[130000],!PrimeQ[#]&&PrimePowerQ[#]&&PrimeQ[#-2]&] (* _Harvey P. Dale_, Oct 07 2020 *)
%t seq[max_] := Module[{s = {}, p = 2}, While[p^2 <= max, s = Join[s, Select[p^Range[2, Floor[Log[p, max]]], PrimeQ[# - 2] &]]; p = NextPrime[p]]; Union[s]]; seq[150000] (* _Amiram Eldar_, Aug 27 2024 *)
%Y Cf. A025475, A053705.
%K nonn
%O 1,1
%A _Labos Elemer_, Feb 14 2000
%E Definition clarified by _Harvey P. Dale_, Oct 07 2020