login
a(n) is the squared distance between the points P(n) and P(0) on a plane, n >= 0, such that the distance between P(n) and P(n+1) is n+1 and, going from P(n) to P(n+2), a 90-degree left turn is taken in P(n+1).
1

%I #82 Oct 10 2022 10:20:35

%S 0,1,5,8,8,13,25,32,32,41,61,72,72,85,113,128,128,145,181,200,200,221,

%T 265,288,288,313,365,392,392,421,481,512,512,545,613,648,648,685,761,

%U 800,800,841,925,968,968,1013,1105,1152,1152,1201,1301,1352,1352,1405,1513

%N a(n) is the squared distance between the points P(n) and P(0) on a plane, n >= 0, such that the distance between P(n) and P(n+1) is n+1 and, going from P(n) to P(n+2), a 90-degree left turn is taken in P(n+1).

%C P(n) is a corner on a spiral like this:

%C * * * * * * * * * * * *

%C *

%C * * * * * * * * *

%C * * *

%C * * * * * * *

%C * * * * *

%C * * * * * *

%C * * * *

%C * * * * * * * *

%C * *

%C * * * * * * * * * *

%C If we interpret the pointer from P(0) to P(n) as a complex number z(n), the description of the spiral is short because a 90-degree left turn is a multiplication by i (imaginary unit) and the distance of P(n) from P(0) is abs(z(n))^2, see formula 1.

%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (3,-5,7,-7,5,-3,1).

%F a(n) = abs(z(n))^2 with

%F 1) z(n) = z(n-1)+n*i^(n-1), z(0)=0. (recursive)

%F 2) z(n) = i/2*(n*i^(n+1)-(n+1)*i^n+1). (explicit)

%F Without complex numbers for k >= 0:

%F a(4*k) = 8*k^2,

%F a(4*k+1) = 8*k^2+4*k+1,

%F a(4*k+2) = 8*k^2+12*k+5,

%F a(4*k+3) = 8*(k+1)^2.

%F From _Stefano Spezia_, Jun 28 2020: (Start)

%F G.f.: x*(1 + 2*x - 2*x^2 + 2*x^3 + x^4)/((1 - x)^3*(1 + x^2)^2).

%F a(n) = 3*a(n-1) - 5*a(n-2) + 7*a(n-3) - 7*a(n-4) + 5*a(n-5) - 3*a(n-6) + a(n-7) for n > 6. (End)

%e n n*i^(n-1) z(n) a(n)

%e ------------------------------------

%e 0 0 0 0

%e 1 1 1 1

%e 2 2i 1+2i 5 = 1^2 + 2^2

%e 3 -3 -2+2i 8 = 2^2 + 2^2

%e 4 -4i -2-2i 8

%e 5 5 3-2i 13 = 3^2 + 2^2

%e 6 6i 3+4i 25 = 3^2 + 4^2

%t z[0]=0; z[n_]:=z[n-1]+n*I^(n-1); a[n_]:=z[n]*Conjugate[z[n]]; Array[a,55,0] (* _Stefano Spezia_, Jun 28 2020 *)

%Y Cf. A000982, A174344, A268038, A274923, A336336.

%K nonn

%O 0,3

%A _Gerhard Kirchner_, Jun 28 2020