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

A248024 Lexicographically earliest permutation of the positive integers such that the first digit of a(n+1) divides a(n).

Original entry on oeis.org

1, 10, 2, 11, 12, 3, 13, 14, 7, 15, 5, 16, 4, 17, 18, 6, 19, 100, 20, 21, 30, 22, 23, 101, 102, 24, 8, 25, 50, 26, 27, 9, 31, 103, 104, 28, 29, 105, 32, 40, 41, 106, 107, 108, 33, 34, 109, 110, 51, 35, 52, 42, 36, 37, 111, 38, 112, 43, 113, 114, 39, 115, 53, 116, 44, 45, 54, 60
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Sep 29 2014

Keywords

Crossrefs

Cf. A248043 (inverse), A000030.

Programs

  • Haskell
    import Data.List (delete)
    a248024 n = a248024_list !! (n-1)
    a248024_list = 1 : f 1 [2..] where
      f x zs = g zs where
        g (y:ys) = if x `mod` (a000030 y) == 0
                   then y : f y (delete y zs) else g ys
    -- Reinhard Zumkeller, Sep 30 2014
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{k = 2}, While[Mod[a[n - 1], First@IntegerDigits[k]] != 0 || MemberQ[Array[a, n - 1], k], k++]; k]; Array[a, 68] (* Giorgos Kalogeropoulos, May 12 2023 *)
  • PARI
    a(n,S=1,u=2)=for(i=1,n,print1(S",");for(k=1,9e9,bittest(u,k)&&next;S%digits(k)[1]&&next;u+=1<
    				
Showing 1-1 of 1 results.