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.

Showing 1-2 of 2 results.

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.

Original entry on oeis.org

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

Views

Author

Arie Bos, Sep 19 2013

Keywords

Comments

The sequence is generated by the rewriting rules:
P(1) = 1,2,-1,3,1,1,-3;
P(2) = 1,2,2,-1,-2,3,2 and
P(3) = 3,-1,-3,-2,3,3,2;
P(-x) = reverse(-P(x)) for x=1,2,3, so
P(-1) = 3,-1,-1,-3,1,-2,-1,
P(-2) = -2,-3,2,1,-2,-2,-1, and
P(-3) = -2,-3,-3,2,3,1,-3.
The start is 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.
		

Crossrefs

Cf. A261180 (as 0..5). Coordinates: A334485, A334486.
Cf. A229215 (Gosper island directions).

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(#aif(i<0,-Vecrev(P[-i]),P[i]),a)));a} \\ M. F. Hasler, Aug 06 2015

Extensions

Definition corrected by Kerry Mitchell, Aug 06 2015

A106824 Trajectory of 1 under the morphism 1->13, 2->13223, 3->1323.

Original entry on oeis.org

1, 3, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 2, 2, 3, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 2, 2, 3, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 2, 2, 3, 1, 3, 2, 2, 3, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 2, 2, 3, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1, 3, 2, 2, 3, 1, 3, 2, 3, 1, 3, 1, 3, 2, 3, 1
Offset: 0

Views

Author

N. J. A. Sloane, May 20 2005

Keywords

Comments

Only from the 13th term on, this differs from the limit sequence of { 1 -> 131, 2 -> 212, 3 -> 323 } = absolute values of A229215. - M. F. Hasler, Aug 06 2015

Crossrefs

Cf. A229215.

Programs

  • Maple
    S:={1=[1,3],2=[1,3,2,2,3],3=[1,3,2,3]}:subs(S,1):subs(S,%):subs(S,%):subs(S,%):subs(S,%); # all brackets have to be removed. - Emeric Deutsch, simplified by M. F. Hasler, Aug 06 2015
    S:={1=(1,3),2=(1,3,2,2,3),3=(1,3,2,3)}: (curry(subs,S)@@6)([1]); # Robert Israel, Aug 06 2015
  • Mathematica
    Nest[ Flatten[ # /. {1 -> {1, 3}, 2 -> {1, 3, 2, 2, 3}, 3 -> {1, 3, 2, 3}}] &, {1}, 5] (* Robert G. Wilson v, Jun 20 2005 *)
  • PARI
    A106824(n,a=[1],S=[[1,3],[1,3,2,2,3],[1,3,2,3]])={while(#aS[i],a)));a} \\ M. F. Hasler, Aug 06 2015

Extensions

More terms from Emeric Deutsch, May 30 2005
Showing 1-2 of 2 results.