OFFSET
1,4
COMMENTS
At n=1, prime(n+2) = prime(n+1) + prime(n) but thereafter such a form must be reduced by a "correction" amount prime(n+2) = prime(n+1) + prime(n) - A096379(n), and the present sequence is how that correction changes.
FORMULA
EXAMPLE
For n = 1: a(1) = p_2 + p_1 - p_3 - (Sum_{i <= 0} a(i)) = p_2 + p_1 - p_3 ==> a(1) = 3 + 2 - 5 = 0 ==> a(1) = 0.
For n = 2: a(2) = p_3 + p_2 - p_4 - (Sum_{i <= 1} a(i)) = p_3 + p_2 - p_4 - a(1) ==> a(2) = 5 + 3 - 7 - 0 = 1 ==> a(2) = 1.
For n = 3: a(3) = p_4 + p_3 - p_5 - (Sum_{i <= 2} a(i)) = p_4 + p_3 - p_5 - (a(1) + a(2)) ==> a(3) = 7 + 5 - 11 - (0 + 1) = 0 ==> a(3) = 0.
PROG
(PARI) lista(nn) = my(va = vector(nn)); for (n=1, nn, va[n] = prime(n+1) + prime(n) - prime(n+2) - sum(i=1, n-1, va[i]); ); va; \\ Michel Marcus, Jul 30 2024
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Kaleb Williams, Jul 29 2024
STATUS
approved