OFFSET
1,1
COMMENTS
Also numbers m such that floor(1+(m/4)) mod 4 = 0.
Partial sums of the sequence 12,1,1,1,13,1,1,1,13, ... which has period 4.
Numbers congruent to {12,13,14,15} mod 16. Numbers n such that n xor 12 = n - 12. [Brad Clardy, May 06 2013]
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
a(n) = 4*n + 12 - 3*(n mod 4).
G.f.: 12/(1-x)+x(1+x+x^2+13x^3)/((1-x^4)(1-x)) = (12+x+x^2+x^3+x^4)/((1-x^4)(1-x)) = (12-11x-x^5)/((1-x^4)(1-x)^2).
a(n) = 4*n+3*((1-i)*i^n+(1+i)*(-i)^n+(-1)^n+5)/2, where i=sqrt(-1). - Bruno Berselli, Apr 08 2011
PROG
(PARI) a(n)=(n+3)\4*16-[1, 4, 3, 2][n%4+1] \\ Charles R Greathouse IV, May 06 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hieronymus Fischer, Oct 20 2007
STATUS
approved