OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Squarefree.
EXAMPLE
4114 = 2 * 11^2 * 17.
MATHEMATICA
sfQ[n_]:=Max[Transpose[FactorInteger[n]][[2]]]>1; palQ[n_]:=FromDigits[Reverse[IntegerDigits[n]]]==n; Select[Range[2, 3776], sfQ[#] && palQ[#] &] (* Jayanta Basu, May 12 2013 *)
Select[Range[4000], PalindromeQ[#] && !SquareFreeQ[#] &] (* Amiram Eldar, Feb 25 2021 *)
PROG
(Python)
from itertools import product
from sympy.ntheory.factor_ import core
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 okpal(p): return p > 3 and core(p, 2) != p
print(list(filter(okpal, palsthru(4)))) # Michael S. Branicky, Apr 08 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Nov 15 1998
STATUS
approved