cp's OEIS Frontend

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.

A340944 List of X-coordinates of point moving along one of the arms of a counterclockwise square spiral with four arms; A340945 gives Y-coordinates.

This page as a plain text file.
%I A340944 #19 May 24 2023 06:05:18
%S A340944 0,1,1,1,0,-1,-2,-3,-3,-3,-3,-3,-3,-3,-2,-1,0,1,2,3,4,5,5,5,5,5,5,5,5,
%T A340944 5,5,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,
%U A340944 -7,-7,-7,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9
%N A340944 List of X-coordinates of point moving along one of the arms of a counterclockwise square spiral with four arms; A340945 gives Y-coordinates.
%H A340944 Rémy Sigrist, <a href="/A340944/b340944.txt">Table of n, a(n) for n = 0..10101</a>
%H A340944 Rémy Sigrist, <a href="/A340944/a340944.gp.txt">PARI program for A340944</a>
%H A340944 <a href="/index/Con#coordinates_2D_curves">Index entries for sequences related to coordinates of 2D curves</a>
%F A340944 a(n) = A340945(n) iff n belongs to A002939.
%F A340944 a(n) = - A340945(n) iff n = 4*x^2 - 6*x + 2 for some x.
%F A340944 a(n) = 0 iff n is an even square (A016742).
%F A340944 a(n) = Re z where z = (r-s*i)*i^s with s = round(sqrt(n)) = A000194(n) and remainder r = n - s^2. - _Kevin Ryde_, May 24 2023
%e A340944 The spiral starts as follows:
%e A340944      +-----+-----+-----+-----+
%e A340944      |7     6     5     4    |3    .
%e A340944      |                       |     .
%e A340944      +     +-----+-----+     +     +
%e A340944      |8    |           |     |2    |
%e A340944      |     |           |     |     |
%e A340944      +     +     +-----+-----+     +
%e A340944      |9    |     |     |0     1    |
%e A340944      |     |     |     |           |     .
%e A340944      +     +     +     +-----+-----+     .
%e A340944      |10   |     |                       .
%e A340944      |     |     |                       .
%e A340944      +     +     +-----+-----+-----+-----+
%e A340944      .11   .
%e A340944      .
%e A340944 - so a(0) = a(4) = 0,
%e A340944      a(1) = a(2) = a(3) = 1,
%e A340944      a(5) = -1,
%e A340944      a(6) = -2,
%e A340944      a(7) = a(8) = a(9) = a(10) = a(11) = -3.
%o A340944 (PARI) See Links section.
%o A340944 (PARI) a(n) = my(r,s=sqrtint(n,&r)); if(r>s, s++;r-=2*s-1); real((r-s*I)*I^s); \\ _Kevin Ryde_, May 24 2023
%Y A340944 Cf. A000194, A002939, A016742, A340171, A340945.
%K A340944 sign,easy,look
%O A340944 0,7
%A A340944 _Rémy Sigrist_, Jan 30 2021