A059868 There exist no palindromic pentagonal numbers of length a(n).
3, 9, 11, 12, 24, 30, 32, 33
Offset: 1
Links
- Patrick De Geest, Palindromic pentagonals
Programs
-
Mathematica
A002069 = {0, 1, 5, 22, 1001, 2882, 15251, 720027, 7081807, 7451547, 26811862, 54177145, 1050660501, 1085885801, 1528888251, 2911771192, 2376574756732, 5792526252975, 5875432345785, 10810300301801, 264571020175462, 5292834004382925, 10808388588380801, 15017579397571051, 76318361016381367, 150621384483126051, 735960334433069537, 1003806742476083001, 1087959810189597801, 2716280733370826172}; A059868[n_] := Length[Select[A002069, IntegerLength[#] == n || (n == 1 && # == 0) &]]; Select[Range[18], A059868[#] == 0 &] (* Robert Price, Apr 26 2019 *)
-
Python
def ispal(n): s = str(n); return s == s[::-1] def penpals(limit): for k in range(limit+1): if ispal(k*(3*k-1)//2): yield k*(3*k-1)//2 def aupto(limit): lengths = set(range(1, limit+1)) for p in penpals(10**limit): lp, minlen = len(str(p)), min(lengths) for li in list(lengths): if li < lp: print(li, "in A059868"); lengths.discard(li) if lp in lengths: lengths.discard(lp); print("... discarding", lp) if len(lengths) == 0: return aupto(15) # Michael S. Branicky, Mar 09 2021
Extensions
Name clarified by David A. Corneth, Apr 26 2019
a(6)-a(8) from Bert Dobbelaere, Apr 15 2025