login
Numbers n such that prime(n) - n is a perfect power.
3

%I #12 Jun 13 2017 01:37:46

%S 1,2,12,15,38,39,100,118,152,190,212,258,352,462,542,690,741,746,1285,

%T 1396,1417,1632,2119,2243,2318,2603,3370,3777,4073,4155,4485,4522,

%U 4600,4719,5317,5446,6697,6748,6985,7144,7520,7595,9492,9551,12010,12985

%N Numbers n such that prime(n) - n is a perfect power.

%e Prime(12) - 12 = 37 - 12 = 25 = 5^2.

%t f[n_] := Prime[n] - n; Select[Range[10^4], ! GCD @@ Last /@ FactorInteger[f[ # ]] == 1 &] (* _Ray Chandler_, May 21 2005 *)

%o (PARI) isA107607(n)=(ispower(prime(n)-n) > 1) || (prime(n)-n == 1) \\ _Michael B. Porter_, Sep 28 2009

%Y Cf. A001597 (perfect powers), A107605, A107606, A107608 (associated prime(n)-n).

%K nonn

%O 1,2

%A _Zak Seidov_, May 17 2005

%E Extended by _Ray Chandler_, May 21 2005