Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #6 Jan 02 2014 06:19:32
%S 11,13,47,83,193,199,223,227,263,269,439,571,887,911,929,1013,1019,
%T 1031,1151,1163,1571,1597,1619,1723,1733,1741,1747,1759,1787,1801,
%U 1907,2503,2707,2741,3803,3833,3863,4337,4373,4409,5479,5483,5519,5779,5813,5843,5849,6011
%N Primes p such that abs(p-s) and abs(p-c) are primes, where s is the square nearest to p, and c is the nearest to p cube, c!=s.
%e 11 is in the sequence because distances to the nearest square and cube (9 and 8) are prime numbers.
%o (Java)
%o import java.math.*;
%o public class A234799 {
%o public static void main (String[] args) {
%o for (long k = 1; ; k++)
%o if (BigInteger.valueOf(k).isProbablePrime(50)) {
%o long r2 = (long)Math.sqrt(k);
%o if (r2*r2==k) continue;
%o long r3 = (long)Math.cbrt(k);
%o if (r3*r3*r3==k) continue;
%o long b2 = r2*r2, a2 = (r2+1)*(r2+1);
%o long b3 = r3*r3*r3, a3 = (r3+1)*(r3+1)*(r3+1);
%o long s = (k-b2<=a2-k)? b2 : a2;
%o long c = (k-b3<=a3-k)? b3 : a3;
%o long nrst2 = Math.abs(s-k);
%o long nrst3 = Math.abs(c-k);
%o if (s!=c &&
%o BigInteger.valueOf(nrst2).isProbablePrime(50) &&
%o BigInteger.valueOf(nrst3).isProbablePrime(50))
%o System.out.printf("%d, ", k);
%o }
%o }
%o }
%Y Cf. A000040.
%K nonn
%O 1,1
%A _Alex Ratushnyak_, Dec 30 2013