A059029 a(n) = n if n is even, 2*n + 1 if n is odd.
0, 3, 2, 7, 4, 11, 6, 15, 8, 19, 10, 23, 12, 27, 14, 31, 16, 35, 18, 39, 20, 43, 22, 47, 24, 51, 26, 55, 28, 59, 30, 63, 32, 67, 34, 71, 36, 75, 38, 79, 40, 83, 42, 87, 44, 91, 46, 95, 48, 99, 50, 103, 52, 107, 54, 111, 56, 115, 58, 119, 60, 123, 62, 127, 64, 131, 66, 135
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..10000
- Index entries for two-way infinite sequences
- Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
Crossrefs
Programs
-
Magma
[n+((n+1)/2)*(1-(-1)^n): n in [0..70]]; // Vincenzo Librandi, Aug 14 2011
-
Maple
B := (n,m) -> lcm(n,m)/n + lcm(n,m)/m - 1: seq(B(m+2,m),m=1..90);
-
Mathematica
Table[n +(n+1)*(1-(-1)^n)/2, {n,0,70}] (* G. C. Greubel, Nov 08 2018 *) Table[If[EvenQ[n],n,2n+1],{n,0,70}] (* or *) LinearRecurrence[{0,2,0,-1},{0,3,2,7},70] (* Harvey P. Dale, Jul 23 2025 *)
-
PARI
a(n)=if(n%2,2*n+1,n)
Formula
G.f.: x*(x^2 + 2*x + 3)/(1 - x^2)^2. - Ralf Stephan, Jun 10 2003
Third main diagonal of A059026: a(n) = B(n+2, n) = lcm(n+2, n)/(n+2) + lcm(n+2, n)/n - 1 for all n >= 1.
a(2*n) + a(2*n+1) = A016945(n). - Paul Curtz, Aug 29 2008
E.g.f.: 2*x*cosh(x) + (1 + x)*sinh(x). - Franck Maminirina Ramaharo, Nov 08 2018
Extensions
New description from Ralf Stephan, Jun 10 2003
Comments