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.

A068189 Smallest positive number whose product of digits equals n, or a(n)=0 if no such number exists, i.e. when n has a prime divisor greater than 7.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 25, 0, 26, 0, 27, 35, 28, 0, 29, 0, 45, 37, 0, 0, 38, 55, 0, 39, 47, 0, 56, 0, 48, 0, 0, 57, 49, 0, 0, 0, 58, 0, 67, 0, 0, 59, 0, 0, 68, 77, 255, 0, 0, 0, 69, 0, 78, 0, 0, 0, 256, 0, 0, 79, 88, 0, 0, 0, 0, 0, 257, 0, 89, 0, 0, 355, 0, 0, 0, 0, 258, 99, 0, 0, 267, 0
Offset: 1

Views

Author

Labos Elemer, Feb 19 2002

Keywords

Comments

a(n) > 0 if and only if n is in A002473.

Examples

			n=2,10,50,250 gives a(n)=2,25,255,2555; n=11,39,78, etc..a(n)=0.
10000 = 2 * 5 * 5 * 5 * 5 * 8. No product of two of these factors is less than 10 so a(10000) = 255558 (the concatenation of these factors in nondecreasing order). - _David A. Corneth_, Jul 31 2017
		

Crossrefs

Programs

  • Mathematica
    f[x_] := Apply[Times, IntegerDigits[x]] a = Table[0, {256} ]; Do[ b = f[n]; If[b < 257 && a[[b]] == 0, a[[b]] =n], {n, 1, 10000} ]; a
  • PARI
    a(n) = {if(n==1, return(1)); my(res = []); forstep(i=9,2,-1, v = valuation(n, i); if(v > 0, res = concat(vector(v, j, i), res); n/=i^v)); if(n==1,fromdigits(res), 0)} \\ David A. Corneth, Jul 31 2017
    
  • Python
    def convert(n):
        if n == 1:
            return 1
        result = 0
        cur = 1
        while n > 1:
            found = False
            for i in range(9, 1, -1):
                if n % i == 0:
                    result += cur * i
                    cur *= 10
                    n //= i
                    found = True
                    break
            if not found:
                return 0
        return result
    N = 256
    for n in range(1, N):
        print(n, convert(n))
    # Dmitry Kamenetsky, Oct 20 2008

A096867 Records in A068189 (smallest number k such that n = product of nonzero digits of k, or 0 if no such k exists).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 25, 26, 27, 35, 45, 55, 56, 57, 58, 67, 68, 77, 255, 256, 257, 355, 455, 555, 556, 557, 558, 567, 568, 577, 2555, 2556, 2557, 3555, 4555, 5555, 5556, 5557, 5558, 5567, 5568, 5577, 25555, 25556, 25557, 35555, 45555, 55555, 55556
Offset: 1

Views

Author

Klaus Brockhaus, Jul 13 2004

Keywords

Comments

Numbers n such that A068189(n) is a record are given in A096868.
Also records in A280249. - David A. Corneth, Apr 08 2021

Examples

			Product of nonzero digits of 257 is 70, for n < 70 the smallest number k such that n = product of nonzero digits of k (or 0 if no such k exists) is at most 256, hence 257 is a record.
		

Crossrefs

Extensions

Incorrect formula removed by David A. Corneth, Apr 10 2021
Showing 1-2 of 2 results.