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.

A014709 The regular paper-folding (or dragon curve) sequence. Alphabet {1,2}.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Over the alphabet {a,b} this is aabaabbaaabbabbaaabaabbbaabbabbaaaba...
With offset 1, completely multiplicative modulo 3. - Peter Munn, Jun 20 2022

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, pp. 155, 182.
  • G. Melançon, Factorizing infinite words using Maple, MapleTech journal, vol. 4, no. 1, 1997, pp. 34-42, esp. p. 36.

Crossrefs

See A014577 for more references and more terms.
The following are all essentially the same sequence: A014577, A014707, A014709, A014710, A034947, A038189, A082410. - N. J. A. Sloane, Jul 27 2012
Cf. A065339.

Programs

  • Mathematica
    (3 - JacobiSymbol[-1, Range[100]])/2 (* Paolo Xausa, May 26 2024 *)
  • PARI
    a(n)=if(n%2==0, 1+bitand(1,n\2), a(n\2) );
    for(n=0,122,print1(a(n),", "))

Formula

Set a=1, b=2, S(0)=a, S(n+1) = S(n)aF(S(n)), where F(x) reverses x and then interchanges a and b; sequence is limit S(infinity).
a(4n) = 1, a(4n+2) = 2, a(2n+1) = a(n).
a(n) = (3-jacobi(-1,n+1))/2 (cf. A034947). - N. J. A. Sloane, Jul 27 2012 [index adjusted by Peter Munn, Jun 22 2022]
a(n) = 1 + A065339(n+1) mod 2. - Peter Munn, Jun 20 2022