|
|
A076886
|
|
Smallest palindrome with exactly n prime factors (counted with multiplicity).
|
|
5
|
|
|
1, 2, 4, 8, 88, 252, 2772, 27872, 2112, 4224, 8448, 44544, 48384, 2977792, 27011072, 405504, 4091904, 441606144, 405909504, 886898688, 677707776, 4285005824, 276486684672, 21128282112, 633498894336, 2701312131072, 6739855589376, 29142024192, 65892155129856
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(4)=88 because 88 is the smallest palindromic number with 4 prime factors, 2^3*11 (counted with multiplicity).
|
|
PROG
|
(Python)
from sympy import factorint
d = 1
while True:
half = (d+1)//2
for left in range(10**(half-1), 10**half):
strleft = str(left)
if d%2 == 0:
m = int(strleft + strleft[::-1])
else:
m = int(strleft + (strleft[:-1])[::-1])
if sum(list(factorint(m).values())) == n:
return m
d += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|