cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Labos Elemer, Jul 30 2002

Keywords

Examples

			x=10: p(10)=29,c(10)=18, Mod[29,18]=11 appears first here, so a(11)=10.
		

Crossrefs

Programs

  • 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 *)
  • 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

Formula

a(n) = Min{x; A000040(x) mod A002808(x) = n} = Min{x; A065859(x) = n}.

Extensions

a(24)-a(50) from Michel Marcus, Sep 02 2019
More terms from Giovanni Resta, Sep 03 2019

A073325 a(n) = least k > 0 such that prime(k) == n (mod k).

Original entry on oeis.org

1, 2, 3, 4, 75, 9, 79, 18, 17, 10, 19, 20, 91, 22, 23, 41, 83, 24, 16049, 43, 2711, 94, 25, 26, 95, 198, 449, 452, 99, 50, 451, 48, 453, 1072, 447, 54, 16043, 55, 2719, 56, 459, 57, 101, 472, 100371, 62, 105, 102, 103, 104, 467, 110, 107, 65, 109, 63, 115, 118, 117
Offset: 1

Views

Author

Labos Elemer, Jul 30 2002

Keywords

Comments

First appearance of n-1 in A004648. Are all positive integers present in A004648 and hence in this sequence? - Zak Seidov, Sep 02 2012

Examples

			a(4) = 75 as prime(75) = 379 == 4 (mod 75).
a(44) = 100371 since prime(100371) = 1304867 == 44 (mod 100371) and prime(k) <> 44 (mod k) for k < 100371.
		

Crossrefs

Programs

  • Mathematica
    nn = 60; f[x_] := Mod[Prime[x], x]; t = Table[0, {nn}]; k = 0; While[Times @@ t == 0, k++; n = f[k]; If[n <= nn && t[[n]] == 0, t[[n]] = k]]; Join[{1}, t]
    lk[n_]:=Module[{k=1},While[Mod[Prime[k],k]!=n,k++];k]; Array[lk,60,0] (* Harvey P. Dale, Nov 29 2013 *)
  • PARI
    stop=110000; for(n=0,59,k=1; while(k
    				
  • Python
    from sympy import prime, nextprime
    def A073325(n):
        p, m = prime(n), n
        while p%m != n-1:
            p = nextprime(p)
            m += 1
        return m # Chai Wah Wu, Mar 18 2023

Formula

a(n) = Min{x; Mod[A000040(x), x]=n} = Min{x; A004648[x]=n}.

Extensions

Definition revised by N. J. A. Sloane, Aug 12 2009
A216162 merged into this sequence by T. D. Noe, Sep 07 2012
Showing 1-2 of 2 results.