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.

A382895 Divide n successively by its nonzero digits from most to least significant, updating the result at each step and skipping any digit that doesn't divide the current value exactly.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 6, 13, 14, 3, 16, 17, 18, 19, 10, 21, 11, 23, 3, 5, 13, 27, 14, 29, 10, 31, 16, 11, 34, 7, 2, 37, 38, 13, 10, 41, 21, 43, 11, 9, 46, 47, 12, 49, 10, 51, 26, 53, 54, 11, 56, 57, 58, 59, 10, 61, 31, 21, 16, 13, 11, 67, 68, 69, 10, 71, 36, 73, 74, 15
Offset: 1

Views

Author

Seiichi Manyama, Apr 08 2025

Keywords

Examples

			36 is divisible by 3, so divide by 3 to get 12.
12 is divisible by 6, so divide by 6 to get  2. So a(36) = 2.
		

Crossrefs

Programs

  • Python
    def A(n):
        m = n
        for i in map(int, str(n)):
            if i != 0 and m % i == 0:
                m //= i
        return m
    def A382895(n):
        return [A(i) for i in range(1, n + 1)]
    print(A382895(100))
  • Ruby
    def A(n)
      m = n
      n.to_s.split('').map(&:to_i).each{|i|
        m /= i if i != 0 && m % i == 0
      }
      m
    end
    def A382895(n)
      (1..n).map{|i| A(i)}
    end
    p A382895(100)
    
Showing 1-1 of 1 results.