login
For n >= 3, a(n-3) + a(n-2) + a(n-1) + a(n) = prime(n); a(0) = 0, a(1) = 1, a(2) = 1.
2

%I #17 Aug 21 2024 05:40:41

%S 0,1,1,3,2,5,3,7,4,9,9,9,10,13,11,13,16,19,13,19,20,21,19,23,26,29,23,

%T 25,30,31,27,39,34,37,29,49,36,43,35,53,42,49,37,63,44,53,39,75,56,57,

%U 41,79,62,59,51,85,68,65,53,91,72,67,63,105,76,69,67,119

%N For n >= 3, a(n-3) + a(n-2) + a(n-1) + a(n) = prime(n); a(0) = 0, a(1) = 1, a(2) = 1.

%H Robert Israel, <a href="/A083242/b083242.txt">Table of n, a(n) for n = 0..10000</a>

%H Robert Israel, <a href="/A083242/a083242.png">Plot of a(n) - prime(n)/4</a> for n = 1 .. 200000. n == 0, 1, 2, 3 (mod 4) in red, orange, green, blue respectively.

%F From _Robert Israel_, Aug 20 2024: (Start)

%F a(4*k) = Sum_{j=1..k} A001223(4*j-1).

%F a(4*k + 1) = 1 + Sum_{j=1..k} A001223(4*j).

%F a(4*k + 2) = Sum_{j=0..k} A001223(4*j+1).

%F a(4*k + 3) = 1 + Sum_{j=0..k} A001223(4*j+2). (End)

%e a(43) + a(44) + a(45) + a(46) = 63 + 44 + 53 + 39 = 199 = p[46]

%p f:= proc(n) option remember; ithprime(n) - procname(n-1) - procname(n-2)-procname(n-3) end proc:

%p f(0):= 0: f(1):= 1: f(2):= 1:

%p map(f, [$0..100]); # _Robert Israel_, Aug 20 2024

%t f[x_] := Prime[x]-f[x-1]-f[x-2]-f[x-3] {f[0]=0, f[1]=1, f[2]=1}; Table[f[w], {w, 0, 20}]

%Y Cf. A001223, A034467, A073737, A014687, A083240.

%K nonn,look

%O 0,4

%A _Labos Elemer_, Apr 24 2003