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-3 of 3 results.

A252022 Lexicographically earliest permutation of the positive integers, such that no carry occurs when adjacent terms are added in decimal representation.

Original entry on oeis.org

1, 2, 3, 4, 5, 10, 6, 11, 7, 12, 13, 14, 15, 20, 8, 21, 16, 22, 17, 30, 9, 40, 18, 31, 23, 24, 25, 32, 26, 33, 34, 35, 41, 27, 42, 36, 43, 44, 45, 50, 19, 60, 28, 51, 37, 52, 46, 53, 100, 29, 70, 101, 38, 61, 102, 47, 110, 39, 120, 48, 111, 54, 103, 55, 104
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 12 2014

Keywords

Comments

a(n+1) = smallest number, not occurring earlier, such that no carry occurs when adding it to a(n) in decimal arithmetic.

Crossrefs

Cf. A252001 (carries required); A252023 (inverse), A252079 (fixed points), A251984, A167831.
Cf. A262604 (first differences).

Programs

  • Haskell
    import Data.List (delete)
    a252022 n = a252022_list !! (n-1)
    a252022_list = 1 : f [1] (drop 2 a031298_tabf) where
       f xs zss = g zss where
         g (ds:dss) = if all (<= 9) $ zipWith (+) xs ds
           then (foldr (\d v -> 10 * v + d) 0 ds) : f ds (delete ds zss)
           else g dss
    
  • Python
    A252022_list, l, s, b = [1], [1], 2, set()
    for _ in range(10**3):
        i = s
        while True:
            if i not in b:
                li = [int(d) for d in str(i)[::-1]]
                for x,y in zip(li,l):
                    if x+y > 9:
                        break
                else:
                    l = li
                    b.add(i)
                    A252022_list.append(i)
                    while s in b:
                        b.remove(s)
                        s += 1
                    break
            i += 1 # Chai Wah Wu, Dec 14 2014

A252078 Fixed points of permutations A252001 and A252002.

Original entry on oeis.org

1, 22, 33, 41, 56, 57, 58, 91, 92, 93, 94, 95, 96, 97, 98, 99, 102, 113, 123, 126, 150, 151, 152, 153, 154, 203, 206, 224, 243, 246, 304, 325, 332, 340, 344, 405, 412, 445, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 13 2014

Keywords

Comments

A252001(a(n)) = A252002(a(n)) = a(n).

Crossrefs

Programs

  • Haskell
    a252078 n = a252078_list !! (n-1)
    a252078_list = [x | x <- [1..], a252001 x == x]

A252023 Inverse permutation to A252022.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 9, 15, 21, 6, 8, 10, 11, 12, 13, 17, 19, 23, 41, 14, 16, 18, 25, 26, 27, 29, 34, 43, 50, 20, 24, 28, 30, 31, 32, 36, 45, 53, 58, 22, 33, 35, 37, 38, 39, 47, 56, 60, 90, 40, 44, 46, 48, 62, 64, 74, 80, 92, 105, 42, 54, 66, 68, 76, 78, 82, 94
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 12 2014

Keywords

Crossrefs

Cf. A252022 (inverse), A252079 (fixed points).

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a252023 = (+ 1) . fromJust . (`elemIndex` a252022_list)
Showing 1-3 of 3 results.