A117625 Maximum number of regions defined by n zigzag-lines in the plane when a zigzag-line is defined as consisting of two parallel infinite half-lines joined by a straight line segment.
1, 2, 12, 31, 59, 96, 142, 197, 261, 334, 416, 507, 607, 716, 834, 961, 1097, 1242, 1396, 1559, 1731, 1912, 2102, 2301, 2509, 2726, 2952, 3187, 3431, 3684, 3946, 4217, 4497, 4786, 5084, 5391, 5707, 6032, 6366, 6709, 7061, 7422, 7792
Offset: 0
Examples
a(0)= 1 because the plane is one region.
References
- R. L. Graham, D. E. Knuth, O. Patashnik, Concrete Mathematics, 2nd Edition, Chapter 1, Problem 13, pages 19 and 499, Addison-Wesley Publishing
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
Crossrefs
Cf. A000124.
Programs
-
Magma
[(9*n^2-7*n+2)/2: n in [0..50]]; // Vincenzo Librandi, Jul 08 2012
-
Maple
seq((9*k^2-7*k+2)/2, k=0..42);
-
Mathematica
CoefficientList[Series[(1-x+9*x^2)/(1-x)^3,{x,0,50}],x] (* Vincenzo Librandi, Jul 08 2012 *)
-
PARI
a(n)=n*(9*n-7)/2+1 \\ Charles R Greathouse IV, Jun 17 2017
Formula
Recurrence: a(n) = a(n-1) + 9*n - 8 for n > 0.
Closed Form: a(n) = 9*n^2/2 - 7*n/2 + 1.
O.g.f: -(1-x+9*x^2)/(-1+x)^3 = -17/(-1+x)^2-9/(-1+x)^3-9/(-1+x) . - R. J. Mathar, Dec 05 2007
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Vincenzo Librandi, Jul 08 2012
E.g.f.: exp(x)*(2 + 2*x + 9*x^2)/2. - Stefano Spezia, May 20 2025
Comments