OFFSET
1,1
COMMENTS
The original name "Palindromes with exactly 7 distinct prime factors" did not exclude that one or more of the factors occurred to a higher power: this is sequence A373467. As the listed data show, terms of this sequence must be squarefree. - M. F. Hasler, Jun 06 2024
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The first two palindromes with 7 distinct prime factors are 20522502 = 2 * 3^2 * 7 * 11 * 13 * 17 * 67 and 21033012 = 2^2 * 3 * 7 * 11 * 13 * 17 * 103, but these are excluded since one of the prime factors occurs to a higher power.
a(1) = 22444422 = 2 * 3 * 7 * 11 * 13 * 37 * 101, which is squarefree, is therefore the first term of this sequence.
MAPLE
digrev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
filter:= proc(n) local F;
F:= ifactors(n)[2];
nops(F) = 7 and map(t -> t[2], F)=[1$7]
end proc:
Res:= NULL:
count:= 0:
for d from 2 while count < 100 do
if d::even then
m:= d/2;
for n from 10^(m-1) to 10^m-1 while count < 100 do
v:= n*10^m+digrev(n);
if filter(v) then count:= count+1; Res:= Res, v; fi;
od;
else
m:= (d-1)/2;
for n from 10^(m-1) to 10^m-1 while count < 100 do
for y from 0 to 9 while count < 100 do
v:= n*10^(m+1)+y*10^m+digrev(n);
if filter(v) then count:= count+1; Res:= Res, v; fi;
od od
fi
od:
Res; # Robert Israel, Jan 20 2020
PROG
(PARI) A046397_upto(N, start=vecprod(primes(7)), num_fact=7)={ my(L=List()); is_A002113(start)&& start--; while(N >= start = nxt_A002113(start), omega(start)==num_fact && issquarefree(start) && listput(L, start)); L} \\ M. F. Hasler, Jun 06 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Jun 15 1998
STATUS
approved