login
Search: a107693 -id:a107693
     Sort: relevance | references | number | modified | created      Format: long | short | data
Primes with digital product = 3.
+10
17
3, 13, 31, 113, 131, 311, 11113, 11131, 11311, 113111, 131111, 311111, 11111131, 11111311, 11113111, 11131111, 111111113, 111111131, 111113111, 131111111, 11111111113, 11111111131, 11113111111, 11131111111, 31111111111
OFFSET
1,1
LINKS
MATHEMATICA
Flatten[ Table[ Select[ Sort[ FromDigits /@ Permutations[ Flatten[{3, Table[1, {n}]}]]], PrimeQ[ # ] &], {n, 0, 12}]]
PROG
(Python)
from sympy import isprime
def agen():
digits = 0
while True:
for i in range(digits+1):
t = int("1"*(digits-i) + "3" + "1"*i)
if isprime(t): yield t
digits += 1
g = agen()
print([next(g) for i in range(25)]) # Michael S. Branicky, Mar 13 2021
KEYWORD
base,nonn
AUTHOR
STATUS
approved
Primes with digital product = 2.
+10
16
2, 211, 2111, 111121, 111211, 112111, 1111211, 1111111121, 1111211111, 1121111111, 111111211111, 111211111111, 2111111111111, 111111111111112111, 111111112111111111, 111111211111111111, 112111111111111111
OFFSET
1,1
COMMENTS
Corresponding indices of primes in A107611. Cf. A053666, A101987.
LINKS
FORMULA
A107612(n) = prime(A107611(n)).
MAPLE
for i from 0 to 30 do it:=sum(10^j, j=0..i): for k from 0 to i do if isprime(it+10^k) then printf(`%d, `, it+10^k) fi: od:od: (Sellers)
MATHEMATICA
Flatten[ Table[ Select[ Sort[ FromDigits /@ Permutations[ Flatten[{2, Table[1, {n}]}]]], PrimeQ[ # ] &], {n, 0, 19}]] (* Robert G. Wilson v, May 19 2005 *)
Select[Flatten[Table[FromDigits/@Permutations[PadRight[{2}, n, 1]], {n, 20}]], PrimeQ]//Sort (* Harvey P. Dale, May 28 2017 *)
KEYWORD
base,nonn
AUTHOR
Zak Seidov, May 17 2005
EXTENSIONS
More terms from Robert G. Wilson v and James A. Sellers, May 19 2005
STATUS
approved
Smallest prime whose digital product = n or 0 if impossible.
+10
15
11, 2, 3, 41, 5, 23, 7, 181, 19, 251, 0, 43, 0, 127, 53, 281, 0, 29, 0, 541, 37, 0, 0, 83, 11551, 0, 139, 47, 0, 523, 0, 1481, 0, 0, 157, 149, 0, 0, 0, 12451, 0, 67, 0, 0, 59, 0, 0, 283, 11177, 2551, 0, 0, 0, 239, 0, 1187, 0, 0, 0, 1453, 0, 0, 79, 881, 0, 0, 0, 0, 0, 257, 0
OFFSET
1,1
COMMENTS
Zeros appear at A068191.
EXAMPLE
a(20)=541 because 5*4*1=20 and there is no prime less than a(20) which exhibits this characteristic.
MATHEMATICA
f[n_] := If[ Max[ First /@ FactorInteger[n]] > 7, 0, p = 1; While[Times @@ IntegerDigits[ Prime[p]] != n, p++ ]; Prime[p]]; Table[ f[n], {n, 30}]
KEYWORD
base,nonn
AUTHOR
STATUS
approved
Primes with digital product = 4.
+10
12
41, 4111, 11411, 12211, 21121, 21211, 22111, 112121, 1114111, 11111141, 11141111, 111112121, 111121121, 112111211, 112112111, 121111121, 121112111, 122111111, 212111111, 1111111411, 1111411111, 11111121121, 11111121211, 11111211121
OFFSET
1,1
LINKS
MATHEMATICA
Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{4, Table[1, {n}]}]], Permutations[ Flatten[{2, 2, Table[1, {n - 1}]}] ]]], PrimeQ[ # ] &], {n, 0, 10}]]
PROG
(Magma) [p: p in PrimesUpTo(10^8) | &*Intseq(p) eq 4]; // Vincenzo Librandi, Jun 30 2017
KEYWORD
base,nonn
AUTHOR
STATUS
approved
Primes with digital product = 5.
+10
12
5, 151, 1151, 1511, 511111, 1111151, 115111111, 1111115111, 1115111111, 1151111111, 111111111511, 111511111111, 1111151111111, 5111111111111, 111111151111111, 111151111111111, 5111111111111111, 111115111111111111111, 1111111111111111111511
OFFSET
1,1
LINKS
MAPLE
select(isprime, [seq(seq((10^m-1)/9 + 4*10^j, j=0..m-1), m=1..40)]); # Robert Israel, Jan 03 2017
MATHEMATICA
Flatten[ Table[ Select[ Sort[ FromDigits /@ Permutations[Flatten[{5, Table[1, {n}]} ]]], PrimeQ[ # ] &], {n, 0, 21}]]
Select[Prime[Range[3 10^6]], Times@@IntegerDigits[#] == 5 &] (* Vincenzo Librandi, Jul 27 2016 *)
PROG
(Magma) [p: p in PrimesUpTo(3*10^8) | &*Intseq(p) eq 5]; // Vincenzo Librandi, Jul 27 2016
KEYWORD
base,nonn
AUTHOR
STATUS
approved
Primes whose product of digits is 6.
+10
12
23, 61, 1123, 1213, 1231, 1321, 2113, 2131, 2311, 3121, 11161, 11213, 11321, 12113, 13121, 16111, 31121, 111611, 611111, 1111213, 1112113, 1112131, 1131121, 1211311, 2111311, 3112111, 11111161, 11112113, 11211131, 11231111, 11312111
OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10199 (all terms with <= 136 digits; terms 1..1000 from Harvey P. Dale)
MATHEMATICA
Union[ Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{6, Table[1, {n}]}]], Permutations[ Flatten[{2, 3, Table[ 1, {n - 1}]}] ]]], PrimeQ[ # ] &], {n, 0, 7}]]]
Select[Prime[Range[750000]], Times@@IntegerDigits[#]==6&] (* Harvey P. Dale, May 29 2016 *)
PROG
(Python)
from sympy import prod, isprime
from sympy.utilities.iterables import multiset_permutations
def agen(maxdigits):
for digs in range(1, maxdigits+1):
for mp in multiset_permutations("1"*(digs-1) + "236", digs):
if prod(map(int, mp)) == 6:
t = int("".join(mp))
if isprime(t): yield t
print(list(agen(8))) # Michael S. Branicky, Jun 16 2021
KEYWORD
base,nonn
AUTHOR
STATUS
approved
Primes with digital product = 9.
+10
12
19, 191, 313, 331, 911, 11119, 111119, 111191, 113131, 131113, 131311, 911111, 1131113, 1131131, 1311131, 1311311, 3111131, 3113111, 11111119, 11111911, 11911111, 111111313, 111111331, 111113113, 111113131, 111131131, 111133111
OFFSET
1,1
LINKS
MATHEMATICA
Union[ Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{9, Table[1, {n}]}]], Permutations[ Flatten[{3, 3, Table[1, {n - 1}]}]]]], PrimeQ[ # ] & ], {n, 0, 8}]]]
Select[Prime[Range[3 10^6]], Times@@IntegerDigits[#] == 9 &] (* Vincenzo Librandi, Jul 27 2016 *)
PROG
(Magma) [p: p in PrimesUpTo(3*10^7) | &*Intseq(p) eq 9]; // Vincenzo Librandi, Jul 27 2016
KEYWORD
base,nonn
AUTHOR
STATUS
approved
Primes with digital product = 10.
+10
12
251, 521, 11251, 12511, 15121, 25111, 111521, 115211, 121151, 151121, 152111, 211151, 511211, 11152111, 11511211, 12111511, 15111211, 15121111, 51111211, 111121151, 111512111, 112111511, 112151111, 112511111, 115211111, 121511111, 151211111
OFFSET
1,1
MATHEMATICA
Flatten[ Table[ Select[ Sort[ FromDigits /@ Permutations[ Flatten[{2, 5, Table[1, {n}]} ]]], PrimeQ[ # ] &], {n, 0, 8}]]
Select[Prime[Range[3 10^6]], Times@@IntegerDigits[#] == 10 &] (* Vincenzo Librandi, Jul 27 2016 *)
PROG
(Magma) [p: p in PrimesUpTo(3*10^6) | &*Intseq(p) eq 10]; // Vincenzo Librandi, Jul 27 2016
KEYWORD
base,nonn
AUTHOR
STATUS
approved
Primes with digital product = 8.
+10
11
181, 241, 421, 811, 1181, 1811, 2141, 2221, 2411, 4211, 8111, 21221, 141121, 142111, 411211, 1111181, 1112141, 1121221, 1211141, 1211411, 1212121, 2111411, 2121121, 2211211, 2221111, 2411111, 4121111, 4211111, 11221211, 12111221, 12121121
OFFSET
1,1
MATHEMATICA
Union[ Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{8, Table[1, {n}]}]], Permutations[ Flatten[{2, 4, Table[1, {n - 1}]}]], Permutations[ Flatten[{2, 2, 2, Table[1, {n - 2}]}] ]]], PrimeQ[ # ] & ], {n, 0, 7}]]]
Select[Prime[Range[3 10^6]], Times@@IntegerDigits[#] == 8 &] (* Vincenzo Librandi, Jul 27 2016 *)
PROG
(Magma) [p: p in PrimesUpTo(3*10^7) | &*Intseq(p) eq 8]; // Vincenzo Librandi, Jul 27 2016
KEYWORD
base,nonn
AUTHOR
STATUS
approved
Primes with digital product = 12.
+10
11
43, 223, 431, 1223, 1621, 2161, 2213, 3221, 6121, 6211, 11261, 11621, 12161, 12611, 13411, 21611, 26111, 41113, 41131, 61121, 61211, 111143, 111341, 111431, 112213, 114113, 114311, 121123, 121321, 122131, 123121, 131221, 141131, 141311, 143111
OFFSET
1,1
LINKS
MATHEMATICA
Union[ Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{2, 6, Table[1, {n - 1}]}]], Permutations[ Flatten[{3, 4, Table[1, {n - 1}]}]], Permutations[ Flatten[{2, 2, 3, Table[1, {n - 2}]}] ]]], PrimeQ[ # ] & ], {n, 0, 5}]]]
Select[Prime[Range[75000]], Times@@IntegerDigits[#] == 12 &] (* Vincenzo Librandi, Jul 27 2016 *)
PROG
(Magma) [p: p in PrimesUpTo(1000000) | &*Intseq(p) eq 12]; // Vincenzo Librandi, Jul 27 2016
KEYWORD
base,nonn
AUTHOR
STATUS
approved

Search completed in 0.012 seconds