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!)
A340945 List of Y-coordinates of point moving along one of the arms of a counterclockwise square spiral with four arms; A340944 gives X-coordinates. 3
0, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(n) = 0 iff n = 4*x^2 + 4*x + 1 for some x.
a(n) = Im z where z = (r-s*i)*i^s with s = round(sqrt(n)) = A000194(n) and remainder r = n - s^2. - Kevin Ryde, May 28 2023
EXAMPLE
The spiral starts as follows:
+-----+-----+-----+-----+
|7 6 5 4 |3 .
| | .
+ +-----+-----+ + +
|8 | | |2 |
| | | | |
+ + +-----+-----+ +
|9 | | |0 1 |
| | | | | .
+ + + +-----+-----+ .
|10 | | .
| | | .
+ + +-----+-----+-----+-----+
.11 .
.
- so a(0) = a(1) = a(9) = 0,
a(2) = a(8) = 1,
a(3) = a(4) = a(5) = a(6) = a(7) = 2,
a(10) = -1,
a(11) = -2.
PROG
(PARI) See Links section.
(PARI) a(n) = my(r, s=sqrtint(n, &r)); if(r>s, s++; r-=2*s-1); imag((r-s*I)*I^s); \\ Kevin Ryde, May 28 2023
CROSSREFS
Sequence in context: A274923 A249071 A231713 * A224898 A027360 A037806
KEYWORD
sign,easy,look
AUTHOR
Rémy Sigrist, Jan 30 2021
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 21 21:14 EDT 2024. Contains 375353 sequences. (Running on oeis4.)