%I #42 Aug 05 2023 21:44:06
%S 10001,36763,1037301,1226221,9396939,12467976421,14432823441,
%T 93969696939,119092290911,1030507050301,1120237320211,1225559555221,
%U 1234469644321,1334459544331,100330272033001,101222252222101,103023070320301,121363494363121,134312696213431
%N Palindromes that have at least two distinct prime factors and whose prime factors, listed (with multiplicity) in ascending order and concatenated, form a palindrome in base 10.
%C Palindromes p in A024619 such that A037276(p) is a palindrome.
%C Terms are coprime to 10. - _David A. Corneth_, Jul 05 2023
%e 10001 = 73 * 137
%e 36763 = 97 * 379
%e 1037301 = 3 * 29 * 11923
%e 1226221 = 1021 * 1201
%e 9396939 = 3 * 101 * 31013
%t (* generate palindromes with even n *)
%t poli[n_Integer?EvenQ]:=FromDigits[Join[#,Reverse[#]]]&/@
%t DeleteCases[Tuples[Range[0,9],n/2],{0..,___}]
%t (* generate palindromes with odd n *)
%t poli[n_Integer?OddQ]:=Flatten[Table[FromDigits[Join[#,{k},Reverse[#]]]&/@
%t DeleteCases[Tuples[Range[0,9],(n-1)/2],{0..,___}],{k,0,9}]]
%t (* find ascending factor sequence *)
%t ascendFACTOR[n_Integer]:=
%t PalindromeQ[StringJoin[ToString/@Flatten[Table[#1,#2]&@@@#]]]&&
%t Length[#]>1&@FactorInteger[n]
%t (* example for palindromes of size 7 *)
%t Parallelize@Select[poli[7],ascendFACTOR]//Sort//AbsoluteTiming
%o (PARI) nextpal(n, b) = {my(m=n+1, p = 0); while (m > 0, m = m\b; p++; ); if (n+1 == b^p, p++); n = n\(b^(p\2))+1; m = n; n = n\(b^(p%2)); while (n > 0, m = m*b + n%b; n = n\b; ); m; }
%o ispal(n) = my(d=digits(n)); Vecrev(d) == d;
%o g(f) = my(s=""); for (i=1, #f~, for (j=1, f[i,2], s = concat(s, Str(f[i,1])))); eval(s);
%o isok(k) = my(f=factor(k)); if (#f~>=2, ispal(g(f)));
%o lista(nn) = {my(k=0); while (k <= nn, if (ispal(k) && isok(k), print1(k, ", ")); k = nextpal(k,10););} \\ _Michel Marcus_, Jul 11 2023
%Y Subsequence of A002113 and A024619. Cf. A037276.
%Y Similar to A364023.
%K nonn,base
%O 1,1
%A _Vitaliy Kaurov_, Jul 03 2023
|