A229214 If 1, 2, and 3 represent the three 2D vectors (1,0), (0.5,sqrt(3)/2) and (-0.5,sqrt(3)/2) and -1, -2 and -3 are the negation of these vectors, then this sequence represents the Gosper flowsnake.
1, 2, -1, 3, 1, 1, -3, 1, 2, 2, -1, -2, 3, 2, 3, -1, -1, -3, 1, -2, -1, 3, -1, -3, -2, 3, 3, 2, 1, 2, -1, 3, 1, 1, -3, 1, 2, -1, 3, 1, 1, -3, -2, -3, -3, 2, 3, 1, -3, 1, 2, -1, 3, 1, 1, -3, 1, 2, 2, -1, -2, 3, 2, 1, 2, 2, -1, -2, 3, 2, 3, -1, -1, -3, 1, -2, -1, -2, -3, 2, 1, -2, -2, -1
Offset: 1
Examples
Start with 1, you get in the first step 1, 2, -1, 3, 1, 1, -3, and in the 2nd step 1, 2, -1, 3, 1, 1, -3, 1, 2, 2, -1, -2, 3, 2, 3, -1, -1, -3, 1, -2, -1, 3, -1, -3, -2, 3, 3, 2, 1, 2, -1, 3, 1, 1, -3, 1, 2, -1, 3, 1, 1, -3, -2, -3, -3, 2, 3, 1, -3 and with each step the length increases by a factor 7.
Links
- Paolo Xausa, Table of n, a(n) for n = 1..16807
- Arie Bos, Index notation of grid graphs, arXiv:1210.7123 [cs.CG], 2012.
- Wikipedia, Gosper curve
Crossrefs
Programs
-
Mathematica
With[{p = {{1,2,-1,3,1,1,-3}, {1,2,2,-1,-2,3,2}, {3,-1,-3,-2,3,3,2}}}, SubstitutionSystem[{t_/; t > 0 :> p[[t]], t_ :> -Reverse[p[[-t]]]}, {1}, {3}][[1]]] (* Paolo Xausa, Jun 12 2024 *)
-
PARI
A229214(n,P=[[1,2,-1,3,1,1,-3],[1,2,2,-1,-2,3,2],[3,-1,-3,-2,3,3,2]],a=P[1])={while(#a
if(i<0,-Vecrev(P[-i]),P[i]),a)));a} \\ M. F. Hasler, Aug 06 2015
Extensions
Definition corrected by Kerry Mitchell, Aug 06 2015
Comments