[go: up one dir, main page]

login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A356465 The number of unit squares enclosed by the rectangular spiral of which the n-th side has length prime(n). 1
0, 2, 6, 12, 27, 59, 113, 179, 257, 359, 497, 747, 963, 1227, 1577, 1799, 2081, 2611, 3223, 3663, 4167, 4817, 5231, 5847, 6657, 7527, 8801, 9869, 10439, 11057, 11699, 12425, 14675, 16817, 18027, 19139, 20855, 22595, 23803, 25711, 27321, 29011, 31063, 32495 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
COMMENTS
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.
LINKS
FORMULA
a(n) = a(n-1) +(prime(n) - prime(n-2) + prime(n-4))*(prime(n-1) - prime(n-3)) for n > 4.
MATHEMATICA
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 *)
PROG
(Python)
from sympy import prime as p
a = [0, 2, 6, 12, 27] #first 4 area values
area = 27
for n in range(5, 44+1):
darea = (p(n) - p(n-2) + p(n-4)) * (p(n-1) - p(n-3))
area += darea
a.append(area)
print('a(n)=', a)
CROSSREFS
Cf. A000040.
Sequence in context: A091919 A059078 A335712 * A166963 A188476 A155583
KEYWORD
nonn
AUTHOR
Bob Andriesse, Aug 08 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 30 09:19 EDT 2024. Contains 375532 sequences. (Running on oeis4.)