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.

Showing 1-3 of 3 results.

A187602 Primes of the form (k+1)^(k-1) + k.

Original entry on oeis.org

2, 5, 19, 1301, 262151, 4782977
Offset: 1

Views

Author

Marco RipĂ , Mar 11 2011

Keywords

Comments

The next terms are too large to be displayed:
a(7) = 159^157 + 158 (k = 158), which is 346 digits long.
a(8) = 537^535 + 536 (k = 536), which is 1461 digits long.
a(9) = 4671^4669 + 4670 (k = 4670), which is 17133 digits long.
a(10) = 9796^9794 + 9795 (k = 9795), which is 39089 digits long.
Next term has k >= 30000.

Examples

			1301 is in the sequence since it is prime and, using k = 5, (k+1)^(k-1) + k = 6^4 + 5 = 1296 + 5 = 1301.
		

Crossrefs

Cf. A238378 (corresponding k).

Programs

  • Mathematica
    Do[p=(n+1)^(n-1)+n; If[PrimeQ[p], Print[p]], {n, 250}]
  • PARI
    lista(nn) = for(k=1, nn, if(ispseudoprime(q=(k+1)^(k-1)+k), print1(q, ", "))); \\ Jinyuan Wang, Mar 01 2020

Extensions

a(8)-a(10) from Matevz Markovic, Mar 03 2014

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

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

Original entry on oeis.org

3, 4, 5, 7, 10, 11, 21, 46, 59, 839, 21920
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 23 2025

Keywords

Comments

The corresponding primes are 13, 239, 4091, 1679609, 31381059599, 999999999989, 41943039999999999999999999979, ...

Crossrefs

Programs

  • Magma
    [k: k in [2..500] | IsPrime((k-1)^(k+1)-k)];
  • Mathematica
    Select[Range[1000], PrimeQ[(#-1)^(#+1)-#] &] (* Stefano Spezia, Mar 30 2025 *)

Extensions

a(11) from Michael S. Branicky, Mar 25 2025
Showing 1-3 of 3 results.