proposed
approved
proposed
approved
editing
proposed
<a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,3,-3,-3,3,1,-1).
G.f.: x*(2 + 2*x + 3*x^2 + x^3 - x^4)/((1 - x)^4*(1 + x)^3). - Stefano Spezia, Aug 19 2022
nonn,easy,changed
proposed
editing
editing
proposed
import math
def a(n): return (n * math.ceil((n + n % 2) // 2)) + (15 + 25*n + 15*(n**2) + 14*(n**3) - 3*(((-1)**n))*(5 + n*(3 + n))) // 96
proposed
editing
editing
proposed
Sum of numbers in n-th upward diagonal of triangle the sum of {1; 2,3; 4,5,6; 7,8,9,10; ...} and {1; 2,3; 3,4,5; 4,5,6,7; ...}.
proposed
editing
editing
proposed
def a(n): return (n * math.ceil(n/2)) + (15 + 25*n + 15*(n**2) + 14*(n**3) - 3*(((-1)**n))*(5 + n*(3 + n))) // 96
def a(n) = : (n * math.ceil(n/2)) + (15 + 25*n + 15*(n**2) + 14*(n**3) - 3*(((-1)**n))*(5 + n*(3 + n))) // 96