OFFSET
4,1
COMMENTS
MAPLE
A094931 := proc(n)
local p3, p2, p1, p0 ;
p3 := ithprime(n-3) ;
p2 := ithprime(n-2) ;
p1 := ithprime(n-1) ;
p0 := ithprime(n) ;
max(p3-3*p2+p1+p0, 0) ;
end proc:
seq(A094931(n), n=4..50) ; # R. J. Mathar, Nov 15 2019
MATHEMATICA
a=Table[If[(Prime[n-3]+Prime[n-2]+Prime[n-1]+Prime[n])/4-Prime[n-2]>0, 4*((Prime[n-3]+Prime[n-2]+Prime[n-1]+Prime[n])/4-Prime[n-2]), 0], {n, 4, 204}]
If[#<=0, 0, #]&/@(4(Total[#]/4-#[[2]])&/@Partition[Prime[Range[90]], 4, 1]) (* Harvey P. Dale, Mar 02 2015 *)
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Roger L. Bagula, Jun 17 2004
STATUS
approved