A323741 a(n) = m-p where m = (2n+1)^2 and p is the largest prime < m.
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
Keywords
Examples
When n=4, m=81, p=79, so a(4) = 81-79 = 2.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
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
Comments