login
Cubes k such that k-2 is prime.
1

%I #10 Jan 22 2014 18:07:48

%S 729,3375,6859,19683,29791,50653,300763,753571,970299,1295029,1771561,

%T 2146689,2460375,3048625,3442951,4492125,6539203,6751269,8120601,

%U 8869743,9393931,10218313,13997521,17373979,18609625,19034163,21253933,21717639,24137569

%N Cubes k such that k-2 is prime.

%H K. D. Bajpai, <a href="/A236334/b236334.txt">Table of n, a(n) for n = 1..538</a>

%e 729 is in the sequence because 729 = 9^3 and 729-2 = 727 is prime.

%p KD := proc() local a,b; a:=n^3;b:=isprime(a-2); if (b) then RETURN (a);fi; end: seq(KD(), n=0..500);

%t Select[Range[1, 500]^3, PrimeQ[# - 2] &] (* or *) Do[k = n^3; If[PrimeQ[k - 2], Print[k]], {n, 1, 10000}]

%o (PARI) s=[]; for(n=1, 400, if(isprime(n^3-2), s=concat(s, n^3))); s \\ _Colin Barker_, Jan 22 2014

%Y Cf. A000040 (prime numbers), Cf. A000578 (cubes).

%K nonn

%O 1,1

%A _K. D. Bajpai_, Jan 22 2014