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!)
A336336 Squared distance from start of a point moving in a square spiral. 7
0, 1, 2, 1, 2, 1, 2, 1, 2, 5, 4, 5, 8, 5, 4, 5, 8, 5, 4, 5, 8, 5, 4, 5, 8, 13, 10, 9, 10, 13, 18, 13, 10, 9, 10, 13, 18, 13, 10, 9, 10, 13, 18, 13, 10, 9, 10, 13, 18, 25, 20, 17, 16, 17, 20, 25, 32, 25, 20, 17, 16, 17, 20, 25, 32, 25, 20, 17, 16, 17, 20, 25, 32 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
The terms corresponding to the corner points of the spiral with a(k-1) < a(k) > a(k+1), i.e., 2, 2, 2, 5, 8, 8, 8, 13, 18, 18, 18, ... are given by the sequence A001105(1) repeated 3 times, (A001105(1)+A001105(2))/2, A001105(2) repeated 3 times, (A001105(2)+A001105(3))/2, A001105(3) repeated 3 times, ... .
These numbers are the norms of the Gaussian integers discussed in A345436. - N. J. A. Sloane, Jun 25 2021
LINKS
FORMULA
a(n) = A174344(n)^2 + A268038(n)^2 = A174344(n)^2 + A274923(n)^2.
PROG
(PARI) A336336(m)={my(v=vectorsmall(m)); for(Lstart=0, 1, my(L=Lstart, d=1, n=0); for(r=1, oo, d=-d; my(k=floor(r/2)*d); for(j=1, L++, n++; if(n<=m, v[n]+=k*k)); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, n++; if(n<=m, v[n]+=j*j)); if(n>m, break))); v};
CROSSREFS
See also A345436.
Sequence in context: A330559 A114228 A230287 * A168580 A356206 A318707
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Jul 18 2020
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 September 10 13:48 EDT 2024. Contains 375790 sequences. (Running on oeis4.)