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.
%I A163542 #20 Jul 06 2025 14:57:57 %S A163542 1,1,2,0,2,2,1,1,2,2,0,2,1,1,0,1,2,2,1,0,1,1,2,2,1,1,0,1,2,2,0,0,2,2, %T A163542 1,0,1,1,2,2,1,1,0,1,2,2,1,0,1,1,2,0,2,2,1,1,2,2,0,2,1,1,2,0,2,2,1,0, %U A163542 1,1,2,2,1,1,0,1,2,2,0,2,1,1,2,0,2,2,1,1,2,2,0,2,1,1,0,0,1,1,2,0,2,2 %N A163542 The relative direction (0=straight ahead, 1=turn right, 2=turn left) taken by the type I Hilbert's Hamiltonian walk A163357 at the step n. %C A163542 a(16*n) = a(256*n) for all n. %H A163542 Antti Karttunen, <a href="/A163542/b163542.txt">Table of n, a(n) for n = 1..65536</a> %F A163542 a(n) = A163241((A163540(n+1)-A163540(n)) modulo 4). %t A163542 HC = {L[n_ /; IntegerQ[n/2]] :> {F[n], L[n], L[n + 1], R[n + 2]}, %t A163542 R[n_ /; IntegerQ[(n + 1)/2]] :> {F[n], R[n], R[n + 3], L[n + 2]}, %t A163542 R[n_ /; IntegerQ[n/2]] :> {L[n], R[n + 1], R[n], F[n + 3]}, %t A163542 L[n_ /; IntegerQ[(n + 1)/2]] :> {R[n], L[n + 3], L[n], F[n + 1]}, %t A163542 F[n_ /; IntegerQ[n/2]] :> {L[n], R[n + 1], R[n], L[n + 3]}, %t A163542 F[n_ /; IntegerQ[(n + 1)/2]] :> {R[n], L[n + 3], L[n], R[n + 1]}}; %t A163542 a[1] = L[0]; Map[(a[n_ /; IntegerQ[(n - #)/16]] := %t A163542 Part[Flatten[a[(n + 16 - #)/16] /. HC /. HC], #]) &, Range[16]]; %t A163542 Part[a[#] & /@ Range[4^4] /. {L[_] -> 2, R[_] -> 1, F[_] -> 0}, %t A163542 2 ;; -1] (* _Bradley Klee_, Aug 07 2015 *) %o A163542 (Scheme) (define (A163542 n) (A163241 (modulo (- (A163540 (1+ n)) (A163540 n)) 4))) %Y A163542 a(n) = A014681(A163543(n)). See also A163540. %K A163542 nonn %O A163542 1,3 %A A163542 _Antti Karttunen_, Aug 01 2009