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-5 of 5 results.

A079953 Smallest prime p such that prime(n) mod 2*p = prime(n).

Original entry on oeis.org

2, 2, 3, 5, 7, 7, 11, 11, 13, 17, 17, 19, 23, 23, 29, 29, 31, 31, 37, 37, 37, 41, 43, 47, 53, 53, 53, 59, 59, 59, 67, 67, 71, 71, 79, 79, 79, 83, 89, 89, 97, 97, 97, 97, 101, 101, 107, 113, 127, 127, 127, 127, 127, 127, 131, 137, 137, 137, 139, 149, 149, 149, 157, 157
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 19 2003

Keywords

Comments

a(n) is smallest prime greater than prime(n)/2. - Peter Munn, Sep 18 2017

Examples

			n=6: prime(6)=13 and 13 mod(2*2)=1, 13 mod(2*3)=1, 13 mod(2*5)=3, 13 mod(2*7)=13, therefore a(6)=7.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = 2}, While[Prime@ n != Mod[Prime@ n, 2 p], p = NextPrime@ p]; p]; Array[f, 64] (* Michael De Vlieger, Mar 17 2015 *)
  • PARI
    a(n,q=prime(n))=nextprime(q/2) \\ Charles R Greathouse IV, Mar 17 2015

Formula

T(n, A049084(a(n))) = A000040(n), T defined as in A079950.
a(n) = nextprime(prime(n)/2) ~ (n log n)/2. - Charles R Greathouse IV, Mar 17 2015
Conjecture: a(n) = A039734(n), n>=2. - R. J. Mathar, May 03 2021

A039733 a(n)=k such that prime(k) is the prime q

Original entry on oeis.org

1, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 14, 15, 16, 16, 16, 17, 17, 17, 19, 19, 20, 20, 22, 22, 22, 23, 24, 24, 25, 25, 25, 25, 26, 26, 28, 30, 31, 31, 31, 31, 31, 31, 32, 33, 33, 33, 34, 35, 35, 35, 37, 37, 37
Offset: 2

Views

Author

Keywords

Crossrefs

Cf. A039734.

Programs

  • Mathematica
    {1}~Join~Reap[Do[d = 2; r = 0; p = Prime[n];
    While[Set[s, Mod[p, Set[q, NextPrime[p/d]] ]]; If[s > r, r = s]; r < q,
    d++; If[r == s, Sow[PrimePi@ q]]], {n, 3, 1000}] ][[-1, 1]] (* Michael De Vlieger, Feb 06 2024 *)
  • PARI
    a(n) = {thek = 0; modmax = 0; pr = prime(n); for(k = 1, n-1, mq = pr % prime(k); if (mq > modmax, modmax = mq; thek = k);); thek;} \\ Michel Marcus, Oct 02 2013

A336298 Greatest prime < prime(n)/2.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 11, 13, 13, 17, 19, 19, 23, 23, 29, 29, 31, 31, 31, 37, 41, 43, 47, 47, 47, 53, 53, 53, 61, 61, 67, 67, 73, 73, 73, 79, 83, 83, 89, 89, 89, 89, 97, 97, 103, 109, 113, 113, 113, 113, 113, 113, 127, 131, 131, 131, 137, 139, 139, 139, 151, 151
Offset: 3

Views

Author

Clark Kimberling, Nov 16 2020

Keywords

Comments

The n-th prime appears A102820(n) times. - Flávio V. Fernandes, Apr 08 2021
A080191 lists the distinct terms of this sequence. - Flávio V. Fernandes, Jun 19 2021

Examples

			Prime(3)/2 = 2.5, so a(3) = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 120; t = Table[NextPrime[Prime[n]/2], {n, 3, z}]; (* A039734, A079953 *)
    u = NextPrime[t, -1]  (* A336298 *)
    t - u (* A336299 *)
    Table[NextPrime[Prime[n]/2, -1], {n, 3, 80}] (* Wesley Ivan Hurt, Nov 26 2020 *)
  • PARI
    a(n) = precprime(prime(n)/2); \\ Michel Marcus, Nov 16 2020
    
  • Python
    from sympy import prime, prevprime
    def A336298(n):
        return prevprime(prime(n)//2+1) # Chai Wah Wu, Nov 26 2020

Formula

a(n) = A151799(A000040(n)/2) for n >= 3. - Wesley Ivan Hurt, Nov 26 2020

A336299 (Least prime > prime(n)/2) - (greatest prime < prime(n)/2).

Original entry on oeis.org

1, 2, 2, 2, 4, 4, 2, 4, 4, 2, 4, 4, 6, 6, 2, 2, 6, 6, 6, 4, 2, 4, 6, 6, 6, 6, 6, 6, 6, 6, 4, 4, 6, 6, 6, 4, 6, 6, 8, 8, 8, 8, 4, 4, 4, 4, 14, 14, 14, 14, 14, 14, 4, 6, 6, 6, 2, 10, 10, 10, 6, 6, 6, 6, 4, 6, 6, 6, 6, 2, 10, 10, 10, 2, 4, 2, 12, 12, 12, 12, 12
Offset: 3

Views

Author

Clark Kimberling, Nov 16 2020

Keywords

Examples

			Prime(3)/2 = 2.5, so that a(3) = 3 - 2 = 1.
Prime(4)/2 = 3.5, so that a(4) = 5 - 3 = 2.
		

Crossrefs

Programs

  • Mathematica
    z = 120; t = Table[NextPrime[Prime[n]/2], {n, 3, z}]; (* cf. A039734, A079953 *)
    u = NextPrime[t, -1]  (* A336298 *)
    t - u  (* A336299 *)
  • PARI
    a(n) = my(x=prime(n)/2); nextprime(x) - precprime(x); \\ Michel Marcus, Nov 18 2020

A039739 a(n)=2*q-prime(n), where q is the prime < p(n) for which (prime(n) mod q) is maximal.

Original entry on oeis.org

1, 1, 3, 3, 1, 5, 3, 3, 5, 3, 1, 5, 3, 11, 5, 3, 1, 7, 3, 1, 3, 3, 5, 9, 5, 3, 11, 9, 5, 7, 3, 5, 3, 9, 7, 1, 3, 11, 5, 15, 13, 3, 1, 5, 3, 3, 3, 27, 25, 21, 15, 13, 3, 5, 11, 5, 3, 1, 17, 15, 5, 7, 3, 1, 9, 3, 9, 11, 9, 5, 3, 15, 9, 3, 3, 5, 1, 21, 13, 3, 1
Offset: 2

Views

Author

Keywords

Programs

  • Maple
    A039739 := proc(n)
        local p,maxmod,q,qpiv ;
        p := ithprime(n) ;
        for j from 1 to n-1 do
            q := ithprime(j) ;
            if j = 1 then
                qpiv := q ;
                maxmod := modp(p,q) ;
            else
                if modp(p,q) > maxmod then
                    maxmod := modp(p,q) ;
                    qpiv := q ;
                end if;
            end if;
        end do:
        2*qpiv-p ;
    end proc:
    seq(A039739(n),n=2..80) ; # R. J. Mathar, May 03 2021

Formula

a(n) = 2*A039734(n)-prime(n). - R. J. Mathar, May 03 2021
Showing 1-5 of 5 results.