login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A323741 a(n) = m-p where m = (2n+1)^2 and p is the largest prime < m. 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

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

LINKS

Table of n, a(n) for n=1..100.

FORMULA

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

EXAMPLE

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

MAPLE

seq((2*n+1)^2-prevprime((2*n+1)^2), n=1..100); # Robert Israel, Sep 04 2019

PROG

(VBA/Excel)

Sub A323741()

For n = 1 To 100

   Cells(n, 1) = (2 * n + 1) ^ 2

   k = Cells(n, 1) - 2

   k1 = (2 * n - 1) ^ 2 + 2

   For p = k To k1 Step -2

      IsPrime = True

      For i = 2 To Int(Sqr(p))

         If p mod i = 0 Then

            IsPrime = False

            Exit For

         End If

      Next i

      If IsPrime Then

         Cells(n, 2) = p

         Cells(n, 3) = Cells(n, 1) - Cells(n, 2)

         Exit For

      End If

   Next p

Next n

End Sub

(PARI) a(n) = (2*n+1)^2 - precprime((2*n+1)^2 - 1); \\ Michel Marcus, Sep 05 2019

CROSSREFS

Cf. A016754, A049711, A088572, A089166, A151799.

Sequence in context: A327641 A066874 A087577 * A168281 A203610 A294873

Adjacent sequences:  A323738 A323739 A323740 * A323742 A323743 A323744

KEYWORD

nonn

AUTHOR

Ali Sada, 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 31 02:51 EDT 2020. Contains 334747 sequences. (Running on oeis4.)