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!)
A360789 Least prime p such that p mod primepi(p) = n. 2
2, 3, 5, 7, 379, 23, 401, 61, 59, 29, 67, 71, 467, 79, 83, 179, 431, 89, 176557, 191, 24419, 491, 97, 101, 499, 1213, 3169, 3191, 523, 229, 3187, 223, 3203, 8609, 3163, 251, 176509, 257, 24509, 263, 3253, 269, 547, 3347, 1304867, 293 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
Inspired by A048891.
LINKS
FORMULA
a(n) = prime(A073325(n+1)). - Kevin Ryde, Feb 21 2023
EXAMPLE
For n=0, prime p=2 has p mod primepi(p) = 2 mod 1 = 0 so that a(0) = 2.
For n=4, no prime has p mod primepi(p) = 4 until reaching p=379 which is 379 mod 75 = 4, so that a(4) = 379.
MAPLE
V:= Array(0..100): count:= 0:
p:= 1:
for k from 1 while count < 101 do
p:= nextprime(p);
v:= p mod k;
if v <= 100 and V[v] = 0 then V[v]:= p; count:= count+1 fi;
od:
convert(V, list); # Robert Israel, Feb 28 2023
MATHEMATICA
t[_] := 0; p = 2; pi = 1; While[p < 1400000, m = Mod[p, pi]; If[m < 100 && t[m] == 0, t[m] = p]; p = NextPrime@p; pi++]; t /@ Range[0, 99]
PROG
(PARI) a(n)={my(k=n); forprime(p=prime(n+1), oo, k++; if(p%k ==n, return(p)))} \\ Andrew Howroyd, Feb 21 2023
(Python)
from sympy import prime, nextprime
def A360789(n):
p, m = prime(n+1), n+1
while p%m != n:
p = nextprime(p)
m += 1
return p # Chai Wah Wu, Mar 18 2023
CROSSREFS
Sequence in context: A045336 A083183 A046477 * A145843 A090720 A114780
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Feb 20 2023
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 May 5 18:06 EDT 2024. Contains 372277 sequences. (Running on oeis4.)