A335298 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).
0, 1, 5, 8, 8, 13, 25, 32, 32, 41, 61, 72, 72, 85, 113, 128, 128, 145, 181, 200, 200, 221, 265, 288, 288, 313, 365, 392, 392, 421, 481, 512, 512, 545, 613, 648, 648, 685, 761, 800, 800, 841, 925, 968, 968, 1013, 1105, 1152, 1152, 1201, 1301, 1352, 1352, 1405, 1513
Offset: 0
Keywords
Examples
n n*i^(n-1) z(n) a(n) ------------------------------------ 0 0 0 0 1 1 1 1 2 2i 1+2i 5 = 1^2 + 2^2 3 -3 -2+2i 8 = 2^2 + 2^2 4 -4i -2-2i 8 5 5 3-2i 13 = 3^2 + 2^2 6 6i 3+4i 25 = 3^2 + 4^2
Links
- Index entries for linear recurrences with constant coefficients, signature (3,-5,7,-7,5,-3,1).
Programs
-
Mathematica
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 *)
Formula
a(n) = abs(z(n))^2 with
1) z(n) = z(n-1)+n*i^(n-1), z(0)=0. (recursive)
2) z(n) = i/2*(n*i^(n+1)-(n+1)*i^n+1). (explicit)
Without complex numbers for k >= 0:
a(4*k) = 8*k^2,
a(4*k+1) = 8*k^2+4*k+1,
a(4*k+2) = 8*k^2+12*k+5,
a(4*k+3) = 8*(k+1)^2.
From Stefano Spezia, Jun 28 2020: (Start)
G.f.: x*(1 + 2*x - 2*x^2 + 2*x^3 + x^4)/((1 - x)^3*(1 + x^2)^2).
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)
Comments