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.

A384538 Positive integers k >= 10 for which for every pair of nonempty substrings that concatenate to give k one substring divides the other.

Original entry on oeis.org

10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 28, 30, 31, 33, 36, 39, 40, 41, 42, 44, 48, 50, 51, 55, 60, 61, 62, 63, 66, 70, 71, 77, 80, 81, 82, 84, 88, 90, 91, 93, 99, 100, 101, 102, 105, 110, 111, 120, 121, 122, 123, 124, 126, 130, 131, 140, 141
Offset: 1

Views

Author

Felix Huber, Jun 09 2025

Keywords

Examples

			324 is a term because 3 divides 24 and 4 divides 32.
105 is a term because 1 divides 05 = 5 and 5 divides 10.
2500 is a term because 2 divides 500. 25 divides 00 = 0 and 250 divides 0.
104 is not a term: Although 1 divides 04 = 4, 4 does not divide 10.
		

Crossrefs

Supersequence of A384539.

Programs

  • Maple
    A384538:=proc(n)
        option remember;
        local i,j,k,p,m,q,L;
        if n=1 then
            10
        else
            for k from procname(n-1)+1 do
                L:=ListTools:-Reverse(convert(k,'base',10));
                m:=length(k)-1;
                for j to m do
                    p:=parse(cat(seq(L[i],i=1..j)));
                    q:=k-p*10^(m+1-length(p));
                    if q mod p<>0 and p mod q<>0 then
                        break
                	 elif j=m then
                        return k
                    fi
                od
            od
        fi;
    end proc;	
    seq(A384538(n),n=1..62);
  • PARI
    isok(k) = my(nb=logint(k, 10), d=10); for (i=1, nb, my(sa = k%d, sb=k\d); if ((sa % sb) && (sb % sa), return(0)); d *= 10;); return(1); \\ Michel Marcus, Jun 19 2025
  • Python
    def c(k, m): return (k > 0 and m%k == 0) or (m > 0 and k%m == 0)
    def ok(n):
        s = str(n)
        return n > 9 and all(c(int(s[:i]), int(s[i:])) for i in range(1, len(s)))
    print([k for k in range(150) if ok(k)]) # Michael S. Branicky, Jun 17 2025
    
Showing 1-1 of 1 results.