A129756 Repetitions of odd numbers four times.
1, 1, 1, 1, 3, 3, 3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 9, 9, 9, 9, 11, 11, 11, 11, 13, 13, 13, 13, 15, 15, 15, 15, 17, 17, 17, 17, 19, 19, 19, 19, 21, 21, 21, 21, 23, 23, 23, 23, 25, 25, 25, 25, 27, 27, 27, 27, 29, 29, 29, 29, 31, 31, 31, 31, 33, 33, 33, 33, 35, 35, 35, 35, 37, 37, 37, 37
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
Programs
-
Magma
[1+2*Floor(n/4): n in [0..100]]; // Bruno Berselli, Jul 26 2014
-
Magma
I:=[1,1,1,1,3,3,3,3,5]; [n le 9 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..100]]; // Vincenzo Librandi, Jul 25 2014
-
Mathematica
Table[1 + 2 Floor[n/4], {n, 0, 100}] (* Bruno Berselli, Jul 26 2014 *) CoefficientList[Series[(1 + x^4)/(-1 + x)^2/(1 + x)/(x^2 + 1), {x, 0, 100}], x] (* Vincenzo Librandi, Jul 26 2014 *)
-
Python
def A129756(n): return (n>>1)|1 # Chai Wah Wu, Jan 31 2023
Formula
a(n) = (Sum_{k=0..n} (k+1)*cos((n-k)*Pi/2)) + (1/4)*(2*cos(n*Pi/2) + 1 + (-1)^n) - 1, with n >= 0.
a(n) = 1 + 2*floor(n/4) = 1 + 2*A002265(n). - R. J. Mathar, Jun 10 2007
G.f.: (1+x^4)/((-1+x)^2*(1+x)*(x^2+1)). - R. J. Mathar, Nov 18 2007
a(n) = -1 + Sum_{k=0..n} ((1/12)*(-5*(k mod 4) + ((k+1) mod 4) + ((k+2) mod 4) + 7*((k+3) mod 4))). - Paolo P. Lava, Aug 21 2009
a(n) = n - A083219(n). - Michel Lagneau, Apr 09 2013
a(n) = (2*n + 1 + 2*cos(n*Pi/2) + cos(n*Pi) + 2*sin(n*Pi/2))/4. - Wesley Ivan Hurt, Oct 02 2017
From Stefano Spezia, May 26 2021: (Start)
E.g.f.: (cos(x) + cosh(x) + sin(x) + x*(cosh(x) + sinh(x)))/2.
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 4. (End)
Comments