A348320 Perfect powers m^k, k >= 2 of palindromes m when m^k is not a palindrome.
16, 25, 27, 32, 36, 49, 64, 81, 125, 128, 216, 243, 256, 512, 625, 729, 1024, 1089, 1296, 1936, 2048, 2187, 2401, 3025, 3125, 4096, 4356, 5929, 6561, 7744, 7776, 8192, 9801, 10648, 15625, 16384, 16807, 17161, 19683, 19881, 22801, 25921, 29241, 32761, 32768, 35937, 36481, 46656
Offset: 1
Examples
216 = 6^3, 1936 = 44^2, 4096 = 8^4, 7776 = 6^5, 35937 = 33^3, 117649 = 7^6 are terms.
Links
- Gustavus J. Simmons, Palindromic Powers, J. Rec. Math., Vol. 3, No. 2 (1970), pp. 93-98 [Annotated scanned copy].
Programs
-
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 *)
-
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
-
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
Comments