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!)
A073324 Smallest x such that prime(x) mod c(x) = n, where prime(j) is the j-th prime, c(j) is the j-th composite number. 4
5, 1, 2, 8, 3, 242, 4, 245, 100, 8313, 10, 50190, 23, 8338, 3390, 12, 24, 308926, 13, 49, 25, 15, 26, 12556637, 112, 55, 117, 58, 56, 1400, 59, 265, 122, 267, 31, 12556641, 603, 270, 33, 12556639, 126, 272, 65, 66, 127, 63, 35, 50270, 37, 1413, 129, 1434, 38, 1411 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = Min{x; A000040(x) mod A002808(x) = n} = Min{x; A065859(x) = n}.
EXAMPLE
x=10: p(10)=29,c(10)=18, Mod[29,18]=11 appears first here, so a(11)=10.
MATHEMATICA
f[x_] := Mod[Prime[x], FixedPoint[x+PrimePi[ # ]+1&, x]] t=Table[0, {256}]; Do[s=f[n]; If[s<257&&t[[s]]==0, t[[s]]=n], {n, 1, 400000}]; t
Module[{nn=500000, cmps, prs, len}, cmps=Select[Range[nn], CompositeQ]; len= Length[ cmps]; Table[SelectFirst[Thread[{Range[len], Prime[Range[len]], cmps}], Mod[#[[2]], #[[3]]] ==n&], {n, 23}]][[All, 1]] (* The program generates the first 23 terms of the sequence. *) (* Harvey P. Dale, Nov 26 2022 *)
PROG
(PARI) isc(n) = (n != 1) && !isprime(n);
lista(nn) = {my(vp = primes(nn), vc = select(x->isc(x), [1..nn])); for (n=1, 50, my(k=1); while((vp[k] % vc[k]) != n, k++; if ((k>#vp) || (k>#vc), return)); print1(k, ", "); ); } \\ Michel Marcus, Sep 02 2019
(PARI) a(n) = my(p=2); forcomposite(c=4, oo, if(p % c == n, return(primepi(p))); p = nextprime(p+1)); \\ Daniel Suteu, Sep 02 2019
CROSSREFS
Sequence in context: A144738 A371849 A021199 * A021665 A226613 A274989
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 30 2002
EXTENSIONS
a(24)-a(50) from Michel Marcus, Sep 02 2019
More terms from Giovanni Resta, Sep 03 2019
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 September 15 19:05 EDT 2024. Contains 375954 sequences. (Running on oeis4.)