login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A163980 a(n) = 2*n + (-1)^n. 4
1, 5, 5, 9, 9, 13, 13, 17, 17, 21, 21, 25, 25, 29, 29, 33, 33, 37, 37, 41, 41, 45, 45, 49, 49, 53, 53, 57, 57, 61, 61, 65, 65, 69, 69, 73, 73, 77, 77, 81, 81, 85, 85, 89, 89, 93, 93, 97, 97, 101, 101, 105, 105, 109, 109, 113, 113, 117, 117, 121, 121, 125, 125, 129, 129, 133 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

G. C. Greubel, Table of n, a(n) for n = 1..5000

Index entries for linear recurrences with constant coefficients, signature (1,1,-1).

FORMULA

a(n) = A005843(n) - (-1)^A001477(n).

a(n) = 2*A000027(n) + (-1)^A000027(n).

a(n) = A005843(n) + A033999(n).

From R. J. Mathar, Aug 21 2009: (Start)

a(n) = a(n-1) + a(n-2) - a(n-3).

G.f.: x*(1+4*x-x^2)/((1+x)*(1-x)^2). (End)

a(n) = 4*n - 2 - a(n-1), with a(1)=1. - Vincenzo Librandi, Nov 30 2010

E.g.f.: (2*x+1)*cosh(x) +(2*x-1)* sinh(x) -1. - G. C. Greubel, Aug 24 2017

MATHEMATICA

LinearRecurrence[{1, 1, -1}, {1, 5, 5}, 50] (* or *) Table[2*n + (-1)^n, {n, 1, 50}] (* G. C. Greubel, Aug 24 2017 *)

PROG

(PARI) a(n)=n+n+(-1)^n \\ Charles R Greathouse IV, Jun 09 2011

CROSSREFS

Cf. A000027, A004442, A005843, A033999.

Sequence in context: A200679 A124175 A168277 * A333154 A333141 A290968

Adjacent sequences:  A163977 A163978 A163979 * A163981 A163982 A163983

KEYWORD

nonn,easy

AUTHOR

Juri-Stepan Gerasimov, Aug 09 2009

EXTENSIONS

Link by Charles R Greathouse IV, Mar 25 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 9 16:50 EDT 2020. Contains 335545 sequences. (Running on oeis4.)