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.

A334676 a(n) is the least number that can be reached starting from n and iterating the nondeterministic map x -> x/d where d is a nonzero digit of x dividing x.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 1, 13, 14, 1, 16, 17, 18, 19, 10, 21, 11, 23, 1, 1, 13, 27, 14, 29, 10, 31, 16, 11, 34, 1, 1, 37, 38, 13, 10, 41, 21, 43, 11, 1, 46, 47, 1, 49, 10, 51, 13, 53, 54, 11, 56, 57, 58, 59, 10, 61, 31, 21, 16, 13, 11, 67, 68, 69
Offset: 1

Views

Author

Rémy Sigrist, Jul 25 2020

Keywords

Comments

See A336580 for the positions of 1's.

Examples

			For n = 168:
- 168 / 6 = 28, 28 / 2 = 14,
- 168 / 8 = 21,
- so a(168) = 14.
		

Crossrefs

See A334684 for a similar sequence.
Cf. A336580.

Programs

  • PARI
    for (n=1, #a=vector(69, k, k), apply (d -> a[n]=min(a[n], a[n/d]), setintersect(Set(digits(n)), divisors(n))); print1 (a[n]", "))
    
  • Python
    def neighs(x):
        yield from (x//d for d in list(map(int, str(x))) if d > 0 and x%d == 0)
    def A334676(n):
        reach, expand = {n}, [n]
        while expand:
            q = expand.pop()
            for r in neighs(q):
                if r not in reach:
                    reach.add(r)
                    expand.append(r)
        return min(reach)
    print([A334676(n) for n in range(1, 70)]) # Michael S. Branicky, Aug 23 2025

Formula

a(a(n)) = a(n).