login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A035132 Nonsquarefree palindromes. 6

%I #29 Apr 09 2021 02:32:00

%S 4,8,9,44,88,99,121,171,212,232,242,252,272,292,333,343,363,404,414,

%T 424,444,464,484,525,575,585,616,636,656,666,676,686,696,747,808,828,

%U 848,868,888,909,999,1331,1881,2112,2332,2552,2662,2772,2992,3663,3773

%N Nonsquarefree palindromes.

%H Amiram Eldar, <a href="/A035132/b035132.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Squarefree.html">Squarefree</a>.

%e 4114 = 2 * 11^2 * 17.

%t 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 *)

%t Select[Range[4000], PalindromeQ[#] && !SquareFreeQ[#] &] (* _Amiram Eldar_, Feb 25 2021 *)

%o (Python)

%o from itertools import product

%o from sympy.ntheory.factor_ import core

%o def palsthru(maxdigits):

%o midrange = [[""], [str(i) for i in range(10)]]

%o for digits in range(1, maxdigits+1):

%o for p in product("0123456789", repeat=digits//2):

%o left = "".join(p)

%o if len(left) and left[0] == '0': continue

%o for middle in midrange[digits%2]: yield int(left+middle+left[::-1])

%o def okpal(p): return p > 3 and core(p, 2) != p

%o print(list(filter(okpal, palsthru(4)))) # _Michael S. Branicky_, Apr 08 2021

%Y Intersection of A002113 and A013929.

%Y Supersequence of A077572.

%Y Cf. A005117, A035133, A071251, A075804 (first differences).

%K nonn,base

%O 1,1

%A _Patrick De Geest_, Nov 15 1998

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:56 EDT 2024. Contains 371964 sequences. (Running on oeis4.)