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.

A038367 Numbers n with property that (product of digits of n) is divisible by (sum of digits of n).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 22, 30, 36, 40, 44, 50, 60, 63, 66, 70, 80, 88, 90, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 120, 123, 130, 132, 138, 140, 145, 150, 154, 159, 160, 167, 170, 176, 180, 183, 189, 190, 195, 198, 200, 201, 202, 203
Offset: 1

Views

Author

Keywords

Comments

Equal to the disjoint union of A061013 and A011540 \ {0}. Contains in particular all positive single-digit integers, those with a digit 0, and 22*{1,...,18}. If x is in the sequence, any digit-permutation of x is also in the sequence. - M. F. Hasler, Feb 28 2018

Crossrefs

See A061013 for case where 0 digits are excluded. Cf. A055931.

Programs

  • Magma
    [0] cat [n: n in [1..250] | IsIntegral(&*Intseq(n)/&+Intseq(n))]; // Bruno Berselli, Feb 09 2016
    
  • Maple
    isA038367 := proc(n)
        if type( A007954(n)/A007953(n),'integer') then
            true;
         else
            false;
        end if;
    end proc :
    for n from 1 to 500 do
        if isA038367(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Jun 30 2020
  • Mathematica
    okQ[n_]:=Module[{idn=IntegerDigits[n]},Divisible[Times@@idn,Total[idn]]]
    Select[Range[500],okQ] (* Harvey P. Dale, Nov 24 2010 *)
  • PARI
    is(n)=n&&prod(i=1,#n=digits(n),n[i])%vecsum(n)==0 \\ M. F. Hasler, Feb 28 2018

Extensions

Corrected by Vladeta Jovovic and Larry Reeves (larryr(AT)acm.org), Jun 08 2001
Erroneous 0 term removed by David A. Corneth, Jun 05 2016

A061013 Numbers k such that (product of digits of k) is divisible by (sum of digits of k), where 0's are not permitted.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 36, 44, 63, 66, 88, 123, 132, 138, 145, 154, 159, 167, 176, 183, 189, 195, 198, 213, 224, 231, 235, 242, 246, 253, 257, 264, 268, 275, 279, 286, 297, 312, 318, 321, 325, 333, 345, 347, 352, 354, 357, 369, 374, 375, 381, 396, 415
Offset: 1

Views

Author

Heiner Muller-Merbach (hmm(AT)sozwi.uni-kl.de), Jun 06 2001

Keywords

Comments

Called "perfect years". 1998 and 2114 are the nearest past and future examples.

Examples

			1998 is perfect since 1*9*9*8/(1+9+9+8) = 24.
		

References

  • H. Herles, Reformstau, Gefuehlsstau, Verkehrsstau. Generalanzeiger, 12/31/1997, p. V.
  • H. Muller-Merbach and L. Logelix, Perfekte Jahre, Technologie und Management, Vol. 42, 1993, No. 1, p. 47 and No. 2, p. 95.

Crossrefs

See A038367 for case where 0 digits are allowed. Cf. A055931.
Cf. A274124.

Programs

  • Maple
    for n from 1 to 3000 do a := convert(n,base,10):s := add(a[i],i=1..nops(a)):p := mul(a[i],i=1..nops(a)): if p<>0 and p mod s=0 then printf(`%d,`,n):fi:od:
  • Mathematica
    Select[Range[415], FreeQ[x = IntegerDigits[#], 0] && Divisible[Times @@ x, Plus @@ x] &] (* Jayanta Basu, Jul 13 2013 *)
  • PARI
    is(n) = my(d = digits(n)); vd = vecprod(d); vd != 0 && vd % vecsum(d) == 0 \\ David A. Corneth, Mar 15 2021
    
  • Python
    from math import prod
    def ok(n):
        d = list(map(int, str(n)))
        pod, sod = prod(d), sum(d)
        return pod and pod%sod == 0
    print([k for k in range(416) if ok(k)]) # Michael S. Branicky, Mar 28 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org) and Vladeta Jovovic, Jun 07 2001
Showing 1-2 of 2 results.