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-2 of 2 results.

A087142 Numbers divisible by their individual digits, but not by the sum of their digits (counted with multiplicity).

Original entry on oeis.org

11, 15, 22, 33, 44, 55, 66, 77, 88, 99, 115, 122, 124, 128, 155, 168, 175, 184, 212, 244, 248, 366, 384, 412, 424, 488, 515, 636, 672, 728, 784, 816, 824, 848, 1111, 1112, 1113, 1115, 1124, 1131, 1144, 1155, 1176, 1184, 1197, 1222, 1244, 1248, 1266, 1288, 1311
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 18 2003

Keywords

Comments

Intersection of A034838 and A065877.

Examples

			488 is in the sequence as its divisible by its individual digits but not by the sum of its digits counted with multiplicity. That is 488 is divisible by 4 and 8 but not by 4 + 8 + 8 = 20. - _David A. Corneth_, Jan 28 2021
		

Crossrefs

Cf. A337163 (similar, with product).

Programs

  • Mathematica
    didQ[n_]:=Module[{idn=IntegerDigits[n]},FreeQ[idn,0]&&AllTrue[n/idn, IntegerQ] && !Divisible[n,Total[idn]]]; Select[Range[1300], didQ] (* The program uses the AllTrue function from Mathematica version 10 *)  (* Harvey P. Dale, Apr 18 2016 *)
  • PARI
    is(n) = { my(d = digits(n), sd = vecsum(d), s = Set(d)); if(n == 0 || s[1] == 0, return(0)); if(n % sd != 0, for(i = 1, #s, if(n % s[i] != 0, return(0) ) ); return(1) ); 0 } \\ David A. Corneth, Jan 28 2021
    
  • Python
    def ok(n):
        d = list(map(int, str(n)))
        return 0 not in d and n%sum(d) and all(n%di == 0 for di in set(d))
    print([k for k in range(1312) if ok(k)]) # Michael S. Branicky, Nov 15 2021

A342445 Numbers that are divisible by their nonzero digits but are not divisible by the product of their nonzero digits.

Original entry on oeis.org

22, 33, 44, 48, 55, 66, 77, 88, 99, 122, 124, 126, 155, 162, 168, 184, 202, 204, 222, 244, 248, 264, 280, 288, 303, 324, 330, 333, 336, 366, 396, 404, 408, 412, 420, 424, 440, 444, 448, 488, 505, 515, 555, 606, 636, 648, 660, 666, 707, 728, 770, 777, 784, 808, 824, 840
Offset: 1

Views

Author

Bernard Schott, Mar 20 2021

Keywords

Comments

Numbers that are divisible by the product of their nonzero digits (A055471) are trivially divisible by each of their nonzero digits (A002796), but the converse is false. This sequence = A002796 \ A055471 and consists of these counterexamples.
This sequence differs from A337163: the first sixteen terms are the same but a(17) = 202 while A337163(17) = 222.

Examples

			204 is divisible by 2 and 4 but 204 is not divisible by 2*4 = 8, hence 204 is a term.
248 is divisible by 2, by 4 and by 8 but 248 is not divisible by 2*4*8 = 64, hence 248 is a term.
		

Crossrefs

Equals A002796 \ A055471.
Cf. A337163 = A034838 \ A007602 (subsequence of zeroless numbers).

Programs

  • Mathematica
    q[n_] := AllTrue[(d = Select[IntegerDigits[n], # > 0 &]), Divisible[n, #] &] && ! Divisible[n, Times @@ d]; Select[Range[840], q] (* Amiram Eldar, Mar 21 2021 *)
    dnzQ[n_]:=With[{c=DeleteCases[IntegerDigits[n],0]},Union[Boole[Divisible[n,c]]]=={1}&&!Divisible[n,Times@@c]]; Select[ Range[ 1000],dnzQ] (* Harvey P. Dale, Jan 16 2025 *)
  • PARI
    isok(m) = my(d=select(x->(x != 0), digits(m))); (m % vecprod(d)) && (sum(k=1, #d, m % d[k]) == 0); \\ Michel Marcus, Mar 22 2021
Showing 1-2 of 2 results.