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.

This page as a plain text file.
%I A090840 #7 Nov 05 2021 09:13:09
%S A090840 11,5,11551,15551,1551551,15551551,1155555151,1555551551,11555555551,
%T A090840 1155155555551,555555515551,555555555551,5555555555551,
%U A090840 555155555555551,51555555551555551,51555555555555551,1155555555555555551,15551555555555555551,1155515555555555555551
%N A090840 Smallest prime whose product of digits is 5^n.
%H A090840 Michael S. Branicky, <a href="/A090840/b090840.txt">Table of n, a(n) for n = 0..998</a>
%e A090840 a(4) = 1551551 because its digital product is 5^4, and it is prime.
%p A090840 a:= proc(n) local k, t; for k from 0 do t:= min(select(isprime,
%p A090840       map(x-> parse(cat(x[])), combinat[permute]([1$k, 5$n]))));
%p A090840       if t<infinity then return t fi od
%p A090840     end:
%p A090840 seq(a(n), n=0..18);  # _Alois P. Heinz_, Nov 05 2021
%t A090840 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}]
%t A090840 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[ # ] &]]
%o A090840 (Python)
%o A090840 from sympy import isprime
%o A090840 from sympy.utilities.iterables import multiset_permutations as mp
%o A090840 def a(n):
%o A090840     if n < 2: return [11, 5][n]
%o A090840     digits = n + 1
%o A090840     while True:
%o A090840         for p in mp("1"*(digits-n-1) + "5"*n, digits-1):
%o A090840             t = int("".join(p) + "1")
%o A090840             if isprime(t): return t
%o A090840         digits += 1
%o A090840 print([a(n) for n in range(19)]) # _Michael S. Branicky_, Nov 05 2021
%Y A090840 Cf. A089365, A088653, A091465, A090841, A089298.
%K A090840 base,nonn
%O A090840 0,1
%A A090840 _Robert G. Wilson v_, Dec 09 2003
%E A090840 a(17) and beyond from _Michael S. Branicky_, Nov 05 2021