login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A090841 Smallest prime whose product of digits is 7^n. 6
11, 7, 11177, 1777, 71777, 1777717, 1177717771, 77777177, 7177717777, 1777777777, 71777777777, 1717777777777, 7177777777777, 17777777777777, 17177777777777717, 7717777777777777, 1177777777177777777, 1777777777777777177, 7777177777777777777 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..999
EXAMPLE
a(6) = 1177717771 because its digital product is 7^6, and it is prime.
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, 7$n]))));
if t<infinity then return t fi od
end:
seq(a(n), n=0..18); # Alois P. Heinz, Nov 07 2021
MATHEMATICA
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}]
For a(8); a = Map[ FromDigits, Permutations[{1, 1, 7, 7, 7, 7, 7, 7, 7, 7}]]; Min[ Select[a, PrimeQ[ # ] &]]
PROG
(Python)
from sympy import isprime
from sympy.utilities.iterables import multiset_permutations as mp
def a(n):
if n < 2: return [11, 7][n]
digits = n
while True:
for p in mp("1"*(digits-n) + "7"*n, digits):
t = int("".join(p))
if isprime(t): return t
digits += 1
print([a(n) for n in range(19)]) # Michael S. Branicky, Nov 07 2021
CROSSREFS
Sequence in context: A002749 A055505 A159526 * A085757 A003567 A085688
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Dec 09 2003
EXTENSIONS
a(17) and beyond from Michael S. Branicky, Nov 07 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 18 22:56 EDT 2024. Contains 370952 sequences. (Running on oeis4.)