OFFSET
0,2
COMMENTS
Similarly, the principle of interlacing a sequence and its first differences leads from A000012 and its differences A000004 to A059841, or from A140811 and its first differences A017593 to a sequence -1, 6, 5, 18, ...
If n is even then a(n) = n + 1 ; otherwise a(n) = 2. - Wesley Ivan Hurt, Jun 05 2013
Denominators of floor((n+1)/2) / (n+1), n > 0. - Wesley Ivan Hurt, Jun 14 2013
a(n) is also the number of minimum total dominating sets in the (n+1)-gear graph for n>1. - Eric W. Weisstein, Apr 11 2018
a(n) is also the number of minimum total dominating sets in the (n+1)-sun graph for n>1. - Eric W. Weisstein, Sep 09 2021
Denominators of Cesàro means sequence of A114112, corresponding numerators are in A354008. - Bernard Schott, May 14 2022
Also, denominators of Cesàro means sequence of A237420, corresponding numerators are in A354280. - Bernard Schott, May 22 2022
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..16384
Eric Weisstein's World of Mathematics, Gear Graph
Eric Weisstein's World of Mathematics, Sun Graph
Eric Weisstein's World of Mathematics, Total Dominating Set
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(2n) = A005408(n). a(2n+1) = 2.
First differences: a(n+1) - a(n) = (-1)^(n+1)*A109613(n-1), n > 0.
a(n) = 2*a(n-2) - a(n-4). - R. J. Mathar, Feb 23 2009
G.f.: (1+2*x+x^2-2*x^3)/((x-1)^2*(1+x)^2). - R. J. Mathar, Feb 23 2009
From Wesley Ivan Hurt, Jun 05 2013: (Start)
a(n) = n + 1 - (n - 1)*(n mod 2).
a(n) = (n + 1) * (n - floor((n+1)/2))! / floor((n+1)/2)!.
MAPLE
a(n):=n->n+1-(n-1)*(n mod 2); seq(a(k), k=1..100); # Wesley Ivan Hurt, Jun 05 2013
MATHEMATICA
Flatten[Table[{2 n - 1, 2}, {n, 40}]] (* Alonso del Arte, Jun 15 2013 *)
Riffle[Range[1, 79, 2], 2] (* Alonso del Arte, Jun 14 2013 *)
Table[((-1)^n (n - 1) + n + 3)/2, {n, 0, 20}] (* Eric W. Weisstein, Apr 11 2018 *)
Table[Floor[(n + 1)/2]/(n + 1), {n, 0, 20}] // Denominator (* Eric W. Weisstein, Apr 11 2018 *)
LinearRecurrence[{0, 2, 0, -1}, {2, 3, 2, 5}, {0, 20}] (* Eric W. Weisstein, Apr 11 2018 *)
CoefficientList[Series[(1 + 2 x + x^2 - 2 x^3)/(-1 + x^2)^2, {x, 0, 20}], x] (* Eric W. Weisstein, Apr 11 2018 *)
PROG
(PARI) A141310(n) = if(n%2, 2, 1+n); \\ (for offset=0 version) - Antti Karttunen, Oct 02 2018
(PARI) A141310off1(n) = if(n%2, n, 2); \\ (for offset=1 version) - Antti Karttunen, Oct 02 2018
(Python)
def A141310(n): return 2 if n % 2 else n + 1 # Chai Wah Wu, May 24 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Aug 02 2008
EXTENSIONS
Edited by R. J. Mathar, Feb 23 2009
Term a(45) corrected, and more terms added by Antti Karttunen, Oct 02 2018
STATUS
approved