A008865 a(n) = n^2 - 2.
-1, 2, 7, 14, 23, 34, 47, 62, 79, 98, 119, 142, 167, 194, 223, 254, 287, 322, 359, 398, 439, 482, 527, 574, 623, 674, 727, 782, 839, 898, 959, 1022, 1087, 1154, 1223, 1294, 1367, 1442, 1519, 1598, 1679, 1762, 1847, 1934, 2023, 2114, 2207, 2302, 2399, 2498
Offset: 1
Examples
G.f. = -x + 2*x^2 + 7*x^3 + 14*x^4 + 23*x^5 + 34*x^6 + 47*x^7 + 62*x^8 + 79*x^9 + ...
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
- Anant Godbole and Martha Liendo, Waiting time distribution for the emergence of superpatterns, arxiv 1302.4668 [math.PR], 2013.
- Eric Weisstein's World of Mathematics, Near-Square Prime.
- Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
Crossrefs
Programs
-
Haskell
a008865 = (subtract 2) . (^ 2) :: Integral t => t -> t a008865_list = scanl (+) (-1) [3, 5 ..] -- Reinhard Zumkeller, May 06 2013
-
Magma
[n^2 - 2: n in [1..60]]; // Vincenzo Librandi, May 01 2014
-
Mathematica
Range[50]^2 - 2 (* Harvey P. Dale, Mar 14 2011 *)
-
PARI
{for(n=1, 47, print1(n^2-2, ","))} \\ Klaus Brockhaus, Oct 17 2008
Formula
For n > 1: a(n) = A143053(A000290(n)), A143054(a(n)) = A000290(n). - Reinhard Zumkeller, Jul 20 2008
G.f.: (x-5*x^2+2*x^3)/(-1+3*x-3*x^2+x^3). - Klaus Brockhaus, Oct 17 2008
E.g.f.: (x^2 + x -2)*exp(x) + 2. - G. C. Greubel, Aug 19 2017
For n > 1, a(n) = floor(n^5/(n^3 + n + 1)). - Gary Detlefs, Feb 10 2010
a(n) = a(n-1) + 2*n - 1 for n > 1, a(1) = -1. - Vincenzo Librandi, Nov 18 2010
a(n)*a(n-1) + 2 = (a(n) - n)^2 = A028552(n-2)^2. - Bruno Berselli, Dec 07 2011
From Amiram Eldar, Jul 13 2020: (Start)
Sum_{n>=1} 1/a(n) = (1 - sqrt(2)*Pi*cot(sqrt(2)*Pi))/4.
Sum_{n>=1} (-1)^n/a(n) = (1 - sqrt(2)*Pi*cosec(sqrt(2)*Pi))/4. (End)
Assume offset 0. Then a(n) = 2*LaguerreL(2, 1 - n). - Peter Luschny, May 09 2021
From Amiram Eldar, Feb 05 2024: (Start)
Product_{n>=1} (1 - 1/a(n)) = sqrt(2/3)*sin(sqrt(3)*Pi)/sin(sqrt(2)*Pi).
Product_{n>=2} (1 + 1/a(n)) = -Pi/(sqrt(2)*sin(sqrt(2)*Pi)). (End)
Comments