%I #35 Apr 30 2023 11:42:01
%S 1,1,3,7,11,19,25,37,45,61,71,91,103,127,141,169,185,217,235,271,291,
%T 331,353,397,421,469,495,547,575,631,661,721,753,817,851,919,955,1027,
%U 1065,1141,1181,1261
%N Interleave 1 - n + 3*n^2, 1 + 3*n*(1+n) for n >= 0.
%C a(n+1) - 2*a(n) = -1, 1, 1, -3, -3, -13, -13, -29, -29, ...
%C Hexagonal spiral for A000265:
%C .
%C 17--35---9--37
%C /
%C 33 17---9--19---5
%C / / \
%C 1 1 3---7---1 21
%C / / / \ \
%C 31 15 5 1---1 9 11
%C \ \ \ / / /
%C 15 7 1---3 5 23
%C \ \ / /
%C 29 13---3--11 3
%C \ /
%C 7--27--13--25
%C .
%C The two sequences are perpendicular.
%C a(n+1) - a(n) = 0, 2, 4, 4, 8, 6, 12, ... = 2*A029578(n+2).
%C A003215 is a bisection of 1, 1, 13, 7, 49, 19, 109, 37, ... .
%H Colin Barker, <a href="/A329482/b329482.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-2,-1,1).
%F From _Colin Barker_, Nov 14 2019: (Start)
%F G.f.: (1 + 4*x^3 + x^4) / ((1 - x)^3*(1 + x)^2).
%F a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 4.
%F a(n) = (5 + 3*(-1)^n - 2*(1 + (-1)^n)*n + 6*n^2) / 8.
%F (End)
%F E.g.f.: (1/8)*exp(-x)*(3 + 2*x + exp(2*x)*(5 + 4*x + 6*x^2)). - _Stefano Spezia_, Nov 14 2019 after _Colin Barker_
%F a(-n) = 1, 1, 5, 7, 15, 19, ... = interleave 1 + n + 3*n^2, 1 + 3*n*(1+n), both in the spiral.
%t LinearRecurrence[{1, 2, -2, -1, 1}, {1, 1, 3, 7, 11}, 42] (* _Amiram Eldar_, Nov 23 2019 *)
%t Module[{nn=20,a,b},a=Table[1-n+3 n^2,{n,0,nn}];b=Table[1+3n(1+n),{n,0,nn}];Riffle[a,b]] (* _Harvey P. Dale_, Apr 30 2023 *)
%o (PARI) Vec((1 + 4*x^3 + x^4) / ((1 - x)^3*(1 + x)^2) + O(x^40)) \\ _Colin Barker_, Nov 15 2019
%Y Cf. A003215, A029578, A056106, A056108.
%K nonn,easy
%O 0,3
%A _Paul Curtz_, Nov 14 2019