OFFSET
1,2
COMMENTS
A regular triangle with side n is divided by segments parallel to the sides of the triangle into n^2 unit triangles. In it, you can select triangular frames nested inside each other. Coloring them through one, starting from the outer one, we obtain a coloring of unit triangles corresponding to the given sequence. See link.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
Nicolay Avilov, Triangle Coloring Scheme
Index entries for linear recurrences with constant coefficients, signature (4,-7,7,-4,1).
FORMULA
Let r = n (mod 6), then we get
a(n) = n*(n+3)/2 - 1 if r = 1 or r = 2;
n*(n+3)/2 if r = 0 or r = 3;
n*(n+3)/2 + 1 if r = 4 or r = 5.
From Stefano Spezia, Apr 20 2023: (Start)
O.g.f.: x/((1 - x)^3*(1 - x + x^2)).
E.g.f.: exp(x)*x*(4 + x)/2 - 2*exp(x/2)*sin(sqrt(3)*x/2)/sqrt(3). (End)
a(n) - a(n-1) = A077859(n-1). - R. J. Mathar, Apr 20 2023
EXAMPLE
a(7) = 7^2 - 4^2 + 1^2 = 34;
a(8) = 8^2 - 5^2 + 2^2 = 43;
a(9) = 9^2 - 6^2 + 3^2 = 54.
MATHEMATICA
A359626list[nmax_]:=LinearRecurrence[{4, -7, 7, -4, 1}, {1, 4, 9, 15, 21}, nmax]; A359626list[100] (* Paolo Xausa, Aug 05 2023 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nicolay Avilov, Apr 20 2023
STATUS
approved