cp's OEIS Frontend

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.

A335645 Smallest palindrome with exactly n distinct prime factors.

This page as a plain text file.
%I A335645 #38 Feb 23 2023 19:20:38
%S A335645 1,2,6,66,858,6006,222222,20522502,244868442,6172882716,231645546132,
%T A335645 49795711759794,2415957997595142,495677121121776594,
%U A335645 22181673755737618122,5521159517777159511255,477552751050050157255774,200345274602020206472543002
%N A335645 Smallest palindrome with exactly n distinct prime factors.
%C A335645 max{A002110(n), A076886(n), A239696(n)} <= a(n) <= A046399(n).
%C A335645 No more terms with less than 17 digits.
%C A335645 Next term: 10^16 <= a(13) <= 495677121121776594.
%H A335645 Michael S. Branicky, <a href="/A335645/a335645.py.txt">Python program (translation of Suteu's PARI)</a>
%e A335645 a(3) = 66 because 66 is the smallest palindromic number with 3 distinct prime factors: 2*3*11.
%o A335645 (Python)
%o A335645 from sympy import factorint
%o A335645 def A335645(n):
%o A335645   d = 1
%o A335645   while True:
%o A335645     half = (d+1)//2
%o A335645     for left in range(10**(half-1), 10**half):
%o A335645       strleft = str(left)
%o A335645       if d%2 == 0:
%o A335645         m = int(strleft + strleft[::-1])
%o A335645       else:
%o A335645         m = int(strleft + (strleft[:-1])[::-1])
%o A335645       if len(factorint(m)) == n:
%o A335645         return m
%o A335645     d += 1
%o A335645 print([A335645(n) for n in range(8)]) # _Michael S. Branicky_, Oct 02 2020
%o A335645 (PARI)
%o A335645 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)));
%o A335645 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
%Y A335645 Subsequence of A002113.
%Y A335645 Cf. A002110, A046399, A076886, A239696.
%K A335645 nonn,base,hard
%O A335645 0,2
%A A335645 _Michael S. Branicky_, Oct 02 2020
%E A335645 a(13) from _Michael S. Branicky_ and _David A. Corneth_, Oct 03 2020
%E A335645 a(14) from _David A. Corneth_, Oct 03 2020
%E A335645 a(15) from _Daniel Suteu_, Feb 05 2023
%E A335645 a(16) from _Michael S. Branicky_, Feb 06 2023
%E A335645 a(17) from _Michael S. Branicky_, Feb 23 2023