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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A239475 Least number k such that k^n + n and k^n - n are both prime, or 0 if no such number exists. 0
4, 3, 2, 0, 42, 175, 66, 3, 2, 4983, 1770, 55055, 28686, 18765, 8456, 0, 594, 128345, 136080, 81, 92, 1163409, 18810, 10415, 11754, 3855, 0, 86043, 38880, 17639, 26088, 37293, 5540, 612015, 6876, 0, 44220, 130425, 110, 9292527, 1004850, 1812149, 442404, 1007445, 570658 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

a(n) = 0 iff n is of the form (pk)^p for some k and some prime p (See A097764).

gcd(n,a(n)) = 1 for all a(n) > 0.

LINKS

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

FORMULA

a(A097764(n)) = 0 for all n.

EXAMPLE

1^1 +/- 1 = 2 and 0 are not both primes. 2^1 +/- 1 = 3 and 1 are not both primes. 3^1 +/- 1 = 4 and 2 are not both primes. 4^1 +/- 1 = 5 and 3 are both primes. Thus a(1) = 4.

PROG

(Python)

import sympy

from sympy import isprime

def TwoBoth(x):

..for k in range(1, 10**7):

....if isprime(k**x+x) and isprime(k**x-x):

......return k

x = 1

while x < 100:

..if TwoBoth(x) != None:

....print(TwoBoth(x))

..else:

....print(0)

..x += 1

(PARI) a(n)=for(k=1, 10^7, if(ispseudoprime(k^n-n)&&ispseudoprime(k^n+n), return(k)))

n=1; while(n<100, print1(a(n), ", "); n++)

CROSSREFS

Cf. A072883, A028870, A153974, A239413, A239414, A239415, A239416, A239417, A239418, A239474.

Sequence in context: A258692 A067018 A200233 * A100802 A022960 A023446

Adjacent sequences:  A239472 A239473 A239474 * A239476 A239477 A239478

KEYWORD

nonn

AUTHOR

Derek Orr, Mar 20 2014

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 September 25 16:31 EDT 2017. Contains 292499 sequences.