OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..5000
FORMULA
MAPLE
N:= 6: # to get all terms of up to N digits
digrev:= proc(n) local L, Ln; L:= convert(n, base, 10); Ln:= nops(L);
add(L[i]*10^(Ln-i), i=1..Ln);
end proc:
Res:= NULL:
for d from 2 to N do
if d::even then
m:= d/2;
Res:= Res, select(numtheory:-bigomega=6,
[seq](n*10^m + digrev(n), n=10^(m-1)..10^m-1));
else
m:= (d-1)/2;
Res:= Res, select(numtheory:-bigomega=6,
[seq](seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1));
fi
od:
map(op, [Res]); # Robert Israel, Dec 23 2014
PROG
(Python)
from sympy import factorint
def palQgen10(l): # generator of palindromes in base 10 of length <= 2*l
if l > 0:
yield 0
for x in range(1, l+1):
for y in range(10**(x-1), 10**x):
s = str(y)
yield int(s+s[-2::-1])
for y in range(10**(x-1), 10**x):
s = str(y)
yield int(s+s[::-1])
A046332_list = [x for x in palQgen10(4) if sum(list(factorint(x).values())) == 6]
# Chai Wah Wu, Dec 21 2014
(PARI) A046332_upto(N, start=1, num_fact=6)={ my(L=List()); while(N >= start = nxt_A002113(start), bigomega(start)==num_fact && listput(L, start)); L} \\ M. F. Hasler, Jun 06 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Jun 15 1998
STATUS
approved