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).

This page as a plain text file.
%I A259486 #34 Feb 29 2024 16:02:41
%S A259486 1,7,19,43,73,109,157,211,271,343,421,505,601,703,811,931,1057,1189,
%T A259486 1333,1483,1639,1807,1981,2161,2353,2551,2755,2971,3193,3421,3661,
%U A259486 3907,4159,4423,4693,4969,5257,5551,5851,6163,6481,6805,7141,7483,7831,8191,8557
%N A259486 a(n) = 3*n^2 - 3*n + 1 + 6*floor((n-1)*(n-2)/6).
%C A259486 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).
%C A259486 a(n) == 1 mod 6. - _Robert Israel_, Jun 29 2015
%H A259486 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,1,-2,1).
%F A259486 G.f.: (1+5*x+6*x^2+11*x^3+x^4)/((1-x)^3*(1+x+x^2)).
%F A259486 a(n) = 2*a(n-1)-a(n-2)+a(n-3)-2*a(n-4)+a(n-5), n>5.
%F A259486 a(n) = A003215(n+1) + 6*A130518(n+1).
%F A259486 From _Robert Israel_, Jun 29 2015: (Start)
%F A259486 a(n) = 4*n^2 - 6*n + 1 if 3 divides n, 4*n^2 - 6*n + 3 otherwise.
%F A259486 a(n) = 1 + 6 * A000969(n-2) for n >= 2. (End)
%F A259486 a(n) = 4*n^2 - 6*n + 3^sign(n mod 3). - _Wesley Ivan Hurt_, Jul 13 2015
%e A259486 -----------------------------------------------------------------------
%e A259486 Figure 1
%e A259486 -----------------------------------------------------------------------
%e A259486                                                   __    __    __
%e A259486                                                  /  \__/  \__/  \
%e A259486                                                  \_*/  \__/  \*_/
%e A259486                               __               __/  \__/  \__/  \__
%e A259486                            __/  \__           /  \__/  \__/  \__/  \
%e A259486             __          __/  \__/  \__        \__/  \__/  \__/  \__/
%e A259486          __/  \__      /  \__/  \__/  \     __/  \__/  \__/  \__/  \__
%e A259486 .__     /  \__/  \     \__/  \__/  \__/    / *\__/  \__/  \__/  \__/* \
%e A259486 /  \    \__/  \__/     /  \__/  \__/  \    \__/  \__/  \__/  \__/  \__/
%e A259486 \__/    /  \__/  \     \__/  \__/  \__/       \__/  \__/  \__/  \__/
%e A259486         \__/  \__/     /  \__/  \__/  \       /  \__/  \__/  \__/  \
%e A259486            \__/        \__/  \__/  \__/       \__/  \__/  \__/  \__/
%e A259486                           \__/  \__/             \__/  \__/  \__/
%e A259486                              \__/                / *\__/  \__/* \
%e A259486                                                  \__/  \__/  \__/
%e A259486 n=1         n=2               n=3                       n=4
%e A259486 -----------------------------------------------------------------------
%e A259486 Table 1
%e A259486 -----------------------------------------------------------------------
%e A259486 a(1) = 1                              =  1
%e A259486 a(2) = 3  + 2(2)                      =  7
%e A259486 a(3) = 5  + 2(3+4)                    =  19
%e A259486 a(4) = 7  + 2(4+5+6)          + 6(1)  =  43
%e A259486 a(5) = 9  + 2(5+6+7+8)        + 6(2)  =  73
%e A259486 a(6) = 11 + 2(6+7+8+9+10)     + 6(3)  =  109
%e A259486 a(7) = 13 + 2(7+8+9+10+11+12) + 6(5)  =  157
%e A259486 ...
%p A259486 A259486:=n->3*n^2 - 3*n + 1 + 6*floor((n-1)*(n-2)/6): seq(A259486(n), n=1..100);
%t A259486 Table[3 n^2 - 3 n + 1 + 6 Floor[(n - 1) (n - 2)/6], {n, 50}] (* or *)
%t A259486 CoefficientList[Series[(1 + 5 x + 6 x^2 + 11 x^3 + x^4)/((1 - x)^3 (1 + x + x^2)), {x, 0, 50}], x]
%t A259486 LinearRecurrence[{2, -1, 1, -2, 1}, {1, 7, 19, 43, 73}, 50]; (* _Vincenzo Librandi_, Jul 14 2015 *)
%o A259486 (Magma) [3*n^2 - 3*n + 1 + 6*Floor((n-1)*(n-2)/6) : n in [1..100]];
%o A259486 (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
%Y A259486 Cf. A003215 (hex numbers), A000969, A130518, A255840 (similar, with squares).
%K A259486 nonn,easy
%O A259486 1,2
%A A259486 _Wesley Ivan Hurt_, Jun 28 2015