OFFSET
4,2
COMMENTS
Only these 6 values are not prime numbers up to n=499: 1, 590221, 2807627, 5862793, 39109337, 13116283.
All a(n) are totatives of A002110(n); thus if a(n) < b^2 in the semiprime b*c then a(n) is prime, otherwise a(n) is either prime or semiprime.
FORMULA
a(n) = A002110(n) - A000040(n+1)*prevprime(A002110(n)/A000040(n+1)) for n >= 4. - Michael De Vlieger, May 15 2017
EXAMPLE
Sequence starts at n=4.
For n=5, a(n)=61.
Pn(5): a=2310, b=13, c=173, d=61.
I.e., d = a - (b*c) = 2310 - (13*173) = 2310 - 2249 = 61.
Pn(4): a=210, b=11, c=19, d=1,
Pn(5): a=2310, b=13, c=173, d=61,
Pn(6): a=30030, b=17, c=1759, d=127,
Pn(7): a=510510, b=19, c=26863, d=113,
Pn(8): a=9699690, b=23, c=421717, d=199,
Pn(9): a=223092870, b=29, c=7692851, d=191.
a(n) = a - (b*c) where a(n) has a high probability of being prime, and b*c is the largest semiprime below A002110(n) where b is prime (n+1).
MATHEMATICA
Table[Function[{P, q}, P - NextPrime[P/q, -1] q] @@ {Product[Prime@ i, {i, n}], Prime[n + 1]}, {n, 4, 55}] (* Michael De Vlieger, May 15 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jamie Morken, May 14 2017
STATUS
approved