cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A240532 Numbers k such that (k+1)^(k-1) - k is prime.

Original entry on oeis.org

3, 5, 8, 17, 30, 66, 86, 100, 122, 160, 2282, 6508
Offset: 1

Views

Author

Vincenzo Librandi, Apr 13 2014

Keywords

Comments

a(13) >= 8394. - J.W.L. (Jan) Eerland, Dec 23 2021
a(13) >= 20000. - Michael S. Branicky, Sep 01 2024

Examples

			3 is in the sequence since (3+1)^(3-1) - 3 = 4^2 - 3 = 13 is prime.
		

Crossrefs

Cf. A238378.

Programs

  • Magma
    [n: n in [1..500] | IsPrime((n+1)^(n-1)-n)];
    
  • 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 *)
  • 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

Extensions

a(11) from Michael S. Branicky, Aug 17 2021