login
Arm number of the base spiral in A362249 which visits large spiral point n there.
3

%I #38 May 28 2023 08:46:03

%S 0,0,2,3,0,0,0,1,0,1,2,0,2,2,0,3,0,0,0,0,0,2,0,1,0,1,0,0,2,0,2,2,2,3,

%T 0,3,0,3,0,0,0,0,0,2,0,2,0,1,0,1,0,0,2,0,2,0,2,2,2,2,0,3,0,3,0,3,0,0,

%U 0,0,0,0,0,2,0,2,0,1,0,1,0,1,0,1,2,0,2

%N Arm number of the base spiral in A362249 which visits large spiral point n there.

%C Arms are numbered 0,1,2,3 for the base spirals with first segment directed East, South, West, North, respectively.

%C This numbering is successive arms around in the same direction that the spirals themselves turn (both clockwise in the diagrams in A362249).

%F If n is a square:

%F a(n) = 3*(n+1 mod 2); (a(n) = 3 for even squares).

%e a(5) = 0 because A362249(5) = 13 that is on spiral "E", which is encoded here as 0.

%e a(8) = 1 because A362249(8) = 58 that is on spiral "S", which is encoded here as 1.

%e a(11) = 2 because A362249(11) = 139 that is on spiral "W", which is encoded here as 2.

%e a(34) = 3 because A362249(34) = 1000 that is on spiral "N", which is encoded here as 3.

%o (MATLAB)

%o function a = A362363( max_n )

%o E = [0 ; 0]; S = [0 ; 0]; W = [0 ; 0]; N = [0 ; 0]; V = [0 0];

%o for k = 1:4*max_n

%o l = V(1+mod(k+1,2)); s = (-1)^floor(k/2);

%o for m = l+(1*s):s:s*k

%o V(1+mod(k+1,2)) = m; V2 = V(end:-1:1).*[-1 1];

%o N = [N V2']; E = [E V']; S = [S -V2']; W = [W -V'];

%o end

%o end

%o for n = 2:max_n

%o [th,r] = cart2pol(E(1,n), E(2,n));

%o rot = [cos(-th) -sin(-th); sin(-th) cos(-th)];

%o v = E(:,n)'*rot*r;

%o jE = find(sum(abs([E(1,:)-v(1); E(2,:)-v(2)]),1) < 0.5);

%o jS = find(sum(abs([S(1,:)-v(1); S(2,:)-v(2)]),1) < 0.5);

%o jW = find(sum(abs([W(1,:)-v(1); W(2,:)-v(2)]),1) < 0.5);

%o jN = find(sum(abs([N(1,:)-v(1); N(2,:)-v(2)]),1) < 0.5);

%o a(n-1) = find([length(jE) length(jS) length(jW) length(jN)] > 0) - 1;

%o end

%o end % _Thomas Scheuerle_, Apr 19 2023

%Y Cf. A362249, A362265 (indices of 0's).

%K nonn

%O 1,3

%A _Tamas Sandor Nagy_ and _Thomas Scheuerle_, Apr 17 2023