OFFSET
0,3
COMMENTS
Resulting spiral:
28--29--29--30--31--31--32
|
27 13--14--15--15--16--17
| | |
27 13 4---5---5---6 17
| | | | |
26 12 3 0---1 7 18
| | | | | |
25 11 3---2---1 7 19
| | | |
25 11--10---9---9---8 19
| |
24--23--23--22--21--21--20
.
a(n) mod 9 is of period 27. a(n) mod 10 is of period 30.
The NE diagonal starting at 1 is A301696. - Klaus Purath, May 15 2021
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5), a(0)=0, a(1)=1, a(2)=7, a(3)=18, a(4)=35.
a(n+2) - 2*a(n-1) + a(n) = period 3: repeat [5, 5, 6].
a(-n) = 0, 5, 15, 30, 51, 77, 108, 145, ... is the sequence of the terms on the positive y-axis.
G.f.: x*(1 + 5*x + 5*x^2 + 5*x^3) / ((1 - x)^3*(1 + x + x^2)). - Colin Barker, Oct 09 2018
MATHEMATICA
LinearRecurrence[{2, -1, 1, -2, 1}, {0, 1, 7, 18, 35}, 100] (* Paolo Xausa, Nov 13 2023 *)
PROG
(PARI) concat(0, Vec(x*(1 + 5*x + 5*x^2 + 5*x^3) / ((1 - x)^3*(1 + x + x^2)) + O(x^50))) \\ Colin Barker, Oct 09 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Oct 09 2018
STATUS
approved