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.

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