login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A234799 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. 1
11, 13, 47, 83, 193, 199, 223, 227, 263, 269, 439, 571, 887, 911, 929, 1013, 1019, 1031, 1151, 1163, 1571, 1597, 1619, 1723, 1733, 1741, 1747, 1759, 1787, 1801, 1907, 2503, 2707, 2741, 3803, 3833, 3863, 4337, 4373, 4409, 5479, 5483, 5519, 5779, 5813, 5843, 5849, 6011 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..48.

EXAMPLE

11 is in the sequence because distances to the nearest square and cube (9 and 8) are prime numbers.

PROG

(Java)

import java.math.*;

public class A234799 {

  public static void main (String[] args) {

    for (long k = 1; ; k++)

      if (BigInteger.valueOf(k).isProbablePrime(50)) {

        long r2 = (long)Math.sqrt(k);

        if (r2*r2==k) continue;

        long r3 = (long)Math.cbrt(k);

        if (r3*r3*r3==k) continue;

        long b2 = r2*r2,    a2 = (r2+1)*(r2+1);

        long b3 = r3*r3*r3, a3 = (r3+1)*(r3+1)*(r3+1);

        long s = (k-b2<=a2-k)? b2 : a2;

        long c = (k-b3<=a3-k)? b3 : a3;

        long nrst2 = Math.abs(s-k);

        long nrst3 = Math.abs(c-k);

        if (s!=c &&

          BigInteger.valueOf(nrst2).isProbablePrime(50) &&

          BigInteger.valueOf(nrst3).isProbablePrime(50))

            System.out.printf("%d, ", k);

      }

  }

}

CROSSREFS

Cf. A000040.

Sequence in context: A154292 A188386 A027450 * A036295 A132201 A057189

Adjacent sequences:  A234796 A234797 A234798 * A234800 A234801 A234802

KEYWORD

nonn

AUTHOR

Alex Ratushnyak, Dec 30 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 22 15:12 EST 2018. Contains 299454 sequences. (Running on oeis4.)