A082619 Duplicate of A046399.
1, 2, 6, 66, 858, 6006, 222222, 22444422, 244868442, 6434774346
Offset: 0
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
a(3) = 66 because 66 is the smallest palindromic number with 3 distinct prime factors: 2*3*11.
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
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
The first nontrivial example is a(6) = 204204. 204204 = 2^2*3*7*11*13*17 (6 distinct prime factors). 402402 = 2*3*7*11*13*67 (6 distinct prime factors). Since 204204 is the smallest number with this property, a(6) = 204204.
generate(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); while(v <= B, if(j==1, if(v>=A && omega(fromdigits(Vecrev(digits(v)))) == n, 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) = my(x=vecprod(primes(n)), y=2*x); while(1, my(v=generate(x, y, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, Feb 07 2023
import sympy from sympy import factorint def Rev(x): rev = '' for i in str(x): rev = i + rev return int(rev) def RevFact(x): n = 2 while n < 10**8: if len(list(factorint(n).values())) == x: if len(list(factorint(Rev(n)).values())) == x: return n else: n += 1 else: n += 1 x = 1 while x < 50: print(RevFact(x)) x += 1
a(7) = 29792 because it is the smallest number that has a factorization 2^5 * 7^2 * 19 including 7 palindromic prime factors: 2, 2, 2, 2, 2, 7, 7. A046385(7) = 82728 = 2^3 * 3^3 * 383 is the smallest number with 7 palindromic prime factors and no non-palindromic prime factors. a(20) = A046385(20) = 677707776 = 2^16 * 3^3 * 383.
is_A002113(n)={Vecrev(n=digits(n))==n}; haspalf(P)={my(x=factor(P),nf=#x[,2],m=0);for(j=1,nf,if(is_A002113(x[j,1]),m+=x[j,2]));m}; for(d=1,16,for(k=1,oo,if(is_A002113(k),if(haspalf(k)==d,print1(k,", ");break)))) \\ Hugo Pfoertner, Aug 08 2019 using is_A002113 by M. F. Hasler
a(3) = 264 as 264 = 2^3 * 3 * 11 and 264 in reverse is 462 = 2 * 3 * 7 * 11, which share three prime factors 2, 3, and 11.
m=0;lst=Union@Flatten[Table[{FromDigits@Join[s=IntegerDigits@n,Reverse@s],FromDigits@Join[w=IntegerDigits@n,Rest@Reverse@w]},{n,10^5}]];Do[t=PrimeOmega@lst[[n]];If[t>m,Print@lst[[n]];m=t],{n,Length@lst}] (* Giorgos Kalogeropoulos, Oct 25 2021 *)
from sympy import factorint from itertools import product def palsthru(maxdigits): midrange = [[""], [str(i) for i in range(10)]] for digits in range(1, maxdigits+1): for p in product("0123456789", repeat=digits//2): left = "".join(p) if len(left) and left[0] == '0': continue for middle in midrange[digits%2]: yield int(left+middle+left[::-1]) def afind(maxdigits): record = -1 for p in palsthru(maxdigits): f = factorint(p, multiple=True) if p > 0 and len(f) > record: record = len(f) print(p, end=", ") afind(10) # Michael S. Branicky, Oct 25 2021
Comments