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 A356465 #25 Oct 23 2022 22:57:45 %S A356465 0,2,6,12,27,59,113,179,257,359,497,747,963,1227,1577,1799,2081,2611, %T A356465 3223,3663,4167,4817,5231,5847,6657,7527,8801,9869,10439,11057,11699, %U A356465 12425,14675,16817,18027,19139,20855,22595,23803,25711,27321,29011,31063,32495 %N A356465 The number of unit squares enclosed by the rectangular spiral of which the n-th side has length prime(n). %C A356465 The pictures in the links show how the spiral is constructed. The first segment is the small black rectangle in the center, of which the left lower corner is at the origin (0,0). It represents prime(1) = 2 (its width) and is given a height of one. The first part of the boundary of the spiral is the line between (0,0) and (2,0). Prime(2) = 3 yields the next part of the boundary, the line connecting (2,0) and (2,3). The next primes determine how many unit steps the boundary of the spiral goes left, down, right, up, etc. %H A356465 Bob Andriesse, <a href="/A356465/a356465.png">Graphical representation of the first 16 segments of the spiral with grid.</a> %H A356465 Bob Andriesse, <a href="/A356465/a356465_1.png">Graphical representation of the first 44 segments of the spiral without grid.</a> %F A356465 a(n) = a(n-1) +(prime(n) - prime(n-2) + prime(n-4))*(prime(n-1) - prime(n-3)) for n > 4. %t A356465 a[4]:=27; a[n_]:=a[n]=a[n-1]+(Prime[n]-Prime[n-2]+Prime[n-4])(Prime[n-1]-Prime[n-3]); Join[{0,2,6,12,27},Table[a[n],{n,5,45}]] (* _Stefano Spezia_, Aug 09 2022 *) %o A356465 (Python) %o A356465 from sympy import prime as p %o A356465 a = [0,2,6,12,27] #first 4 area values %o A356465 area = 27 %o A356465 for n in range(5,44+1): %o A356465 darea = (p(n) - p(n-2) + p(n-4)) * (p(n-1) - p(n-3)) %o A356465 area += darea %o A356465 a.append(area) %o A356465 print('a(n)=',a) %Y A356465 Cf. A000040. %K A356465 nonn %O A356465 0,2 %A A356465 _Bob Andriesse_, Aug 08 2022