login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A108879 Numbers n such that (n-1)*n^n+1 is prime. 2

%I #18 Sep 08 2022 08:45:19

%S 2,4,20,93,100,1536,2835

%N Numbers n such that (n-1)*n^n+1 is prime.

%e 2 is in the sequence because (2-1)*2^2+1 = 1*2^2+1 = 4+1 = 5, which is prime.

%t Select[Range[1000], PrimeQ[(# - 1) #^# + 1] &] (* _Vincenzo Librandi_, Oct 23 2014 *)

%o (PARI) isok(n) = isprime((n-1)*n^n+1); \\ _Michel Marcus_, Oct 23 2014

%o (Magma) [n: n in [1..1000] |IsPrime((n-1)*n^n+1)]; // _Vincenzo Librandi_, Oct 23 2014

%o (Python)

%o from sympy import isprime

%o def afind(limit, startk=0):

%o for k in range(startk, limit+1):

%o if isprime((k-1)*k**k + 1):

%o print(k, end=", ")

%o afind(200) # _Michael S. Branicky_, Jan 01 2022

%Y Cf. A108318.

%K hard,more,nonn

%O 1,1

%A _Ray G. Opao_, Jul 14 2005

%E a(7) from _Michael S. Branicky_, Jan 01 2022

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 13:40 EDT 2024. Contains 371792 sequences. (Running on oeis4.)