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

 

Logo

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 60, we have over 367,000 sequences, and we’ve crossed 11,000 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A186102 Smallest prime p such that p == n (mod prime(n)). 4
3, 2, 3, 11, 5, 19, 7, 103, 101, 97, 11, 197, 13, 229, 109, 281, 17, 79, 19, 233, 167, 101, 23, 113, 607, 127, 233, 349, 29, 821, 31, 163, 307, 173, 631, 1093, 37, 853, 373, 1597, 41, 223, 43, 1009, 439, 643, 47, 271, 503, 2111, 983, 769, 53, 1811, 569, 2423 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) = n iff n is prime.
LINKS
EXAMPLE
Eighth prime is 19, and 103 is the smallest prime p such that p mod 19 is 8. Therefore a(8) = 103.
MATHEMATICA
k=200; Table[p=Prime[n]; m=n; While[!PrimeQ[m], m=m+p]; m, {n, k}]; (* For the first k terms. Zak Seidov, Dec 13 2013 *)
Flatten[With[{prs=Prime[Range[500]]}, Table[Select[prs, Mod[#, Prime[n]] == n&, 1], {n, 60}]]] (* Harvey P. Dale, Mar 30 2012 *)
PROG
(Magma) Aux:=function(n); q:=NthPrime(n); p:=2; while p mod q ne n do p:=NextPrime(p); end while; return p; end function; [ Aux(n): n in [1..70] ]; // Klaus Brockhaus, Feb 12 2011
(Sage) def A186102(n): np = nth_prime(n); return next(p for p in Primes() if p % np == n) # [D. S. McNeil, Feb 13 2011]
(Haskell)
a186102 n = f a000040_list where
f (q:qs) = if (q - n) `mod` (a000040 n) == 0 then q else f qs
-- Reinhard Zumkeller, Aug 21 2015
CROSSREFS
Sequence in context: A118064 A292024 A290093 * A170848 A078017 A343170
KEYWORD
nonn
AUTHOR
Zak Seidov, Feb 12 2011
STATUS
approved

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 December 2 09:50 EST 2023. Contains 367517 sequences. (Running on oeis4.)