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.

This page as a plain text file.
%I A323741 #69 Feb 03 2022 16:34:26
%S A323741 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,
%T A323741 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,
%U A323741 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
%N A323741 a(n) = m-p where m = (2n+1)^2 and p is the largest prime < m.
%C A323741 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.
%C A323741 Legendre's conjecture implies a(n) <= 4*n.  Oppermann's conjecture implies a(n) <= 2*n. - _Robert Israel_, Sep 04 2019
%C A323741 All terms are even. - _Alois P. Heinz_, Sep 04 2019
%H A323741 Harvey P. Dale, <a href="/A323741/b323741.txt">Table of n, a(n) for n = 1..1000</a>
%F A323741 a(n) = A049711(A016754(n)).
%e A323741 When n=4, m=81, p=79, so a(4) = 81-79 = 2.
%p A323741 seq((2*n+1)^2-prevprime((2*n+1)^2),n=1..100); # _Robert Israel_, Sep 04 2019
%t A323741 mp[n_]:=Module[{m=(2n+1)^2},m-NextPrime[m,-1]]; Array[mp, 100] (* _Harvey P. Dale_, Feb 03 2022 *)
%o A323741 (VBA/Excel)
%o A323741 Sub A323741()
%o A323741 For n = 1 To 100
%o A323741    Cells(n, 1) = (2 * n + 1) ^ 2
%o A323741    k = Cells(n, 1) - 2
%o A323741    k1 = (2 * n - 1) ^ 2 + 2
%o A323741    For p = k To k1 Step -2
%o A323741       IsPrime = True
%o A323741       For i = 2 To Int(Sqr(p))
%o A323741          If p mod i = 0 Then
%o A323741             IsPrime = False
%o A323741             Exit For
%o A323741          End If
%o A323741       Next i
%o A323741       If IsPrime Then
%o A323741          Cells(n, 2) = p
%o A323741          Cells(n, 3) = Cells(n, 1) - Cells(n, 2)
%o A323741          Exit For
%o A323741       End If
%o A323741    Next p
%o A323741 Next n
%o A323741 End Sub
%o A323741 (PARI) a(n) = (2*n+1)^2 - precprime((2*n+1)^2 - 1); \\ _Michel Marcus_, Sep 05 2019
%Y A323741 Cf. A016754, A049711, A088572, A089166, A151799.
%K A323741 nonn
%O A323741 1,1
%A A323741 _Ali Sada_, Sep 03 2019