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.

A090840 Smallest prime whose product of digits is 5^n.

Original entry on oeis.org

11, 5, 11551, 15551, 1551551, 15551551, 1155555151, 1555551551, 11555555551, 1155155555551, 555555515551, 555555555551, 5555555555551, 555155555555551, 51555555551555551, 51555555555555551, 1155555555555555551, 15551555555555555551, 1155515555555555555551
Offset: 0

Views

Author

Robert G. Wilson v, Dec 09 2003

Keywords

Examples

			a(4) = 1551551 because its digital product is 5^4, and it is prime.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local k, t; for k from 0 do t:= min(select(isprime,
          map(x-> parse(cat(x[])), combinat[permute]([1$k, 5$n]))));
          if tAlois P. Heinz, Nov 05 2021
  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = Table[0, {18}]; p = 2; Do[q = Log[5, Times @@ IntegerDigits[p]]; If[q != 0 && IntegerQ[q] && a[[q]] == 0, a[[q]] = p; Print[q, " = ", p]]; p = NextPrim[p], {n, 1, 10^9}]
    For a(13); a = Map[ FromDigits, Permutations[{1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}]]; Min[ Select[a, PrimeQ[ # ] &]]
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations as mp
    def a(n):
        if n < 2: return [11, 5][n]
        digits = n + 1
        while True:
            for p in mp("1"*(digits-n-1) + "5"*n, digits-1):
                t = int("".join(p) + "1")
                if isprime(t): return t
            digits += 1
    print([a(n) for n in range(19)]) # Michael S. Branicky, Nov 05 2021

Extensions

a(17) and beyond from Michael S. Branicky, Nov 05 2021