This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A335298 #82 Oct 10 2022 10:20:35 %S A335298 0,1,5,8,8,13,25,32,32,41,61,72,72,85,113,128,128,145,181,200,200,221, %T A335298 265,288,288,313,365,392,392,421,481,512,512,545,613,648,648,685,761, %U A335298 800,800,841,925,968,968,1013,1105,1152,1152,1201,1301,1352,1352,1405,1513 %N 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). %C A335298 P(n) is a corner on a spiral like this: %C A335298 * * * * * * * * * * * * %C A335298 * %C A335298 * * * * * * * * * %C A335298 * * * %C A335298 * * * * * * * %C A335298 * * * * * %C A335298 * * * * * * %C A335298 * * * * %C A335298 * * * * * * * * %C A335298 * * %C A335298 * * * * * * * * * * %C A335298 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 A335298 <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (3,-5,7,-7,5,-3,1). %F A335298 a(n) = abs(z(n))^2 with %F A335298 1) z(n) = z(n-1)+n*i^(n-1), z(0)=0. (recursive) %F A335298 2) z(n) = i/2*(n*i^(n+1)-(n+1)*i^n+1). (explicit) %F A335298 Without complex numbers for k >= 0: %F A335298 a(4*k) = 8*k^2, %F A335298 a(4*k+1) = 8*k^2+4*k+1, %F A335298 a(4*k+2) = 8*k^2+12*k+5, %F A335298 a(4*k+3) = 8*(k+1)^2. %F A335298 From _Stefano Spezia_, Jun 28 2020: (Start) %F A335298 G.f.: x*(1 + 2*x - 2*x^2 + 2*x^3 + x^4)/((1 - x)^3*(1 + x^2)^2). %F A335298 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 A335298 n n*i^(n-1) z(n) a(n) %e A335298 ------------------------------------ %e A335298 0 0 0 0 %e A335298 1 1 1 1 %e A335298 2 2i 1+2i 5 = 1^2 + 2^2 %e A335298 3 -3 -2+2i 8 = 2^2 + 2^2 %e A335298 4 -4i -2-2i 8 %e A335298 5 5 3-2i 13 = 3^2 + 2^2 %e A335298 6 6i 3+4i 25 = 3^2 + 4^2 %t A335298 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 A335298 Cf. A000982, A174344, A268038, A274923, A336336. %K A335298 nonn %O A335298 0,3 %A A335298 _Gerhard Kirchner_, Jun 28 2020