[go: up one dir, main page]

login
A335645
Smallest palindrome with exactly n distinct prime factors.
3
1, 2, 6, 66, 858, 6006, 222222, 20522502, 244868442, 6172882716, 231645546132, 49795711759794, 2415957997595142, 495677121121776594, 22181673755737618122, 5521159517777159511255, 477552751050050157255774, 200345274602020206472543002
OFFSET
0,2
COMMENTS
max{A002110(n), A076886(n), A239696(n)} <= a(n) <= A046399(n).
No more terms with less than 17 digits.
Next term: 10^16 <= a(13) <= 495677121121776594.
EXAMPLE
a(3) = 66 because 66 is the smallest palindromic number with 3 distinct prime factors: 2*3*11.
PROG
(Python)
from sympy import factorint
def A335645(n):
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 len(factorint(m)) == n:
return m
d += 1
print([A335645(n) for n in range(8)]) # Michael S. Branicky, Oct 02 2020
(PARI)
omega_palindromes(A, B, n) = A=max(A, vecprod(primes(n))); (f(m, p, j) = my(list=List()); forprime(q=p, sqrtnint(B\m, j), my(v=m*q); if(q == 5 && v%2 == 0, next); while(v <= B, if(j==1, if(v>=A && fromdigits(Vecrev(digits(v))) == v, listput(list, v)), if(v*(q+1) <= B, list=concat(list, f(v, q+1, j-1)))); v *= q)); list); vecsort(Vec(f(1, 2, n)));
a(n) = if(n==0, return(1)); my(x=vecprod(primes(n)), y=2*x); while(1, my(v=omega_palindromes(x, y, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, Feb 05 2023
CROSSREFS
Subsequence of A002113.
Sequence in context: A262047 A280393 A239696 * A082619 A046399 A082617
KEYWORD
nonn,base,hard
AUTHOR
Michael S. Branicky, Oct 02 2020
EXTENSIONS
a(13) from Michael S. Branicky and David A. Corneth, Oct 03 2020
a(14) from David A. Corneth, Oct 03 2020
a(15) from Daniel Suteu, Feb 05 2023
a(16) from Michael S. Branicky, Feb 06 2023
a(17) from Michael S. Branicky, Feb 23 2023
STATUS
approved