A089365
Smallest prime whose product of digits is 2^n.
Original entry on oeis.org
11, 2, 41, 181, 281, 1481, 881, 4481, 18481, 48281, 48481, 228881, 284881, 828881, 884881, 4448881, 4848881, 18848881, 24888881, 48888841, 88884881, 188888881, 888828881, 848888881, 4848488881, 4488888881, 18848888881, 28888884881
Offset: 0
a(8) = 24481 and the digital product is 2^8.
-
NextPrim[n_] := Block[{k = n + 1}, While[ ! PrimeQ[k], k++ ]; k]; a = Table[0, {24}]; p = 2; Do[q = Log[2, Times @@ IntegerDigits[p]]; If[q != 0 && IntegerQ[q] && a[[q]] == 0, a[[q]] = p; Print[q, " = ", p]]; p = NextPrim[p], {n, 1, 10^9}] (* Robert G. Wilson v, Nov 08 2003 *)
For a(8): a = Map[ FromDigits, Join[{0}, #, {1}] & /@ Permutations[{2, 8, 8 }]]; Min[ Select[a, PrimeQ[ # ] & ]] (* Robert G. Wilson v, Nov 08 2003 *)
A091465
Smallest prime with digit product 6^n.
Original entry on oeis.org
11, 23, 149, 389, 6389, 38669, 89899, 688999, 4998989, 46998899, 288989999, 2688989999, 8889899999, 68898899999, 1488988999999, 3888998899999, 128889898999999, 348889899899999, 1888888999999999, 16888888999999999
Offset: 0
-
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = Table[0, {10}]; p = 2; Do[ q = Log[6, Times @@ IntegerDigits[p]]; If[q != 0 && IntegerQ[q] && a[[q]] == 0, a[[q]] = p; Print[q, " = ", p]]; p = NextPrim[p], {n, 1, 10^9}]; a
A088653
Smallest prime whose product of digits is 3^n.
Original entry on oeis.org
11, 3, 19, 139, 199, 1399, 1999, 13999, 99991, 139999, 199999, 1399999, 9999991, 19399999, 19999999, 919999939, 1399939999, 1999993999, 9199999999, 19399999999, 99999199999, 199999939999, 991999999999, 1999399999999
Offset: 0
a(5) = 1399 and the digital product is 3^5.
-
NextPrim[n_] := Block[{k = n + 1}, While[ ! PrimeQ[k], k++ ]; k]; a = Table[0, {18}]; p = 2; Do[q = Log[3, 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(23): a = Map[ FromDigits, Join[{0}, # ] & /@ Permutations[{1, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 }]]; Min[ Select[a, PrimeQ[ # ] & ]]
For a(11): a = Map[ FromDigits, Permutations[{2, 6, 8, 8, 8, 9, 9, 9, 9, 9}]]; Min[ Select[a, PrimeQ[ # ] & ]]
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
a(4) = 1551551 because its digital product is 5^4, and it is prime.
-
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
-
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[ # ] &]]
-
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
A090841
Smallest prime whose product of digits is 7^n.
Original entry on oeis.org
11, 7, 11177, 1777, 71777, 1777717, 1177717771, 77777177, 7177717777, 1777777777, 71777777777, 1717777777777, 7177777777777, 17777777777777, 17177777777777717, 7717777777777777, 1177777777177777777, 1777777777777777177, 7777177777777777777
Offset: 0
a(6) = 1177717771 because its digital product is 7^6, and it is prime.
-
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 tAlois P. Heinz, Nov 07 2021
-
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[ # ] &]]
-
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
Showing 1-5 of 5 results.