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.

A323741 a(n) = m-p where m = (2n+1)^2 and p is the largest prime < m.

Original entry on oeis.org

2, 2, 2, 2, 8, 2, 2, 6, 2, 2, 6, 6, 2, 2, 8, 2, 2, 2, 10, 12, 2, 8, 2, 2, 8, 6, 2, 20, 12, 2, 2, 6, 6, 2, 2, 6, 2, 2, 12, 8, 6, 6, 8, 2, 8, 2, 12, 6, 10, 8, 2, 22, 2, 14, 20, 6, 6, 2, 2, 2, 8, 6, 2, 8, 2, 6, 2, 12, 2, 14, 6, 2, 8, 8, 14, 10, 2, 18, 20, 2, 8, 14, 6, 2, 10, 2, 32, 2, 12, 12, 2, 8, 6, 44, 2, 6, 14, 6, 20, 14
Offset: 1

Views

Author

Ali Sada, Sep 03 2019

Keywords

Comments

a(n) cannot be a square: suppose a(n) = k^2; then p=m-a(n) could be factored as (2n+k-1)*(2n-k-1); hence it would not be a prime.
Legendre's conjecture implies a(n) <= 4*n. Oppermann's conjecture implies a(n) <= 2*n. - Robert Israel, Sep 04 2019
All terms are even. - Alois P. Heinz, Sep 04 2019

Examples

			When n=4, m=81, p=79, so a(4) = 81-79 = 2.
		

Crossrefs

Programs

  • Maple
    seq((2*n+1)^2-prevprime((2*n+1)^2),n=1..100); # Robert Israel, Sep 04 2019
  • Mathematica
    mp[n_]:=Module[{m=(2n+1)^2},m-NextPrime[m,-1]]; Array[mp, 100] (* Harvey P. Dale, Feb 03 2022 *)
  • PARI
    a(n) = (2*n+1)^2 - precprime((2*n+1)^2 - 1); \\ Michel Marcus, Sep 05 2019

Formula

a(n) = A049711(A016754(n)).