login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A114739
a(1) = 1. Smallest prime == 1 (mod n) if n is composite else least composite number ==1 (mod n).
0
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, 53, 109, 29, 30, 31, 32, 97, 67, 103, 71, 37, 38, 191, 79, 41, 42, 43, 44, 89, 181, 47, 48, 97, 197, 101, 103, 53, 54, 109, 331, 113, 229, 59, 60, 61
OFFSET
1,2
PROG
(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
CROSSREFS
Sequence in context: A019880 A021518 A030070 * A240964 A154900 A246546
KEYWORD
nonn,less
AUTHOR
Amarnath Murthy, Nov 15 2005
EXTENSIONS
a(3) corrected and more terms added by Michel Marcus, Sep 17 2013
STATUS
approved