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.

A259486 a(n) = 3*n^2 - 3*n + 1 + 6*floor((n-1)*(n-2)/6).

Original entry on oeis.org

1, 7, 19, 43, 73, 109, 157, 211, 271, 343, 421, 505, 601, 703, 811, 931, 1057, 1189, 1333, 1483, 1639, 1807, 1981, 2161, 2353, 2551, 2755, 2971, 3193, 3421, 3661, 3907, 4159, 4423, 4693, 4969, 5257, 5551, 5851, 6163, 6481, 6805, 7141, 7483, 7831, 8191, 8557
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 28 2015

Keywords

Comments

Start with the geometric picture for the centered hex numbers (A003215). Here, each hexagonal figure in the sequence is the aggregate of smaller unit hexes (with n hexes along each side). Then, when possible, add additional unit hexes to each side except for the corners --> do this repeatedly with the same restriction until no hexes can be added. a(n) gives the area of each figure (see example).
a(n) == 1 mod 6. - Robert Israel, Jun 29 2015

Examples

			-----------------------------------------------------------------------
Figure 1
-----------------------------------------------------------------------
                                                  __    __    __
                                                 /  \__/  \__/  \
                                                 \_*/  \__/  \*_/
                              __               __/  \__/  \__/  \__
                           __/  \__           /  \__/  \__/  \__/  \
            __          __/  \__/  \__        \__/  \__/  \__/  \__/
         __/  \__      /  \__/  \__/  \     __/  \__/  \__/  \__/  \__
.__     /  \__/  \     \__/  \__/  \__/    / *\__/  \__/  \__/  \__/* \
/  \    \__/  \__/     /  \__/  \__/  \    \__/  \__/  \__/  \__/  \__/
\__/    /  \__/  \     \__/  \__/  \__/       \__/  \__/  \__/  \__/
        \__/  \__/     /  \__/  \__/  \       /  \__/  \__/  \__/  \
           \__/        \__/  \__/  \__/       \__/  \__/  \__/  \__/
                          \__/  \__/             \__/  \__/  \__/
                             \__/                / *\__/  \__/* \
                                                 \__/  \__/  \__/
n=1         n=2               n=3                       n=4
-----------------------------------------------------------------------
Table 1
-----------------------------------------------------------------------
a(1) = 1                              =  1
a(2) = 3  + 2(2)                      =  7
a(3) = 5  + 2(3+4)                    =  19
a(4) = 7  + 2(4+5+6)          + 6(1)  =  43
a(5) = 9  + 2(5+6+7+8)        + 6(2)  =  73
a(6) = 11 + 2(6+7+8+9+10)     + 6(3)  =  109
a(7) = 13 + 2(7+8+9+10+11+12) + 6(5)  =  157
...
		

Crossrefs

Cf. A003215 (hex numbers), A000969, A130518, A255840 (similar, with squares).

Programs

  • Magma
    [3*n^2 - 3*n + 1 + 6*Floor((n-1)*(n-2)/6) : n in [1..100]];
    
  • Magma
    I:=[1,7,19,43,73]; [n le 5 select I[n] else 2*Self(n-1)-Self(n-2)+Self(n-3)-2*Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Jul 14 2015
  • Maple
    A259486:=n->3*n^2 - 3*n + 1 + 6*floor((n-1)*(n-2)/6): seq(A259486(n), n=1..100);
  • Mathematica
    Table[3 n^2 - 3 n + 1 + 6 Floor[(n - 1) (n - 2)/6], {n, 50}] (* or *)
    CoefficientList[Series[(1 + 5 x + 6 x^2 + 11 x^3 + x^4)/((1 - x)^3 (1 + x + x^2)), {x, 0, 50}], x]
    LinearRecurrence[{2, -1, 1, -2, 1}, {1, 7, 19, 43, 73}, 50]; (* Vincenzo Librandi, Jul 14 2015 *)

Formula

G.f.: (1+5*x+6*x^2+11*x^3+x^4)/((1-x)^3*(1+x+x^2)).
a(n) = 2*a(n-1)-a(n-2)+a(n-3)-2*a(n-4)+a(n-5), n>5.
a(n) = A003215(n+1) + 6*A130518(n+1).
From Robert Israel, Jun 29 2015: (Start)
a(n) = 4*n^2 - 6*n + 1 if 3 divides n, 4*n^2 - 6*n + 3 otherwise.
a(n) = 1 + 6 * A000969(n-2) for n >= 2. (End)
a(n) = 4*n^2 - 6*n + 3^sign(n mod 3). - Wesley Ivan Hurt, Jul 13 2015