%I #23 Aug 02 2024 08:57:27
%S 9,9,27,25,81,125,225,225,361,441,1089,1089,1225,1225,2025,2025,2601,
%T 3249,3249,3375,3721,5041,6859,7569,7921,12321,13689,13689,15129,
%U 18225,21609,21609,30625,31329,38809,42025,47961,53361,59049,65025,65025
%N Terms in A062234 that are powers > 1.
%H Amiram Eldar, <a href="/A111005/b111005.txt">Table of n, a(n) for n = 1..10000</a>
%e a(20) = 2*prime(478) - prime(479) = 2*3391 - 3407 = 3375 = 15^3.
%p with(numtheory); egcd := proc(n) local L; L:=map(proc(z) z[2] end, ifactors(n)[2]); igcd(op(L)) end: PW:=[]: cnt:=0: for z to 1 do for j from 1 to 50000 do x:=2*ithprime(j)-ithprime(j+1); if egcd(x)>1 then cnt:=cnt+1; PW:=[op(PW),[cnt,j,x]] fi od od; PW; map(proc(z) z[3] end, PW);
%t fn[n_]:=2*Prime[n]-Prime[n+1];Select[fn[Range[3,7000]],ResourceFunction["PerfectPowerQ"][#]&] (* _James C. McMahon_, Apr 27 2024 *)
%o (PARI) lista(pmax) = {my(prev = 2, k); forprime(p = 3, pmax, k = 2*prev - p; if(ispower(k), print1(k, ", ")); prev = p);} \\ _Amiram Eldar_, Aug 02 2024
%Y Cf. A062234.
%K nonn
%O 1,1
%A _Walter Kehowski_, Oct 02 2005
%E Title modified by _James C. McMahon_, Apr 27 2024