[go: up one dir, main page]

login
A240532
Numbers k such that (k+1)^(k-1) - k is prime.
0
3, 5, 8, 17, 30, 66, 86, 100, 122, 160, 2282, 6508
OFFSET
1,1
COMMENTS
a(13) >= 8394. - J.W.L. (Jan) Eerland, Dec 23 2021
a(13) >= 20000. - Michael S. Branicky, Sep 01 2024
EXAMPLE
3 is in the sequence since (3+1)^(3-1) - 3 = 4^2 - 3 = 13 is prime.
MATHEMATICA
Select[Range[0, 500], PrimeQ[(# + 1)^(# - 1) - #] &].
n=0; Monitor[Parallelize[While[True, If[PrimeQ[(n+1)^(n-1)-n], Print[n]]; n++]; n], n] (* J.W.L. (Jan) Eerland, Dec 23 2021 *)
PROG
(Magma) [n: n in [1..500] | IsPrime((n+1)^(n-1)-n)];
(PARI) is(n)=isprime((n+1)^(n-1)-n) \\ Charles R Greathouse IV, Jun 13 2017
(Python)
from sympy import isprime
def afind(limit, startk=1):
for k in range(startk, limit+1):
if isprime((k+1)**(k-1) - k): print(k, end=", ")
afind(200) # Michael S. Branicky, Aug 17 2021
CROSSREFS
Cf. A238378.
Sequence in context: A374680 A174011 A291223 * A184434 A196140 A336016
KEYWORD
nonn,more
AUTHOR
Vincenzo Librandi, Apr 13 2014
EXTENSIONS
a(11) from Michael S. Branicky, Aug 17 2021
STATUS
approved