cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A317298 a(n) = (1/2)*(1 + (-1)^n + 2*n + 4*n^2).

Original entry on oeis.org

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

Views

Author

Stefano Spezia, Jan 22 2019

Keywords

Comments

For n > 0, first differences of A304487.
All the terms of this sequence are odd numbers.

Crossrefs

Cf. A306362 (prime numbers subsequence).

Programs

  • 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]];
    
  • 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]
  • 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)]

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