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.

A257277 a(n+1) has a digit that divides a(n) and is the least positive integer not appearing earlier with this property.

Original entry on oeis.org

0, 1, 10, 2, 11, 12, 3, 13, 14, 7, 15, 5, 16, 4, 17, 18, 6, 19, 21, 23, 31, 41, 51, 30, 20, 22, 24, 8, 25, 35, 27, 9, 29, 61, 71, 81, 32, 26, 28, 34, 42, 33, 36, 37, 91, 47, 100, 40, 38, 52, 43, 101, 102, 39, 53, 103, 104, 44, 45, 49, 57, 63, 59, 105, 50, 54, 46, 62, 72, 48, 56, 58, 82, 92, 64, 68, 74, 106, 107, 108, 60, 55, 65, 75, 73, 109, 110, 85
Offset: 0

Views

Author

Eric Angelini and M. F. Hasler, May 07 2015

Keywords

Comments

A variant of A248024.
This is a permutation of the nonnegative integers, see A257276 for the inverse permutation.
There are large ranges of fixed points, e.g., between a(135) = 99 and a(200) = 201, or between a(1080) = 999 and a(2000) = 2001. For indices n in these ranges, the sequence restricted to [0...n] is a permutation (i.e., all numbers up to n appear among the values up to that point).
If one requires that a(n+1) has *no* digit dividing a(n), the sequence starts 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 30, 40, 33, 22, 34, ... and stops at a(1422) = 2520, divisible by any digit. If one requires the sequence to be increasing, then it goes ..., 20, 30, 40, 60, 70, 80, 90, 400, 600, 700, 800, 900, 7000, 9000, 70000, 90000, 700000, 900000, ...

Crossrefs

Programs

  • PARI
    {u=n=0;until(print1(n","),u+=1<!(n%i),vector(9,i,i));n=0;until(!bittest(u,n++)&&setintersect(d,Set(digits(n))),))}