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.

A346217 Integers m, with k digits, such that Sum_{i=1..k} (m without its i-th digit)/(its i-th digit) is an integer.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 122, 124, 126, 142, 144, 155, 162, 168, 186, 221, 222, 244, 248, 261, 263, 284, 288, 324, 326, 333, 342, 346, 362, 364, 366, 442, 444, 488, 555, 621, 623, 648, 663, 666, 684, 728, 742, 777, 812
Offset: 1

Views

Author

Michel Marcus, Jul 11 2021

Keywords

Examples

			124 gives 12/4 + 14/2 + 24/1 = 34, an integer, so 124 is a term.
221 gives 21/2 + 21/2 + 22/1 = 43, an integer, so 221 is a term.
		

Crossrefs

Subsequence of A052382 (zeroless numbers). Supersequence of A346206.

Programs

  • PARI
    subs(d, j) = {my(x=""); for (k=1, #d, if (j != k, x = concat(x, d[k]));); eval(x);}
    isok(m) = {my(d=digits(m), res); if (vecmin(d), res = sum(j=1, #d, subs(d, j)/d[j]); (denominator(res)==1););}
    
  • Python
    from fractions import Fraction
    def ok(n):
        s = str(n)
        if '0' in s: return False
        if len(s) == 1: return True
        return sum(Fraction(int(s[:i]+s[i+1:]), int(s[i])) for i in range(len(s))).denominator == 1
    print(list(filter(ok, range(813)))) # Michael S. Branicky, Jul 11 2021
Showing 1-1 of 1 results.