login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers added to cumulative correction term in order for prime numbers to resemble a recursive sequence.
0

%I #19 Aug 17 2024 23:19:24

%S 0,1,0,4,2,4,2,0,8,2,4,8,2,0,4,10,2,4,8,0,4,4,2,10,10,2,4,2,-8,14,12,

%T 8,-2,10,6,2,8,4,4,10,-2,10,8,4,-6,2,20,14,2,0,8,-2,6,10,6,10,2,4,8,

%U -4,-2,20,16,2,-8,12,10,14,8,0,2,8,8,8,4,2,10,4,2,16,2,10

%N Numbers added to cumulative correction term in order for prime numbers to resemble a recursive sequence.

%C 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.

%F a(n) = 2*prime(n+1) - prime(n+2) - prime(n-1), for n>=2.

%F a(n) = A096379(n) - A096379(n-1), for n>=2.

%F prime(n+2) = prime(n+1) + prime(n) - Sum_{i=1..n} a(i)

%F a(n) = prime(n+1) + prime(n) - prime(n+2) - Sum_{i=0..n-1} a(i).

%e 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.

%e 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.

%e 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.

%o (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

%Y Cf. A096379 (partial sums), A066495 (indices of 0's).

%K sign,easy

%O 1,4

%A _Kaleb Williams_, Jul 29 2024