login
A129146
a(n) = n-th odd prime minus n-th odd composite number.
3
-6, -10, -14, -14, -14, -16, -16, -16, -16, -18, -14, -14, -14, -16, -12, -10, -14, -10, -10, -12, -8, -8, -4, 2, 2, -2, -4, -6, -4, 8, 10, 14, 14, 20, 18, 22, 22, 24, 28, 32, 28, 36, 34, 36, 34, 42, 52, 52, 52, 50, 54, 54, 62, 62, 62, 66, 66, 70, 72, 70, 78, 90, 92, 92, 92, 100, 102, 110, 106, 108, 112, 118, 120, 124, 124, 128
OFFSET
1,1
COMMENTS
For small n's, a(n) is negative, while for large n's, a(n) is positive.
FORMULA
a(n) = A065091(n) - A071904(n).
PROG
(Python)
from sympy import primepi, prime
def A129146(n):
if n == 1: return -6
m, k = n, primepi(n) + n + (n>>1)
while m != k:
m, k = k, primepi(k) + n + (k>>1)
return prime(n+1)-m # Chai Wah Wu, Aug 01 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Zak Seidov, Apr 01 2007
STATUS
approved