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.

A232244 A walk based on the digits of sqrt(2) (A002193).

Original entry on oeis.org

1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 3, 4, 3
Offset: 1

Views

Author

Philippe Deléham, Nov 20 2013 at the suggestion of N. J. A. Sloane

Keywords

Comments

sqrt(2)= 1. 41421354237...
Between 1 and 4 we place 2 and 3.
Between 4 and 1 we place 3 and 2.
Between 1 and 4 we place 2 and 3.
Between 4 and 2 we place 3 and so on.
This gives:
1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 1, 2, 3, ...
This could be called a walk (or promenade) on the digits of sqrt(2).

Crossrefs

Cf. A002193.

Programs

  • Haskell
    a232244 n = a232244_list !! (n-1)
    a232244_list = 1 : concat (zipWith w a002193_list $ tail a002193_list)
       where w v u | v > u     = [v - 1, v - 2 .. u]
                   | v < u     = [v + 1 .. u]
                   | otherwise = [v]
    -- Reinhard Zumkeller, Nov 22 2013