A098180 Odd numbers with twice the odd numbers repeated in order between them.
1, 2, 2, 3, 5, 6, 6, 7, 9, 10, 10, 11, 13, 14, 14, 15, 17, 18, 18, 19, 21, 22, 22, 23, 25, 26, 26, 27, 29, 30, 30, 31, 33, 34, 34, 35, 37, 38, 38, 39, 41, 42, 42, 43, 45, 46, 46, 47, 49, 50, 50, 51, 53, 54, 54, 55, 57, 58, 58, 59, 61, 62, 62, 63, 65, 66, 66, 67, 69, 70, 70, 71
Offset: 0
Links
- Iain Fox, Table of n, a(n) for n = 0..10000
- Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
Programs
-
Magma
[Floor((2*n+1-(-1)^((n+1)*(n+2)/2))/2): n in [0..80]]; // Vincenzo Librandi, Apr 13 2015
-
Maple
A098180:=n->(2*n+1-(-1)^((n+1)*(n+2)/2))/2: seq(A098180(n), n=0..100); # Wesley Ivan Hurt, Apr 12 2015
-
Mathematica
Table[(2 n + 1 - (-1)^((n + 1) (n + 2)/2))/2, {n, 0, 40}] (* Wesley Ivan Hurt, Apr 12 2015 *)
-
PARI
first(n) = Vec((1+x)*(1-x+x^2)/((1-x)^2*(1+x^2)) + O(x^n)) \\ Iain Fox, Oct 17 2018
-
PARI
a(n) = (2*n+1-(-1)^((n+1)*(n+2)/2))/2 \\ Iain Fox, Oct 17 2018
Formula
G.f.: (1+x)(1-x+x^2)/((1-x)^2(1+x^2)).
a(n) = sqrt(2)*sin(Pi*n/2+Pi/4)/2+n+1/2.
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4), n>3.
From Wesley Ivan Hurt, Apr 12 2015, Oct 13 2015: (Start)
a(n) = (2n+1-(-1)^((n+1)*(n+2)/2))/2.
E.g.f: (exp(-i*x)*((1+i) + (1-i)*exp(2*i*x) + exp((1+i)*x)*(2+4*x)))/4, where i = sqrt(-1). - Iain Fox, Oct 17 2018
Comments