OFFSET
1,1
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
a(n) = k*floor((n+k-1)/k)-(n-1) mod k; k=4, n=1, 2, ...
a(n) = n-cos(n*pi)-2*sqrt(2)*cos((2*n+1)*pi/4). - Jaume Oliver Lafont, Dec 10 2008
G.f.: x*( 4-x-x^2-x^3+3*x^4 ) / ( (1+x)*(1+x^2)*(1-x)^2 ). - R. J. Mathar, Apr 02 2011
MATHEMATICA
With[{k=4}, Table[k Floor[(n+k-1)/k]-Mod[n-1, k], {n, 1, 10k}]]
Reverse/@Partition[Range[100], 4]//Flatten (* or *) LinearRecurrence[ {1, 0, 0, 1, -1}, {4, 3, 2, 1, 8}, 100] (* Harvey P. Dale, Mar 02 2020 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Jan 20 2006
EXTENSIONS
More terms from Harvey P. Dale, Mar 02 2020
STATUS
approved