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.

A090841 Smallest prime whose product of digits is 7^n.

This page as a plain text file.
%I A090841 #7 Nov 07 2021 09:46:29
%S A090841 11,7,11177,1777,71777,1777717,1177717771,77777177,7177717777,
%T A090841 1777777777,71777777777,1717777777777,7177777777777,17777777777777,
%U A090841 17177777777777717,7717777777777777,1177777777177777777,1777777777777777177,7777177777777777777
%N A090841 Smallest prime whose product of digits is 7^n.
%H A090841 Michael S. Branicky, <a href="/A090841/b090841.txt">Table of n, a(n) for n = 0..999</a>
%e A090841 a(6) = 1177717771 because its digital product is 7^6, and it is prime.
%p A090841 a:= proc(n) local k, t; for k from 0 do t:= min(select(isprime,
%p A090841       map(x-> parse(cat(x[])), combinat[permute]([1$k, 7$n]))));
%p A090841       if t<infinity then return t fi od
%p A090841     end:
%p A090841 seq(a(n), n=0..18);  # _Alois P. Heinz_, Nov 07 2021
%t A090841 NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = Table[0, {18}]; p = 2; Do[q = Log[7, 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 A090841 For a(8); a = Map[ FromDigits, Permutations[{1, 1, 7, 7, 7, 7, 7, 7, 7, 7}]]; Min[ Select[a, PrimeQ[ # ] &]]
%o A090841 (Python)
%o A090841 from sympy import isprime
%o A090841 from sympy.utilities.iterables import multiset_permutations as mp
%o A090841 def a(n):
%o A090841     if n < 2: return [11, 7][n]
%o A090841     digits = n
%o A090841     while True:
%o A090841         for p in mp("1"*(digits-n) + "7"*n, digits):
%o A090841             t = int("".join(p))
%o A090841             if isprime(t): return t
%o A090841         digits += 1
%o A090841 print([a(n) for n in range(19)]) # _Michael S. Branicky_, Nov 07 2021
%Y A090841 Cf. A089365, A088653, A090840, A091465, A089298.
%K A090841 base,nonn
%O A090841 0,1
%A A090841 _Robert G. Wilson v_, Dec 09 2003
%E A090841 a(17) and beyond from _Michael S. Branicky_, Nov 07 2021