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!)
A114739 a(1) = 1. Smallest prime == 1 (mod n) if n is composite else least composite number ==1 (mod n). 0

%I #9 Jan 08 2018 01:58:29

%S 1,9,4,5,6,7,8,17,19,11,12,13,14,29,31,17,18,19,20,41,43,23,24,73,101,

%T 53,109,29,30,31,32,97,67,103,71,37,38,191,79,41,42,43,44,89,181,47,

%U 48,97,197,101,103,53,54,109,331,113,229,59,60,61

%N a(1) = 1. Smallest prime == 1 (mod n) if n is composite else least composite number ==1 (mod n).

%o (PARI) a(n) = {if (n == 1, return (1)); k = 1; if (! isprime(n), while (! isprime(k*n+1), k++), while (isprime(k*n+1), k++)); k*n+1;} \\ _Michel Marcus_, Sep 17 2013

%K nonn,less

%O 1,2

%A _Amarnath Murthy_, Nov 15 2005

%E a(3) corrected and more terms added by _Michel Marcus_, Sep 17 2013

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 July 30 23:49 EDT 2024. Contains 374771 sequences. (Running on oeis4.)