login
A317298
a(n) = (1/2)*(1 + (-1)^n + 2*n + 4*n^2).
3
1, 3, 11, 21, 37, 55, 79, 105, 137, 171, 211, 253, 301, 351, 407, 465, 529, 595, 667, 741, 821, 903, 991, 1081, 1177, 1275, 1379, 1485, 1597, 1711, 1831, 1953, 2081, 2211, 2347, 2485, 2629, 2775, 2927, 3081, 3241, 3403, 3571, 3741, 3917, 4095, 4279, 4465, 4657
OFFSET
0,2
COMMENTS
For n > 0, first differences of A304487.
All the terms of this sequence are odd numbers.
FORMULA
a(n) = (1/2)*(A033999(n) + A005408(n) + 4*A000290(n)).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3.
a(2*n) = A188135(n).
a(2*n-1) = A033567(n), for n > 0.
O.g.f.: -(1 + x + 5*x^2 + x^3)/(-1 + x)^3*(1 + x).
E.g.f.: (1/2)*exp(-x)*(1 + exp(2*x)*(1 + 6*x + 4*x^2)).
Sum_{n>0} 1/a(n) = (1/4)*(Pi - log(4)) + i*(polygamma(0, 1/8 - i*sqrt(7)/8) - polygamma(0, 1/8 + i*sqrt(7)/8))/(2*sqrt(7)) = 1.603596691017309384564895..., where i is the imaginary unit. - Stefano Spezia, Feb 10 2019
a(n) = 1 + 2*(n^2 + floor(n/2)). - Stefano Spezia, Dec 08 2021
MAPLE
a:=n->(1/2)*(1 + (-1)^n + 2*n + 4*n^2): seq(a(n), n=0..50);
MATHEMATICA
a[n_]:=(1/2)*(1 + (-1)^n + 2*n + 4*n^2); Array[a, 50, 0]
PROG
(GAP) Flat(List([0..50], n->(1/2)*(1 + (-1)^n + 2*n + 4*n^2)));
(Magma) [(1/2)*(1+(-1)^n+2*n+4*n^2): n in [0..50]];
(Maxima) makelist((1/2)*(1+(-1)^n+2*n+4*n^2), n, 0, 50);
(PARI) a(n) = (1/2)*(1+(-1)^n+2*n+4*n^2);
(Python) [(1+(-1)**n+2*n+4*n**2)/2 for n in range(0, 50)]
CROSSREFS
Cf. A306362 (prime numbers subsequence).
Sequence in context: A031318 A082485 A322595 * A064568 A147073 A147191
KEYWORD
nonn,easy
AUTHOR
Stefano Spezia, Jan 22 2019
STATUS
approved