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.

A354081 Positive integers k such that the first digit of k is divisible by the product of all the remaining digits of k.

This page as a plain text file.
%I A354081 #45 Jun 16 2022 03:18:43
%S A354081 1,2,3,4,5,6,7,8,9,11,21,22,31,33,41,42,44,51,55,61,62,63,66,71,77,81,
%T A354081 82,84,88,91,93,99,111,211,212,221,311,313,331,411,412,414,421,422,
%U A354081 441,511,515,551,611,612,613,616,621,623,631,632,661,711,717,771
%N A354081 Positive integers k such that the first digit of k is divisible by the product of all the remaining digits of k.
%e A354081 9331 is a term: the first digit is 9, which is divisible by the product of the remaining digits, i.e., 3*3*1 = 9.
%e A354081 8448 is not a term: the first digit is 8, which is not divisible by the product of the remaining digits, i.e., 4*4*8 = 128.
%t A354081 Select[Range[1000], !MemberQ[d = IntegerDigits[#], 0] && Divisible[First[d], Times @@ Rest[d]] &] (* _Amiram Eldar_, Jun 09 2022 *)
%o A354081 (C#)
%o A354081 public static bool a(int n)
%o A354081 {
%o A354081    int product = 1;
%o A354081    while (n > 9)
%o A354081    {
%o A354081       product *= n % 10;
%o A354081       n /= 10;
%o A354081       if (product == 0 || product > 9) { return false; }
%o A354081    }
%o A354081    if (n % product == 0) { return true; } else { return false; }
%o A354081 }
%o A354081 (PARI) isok(k) = my(d=digits(k), p=vecprod(d)); p && ((d[1] % (p/d[1])) == 0); \\ _Michel Marcus_, Jun 06 2022
%o A354081 (Python)
%o A354081 from math import prod
%o A354081 def ok(n):
%o A354081     d = list(map(int, str(n)))
%o A354081     return 0 not in d and int(d[0])%prod(d[1:]) == 0
%o A354081 print([k for k in range(800) if ok(k)]) # _Michael S. Branicky_, Jun 09 2022
%Y A354081 Subsequence of A052382.
%K A354081 nonn,base
%O A354081 1,2
%A A354081 _Moosa Nasir_, Jun 05 2022