OFFSET
1,1
COMMENTS
LINKS
Gustavus J. Simmons, Palindromic Powers, J. Rec. Math., Vol. 3, No. 2 (1970), pp. 93-98 [Annotated scanned copy].
EXAMPLE
216 = 6^3, 1936 = 44^2, 4096 = 8^4, 7776 = 6^5, 35937 = 33^3, 117649 = 7^6 are terms.
MATHEMATICA
seq[max_] := Module[{m = Floor@Sqrt[max], s = {}, n, p}, Do[If[! PalindromeQ[k], Continue[]]; n = Floor@Log[k, max]; Do[If[! PalindromeQ[(p = k^j)], AppendTo[s, p]], {j, 2, n}], {k, 2, m}]; Union[s]]; seq[50000] (* Amiram Eldar, Oct 12 2021 *)
PROG
(Python)
def ispal(n): s = str(n); return s == s[::-1]
def aupto(limit):
aset, m, mm = set(), 2, 4
while mm <= limit:
if ispal(m):
mk = mm
while mk <= limit:
if not ispal(mk): aset.add(mk)
mk *= m
mm += 2*m + 1
m += 1
return sorted(aset)
print(aupto(47000)) # Michael S. Branicky, Oct 12 2021
(PARI) ispal(x) = my(d=digits(x)); d == Vecrev(d);
isok(x) = my(q); ispower(x, , &q) && !ispal(x) && ispal(q); \\ Michel Marcus, Oct 14 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Oct 12 2021
STATUS
approved