login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A166519 a(n) = 1 + 2*(-1)^n + 2*n. 7
3, 1, 7, 5, 11, 9, 15, 13, 19, 17, 23, 21, 27, 25, 31, 29, 35, 33, 39, 37, 43, 41, 47, 45, 51, 49, 55, 53, 59, 57, 63, 61, 67, 65, 71, 69, 75, 73, 79, 77, 83, 81, 87, 85, 91, 89, 95, 93, 99, 97, 103, 101, 107, 105, 111, 109, 115, 113, 119, 117, 123, 121, 127, 125, 131, 129, 135 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
Many pairs of primes of the form p+6 (5,11 - 13,19 - 17,23 - 37,43 - 41,47 - 53,59 - 61,67 - 73,79 - 97,103 - 101,107 - and so on).
a(n) is A005408(n) = 1+2*n swapped by pairs. - Paul Curtz, Mar 07 2011
LINKS
FORMULA
a(n) = 4*n - a(n-1), n>=1.
G.f.: ( 3-2*x+3*x^2 ) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Nov 02 2011
a(n) = a(n-1) + a(n-2) - a(n-3). - Vincenzo Librandi, Dec 01 2012
E.g.f.: (2*x + 1)*exp(x) + 2*exp(-x). - G. C. Greubel, May 16 2016
Sum_{n>=0} (-1)^(n+1)/a(n) = Pi/4. - Amiram Eldar, Mar 02 2023
MATHEMATICA
Table[1 + 2*(-1)^n + 2*n, {n, 0, 100}] (* Vincenzo Librandi, Dec 01 2012 *)
LinearRecurrence[{1, 1, -1}, {3, 1, 7}, 70] (* Harvey P. Dale, Jan 16 2023 *)
PROG
(Magma) [1 + 2*(-1)^n + 2*n: n in [0..70]]; // Vincenzo Librandi, Dec 01 2012
(PARI) vector(100, n, n--; 1 + 2*(-1)^n + 2*n) \\ Altug Alkan, Oct 19 2015
CROSSREFS
Cf. A005408.
Sequence in context: A283975 A071043 A101624 * A213043 A319740 A275662
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Oct 16 2009
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)