OFFSET
0,4
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
Robert Israel, Plot of a(n) - prime(n)/4 for n = 1 .. 200000. n == 0, 1, 2, 3 (mod 4) in red, orange, green, blue respectively.
FORMULA
From Robert Israel, Aug 20 2024: (Start)
a(4*k) = Sum_{j=1..k} A001223(4*j-1).
a(4*k + 1) = 1 + Sum_{j=1..k} A001223(4*j).
a(4*k + 2) = Sum_{j=0..k} A001223(4*j+1).
a(4*k + 3) = 1 + Sum_{j=0..k} A001223(4*j+2). (End)
EXAMPLE
a(43) + a(44) + a(45) + a(46) = 63 + 44 + 53 + 39 = 199 = p[46]
MAPLE
f:= proc(n) option remember; ithprime(n) - procname(n-1) - procname(n-2)-procname(n-3) end proc:
f(0):= 0: f(1):= 1: f(2):= 1:
map(f, [$0..100]); # Robert Israel, Aug 20 2024
MATHEMATICA
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}]
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Labos Elemer, Apr 24 2003
STATUS
approved