login
A033558
a(n) = 2n - {smallest prime > n}.
1
0, 1, 1, 3, 3, 5, 3, 5, 7, 9, 9, 11, 9, 11, 13, 15, 15, 17, 15, 17, 19, 21, 17, 19, 21, 23, 25, 27, 27, 29, 25, 27, 29, 31, 33, 35, 33, 35, 37, 39, 39, 41, 39, 41, 43, 45, 41, 43, 45, 47, 49, 51, 47, 49, 51, 53, 55, 57
OFFSET
1,4
COMMENTS
By Bertrand's postulate, for n>3 a(n)>2. - Zak Seidov, Mar 06 2015
MAPLE
f := n->2*n-nextprime(n); [ seq(f(i), i=1..60) ];
MATHEMATICA
Table[2*n-NextPrime[n], {n, 60}] (* Harvey P. Dale, Jul 23 2018 *)
PROG
(PARI) vector(60, n, 2*n - nextprime(n + 1)) \\ Zak Seidov, Mar 06 2015
CROSSREFS
Cf. A151800 (least prime > n).
Sequence in context: A078587 A335074 A239931 * A046217 A057662 A015971
KEYWORD
nonn
AUTHOR
STATUS
approved