A035090
Non-palindromic squares which when written backwards remain square (and still have the same number of digits).
Original entry on oeis.org
144, 169, 441, 961, 1089, 9801, 10404, 10609, 12544, 12769, 14884, 40401, 44521, 48841, 90601, 96721, 1004004, 1006009, 1022121, 1024144, 1026169, 1042441, 1044484, 1062961, 1212201, 1214404, 1216609, 1236544, 1238769, 1256641
Offset: 1
Reversing a polytopal number gives a polytopal number:
tetrahedral to tetrahedral:
A006030;
-
rev:= proc(n) local L,i;
L:= convert(n,base,10);
add(L[-i]*10^(i-1),i=1..nops(L))
end proc:
filter:= proc(n) local t;
if n mod 10 = 0 then return false fi;
t:= rev(n);
t <> n and issqr(t)
end proc:
select(filter, [seq(n^2, n=1..10^5)]); # Robert Israel, Sep 20 2015
-
Select[Range[1200]^2,!PalindromeQ[#]&&IntegerLength[#]==IntegerLength[ IntegerReverse[ #]] && IntegerQ[Sqrt[IntegerReverse[#]]]&] (* Harvey P. Dale, Jul 19 2023 *)
A002780
Numbers whose cube is a palindrome.
Original entry on oeis.org
0, 1, 2, 7, 11, 101, 111, 1001, 2201, 10001, 10101, 11011, 100001, 101101, 110011, 1000001, 1001001, 1100011, 10000001, 10011001, 10100101, 11000011, 100000001, 100010001, 100101001, 101000101, 110000011, 1000000001, 1000110001
Offset: 1
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- T. D. Noe, Table of n, a(n) for n = 1..89 (from De Geest)
- Patrick De Geest, Palindromic Cubes
- G. J. Simmons, Palindromic powers, J. Rec. Math., 3 (No. 2, 1970), 93-98. [Annotated scanned copy]
- G. J. Simmons, On palindromic squares of non-palindromic numbers, J. Rec. Math., 5 (No. 1, 1972), 11-19. [Annotated scanned copy]
Cf.
A002781 (cubes of these numbers).
-
isok(k) = my(d=digits(k^3)); Vecrev(d) == d; \\ Michel Marcus, Aug 02 2022
-
def ispal(s): return s == s[::-1]
def ok(n): return ispal(str(n**3))
print([k for k in range(10**7) if ok(k)]) # Michael S. Branicky, Aug 02 2022
A135066
Primes p such that p^3 is a palindrome.
Original entry on oeis.org
a(3) = 11 because 11^3 = 1331 is a palindrome.
Cf.
A002780 (cube is a palindrome),
A069748 (n and n^3 are both palindromes),
A002781 (palindromic cubes),
A135067 (palindromic cubes of primes).
-
Do[ p = Prime[n]; f = p^3; If[ f == FromDigits[ Reverse[ IntegerDigits[ f ] ] ], Print[ {n, p, f} ]], {n, 1, 200000} ]
-
from sympy import nextprime
def ispal(n): s = str(n); return s == s[::-1]
p = 2
while True:
if ispal(p**3): print(p)
p = nextprime(p) # Michael S. Branicky, Feb 07 2021
A135067
Palindromic cubes p^3, where p is a prime.
Original entry on oeis.org
8, 343, 1331, 1030301
Offset: 1
a(3) = 1331 because 11^3 = 1331 is a palindrome and 11 is a prime.
Cf.
A002780 = Cube is a palindrome. Cf.
A069748 = Numbers n such that n and n^3 are both palindromes. Cf.
A002781 = Palindromic cubes. Cf.
A135066 = Primes p such that p^3 is a palindrome.
-
Do[ p = Prime[n]; f = p^3; If[ f == FromDigits[ Reverse[ IntegerDigits[ f ] ] ], Print[ {n, p, f} ]], {n, 1, 200000} ]
Select[Prime[Range[200]]^3,PalindromeQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 26 2021 *)
A348429
Perfect powers m^k, m >= 1, k >= 2 such that m and m^k both are palindromes.
Original entry on oeis.org
1, 4, 8, 9, 121, 343, 484, 1331, 10201, 12321, 14641, 40804, 44944, 1002001, 1030301, 1234321, 1367631, 4008004, 100020001, 102030201, 104060401, 121242121, 123454321, 125686521, 400080004, 404090404, 1003003001, 10000200001, 10221412201, 12102420121, 12345654321, 40000800004
Offset: 1
First few terms are equal to 1, 2^2, 2^3, 3^2, 11^2, 7^3, 22^2, 11^3, 101^2, 111^2, 11^4 = 121^2, 202^2, 212^2, 1001^2, 101^3, 1111^2, 111^3.
-
Block[{n = 10^6, nn, s}, s = Select[Range[2, n], PalindromeQ]; nn = Max[s]^2; {1}~Join~Union@ Reap[Table[Do[If[PalindromeQ[m^k], Sow[m^k]], {k, 2, Log[m, nn]}], {m, s}]][[-1, -1]]] (* Michael De Vlieger, Oct 18 2021 *)
-
ispal(x) = my(d=digits(x)); d == Vecrev(d); \\ A002113
isok(m) = if (m==1, return (1)); my(p); ispal(m) && ispower(m, , &p) && ispal(p); \\ Michel Marcus, Oct 19 2021
-
ispal(x) = my(d=digits(x)); d == Vecrev(d); \\ A002113
lista(nn) = {my(list = List(1)); for (k=2, sqrtint(nn), if (ispal(k), my(q = k^2); until (q > nn, if (ispal(q), listput(list, q)); q *= k;););); vecsort(list,,8);} \\ Michel Marcus, Oct 20 2021
-
# see link for faster version
def ispal(n): s = str(n); return s == s[::-1]
def aupto(limit):
aset, m, mm = {1}, 2, 4
while mm <= limit:
if ispal(m):
mk = mm
while mk <= limit:
if ispal(mk): aset.add(mk)
mk *= m
mm += 2*m + 1
m += 1
return sorted(aset)
print(aupto(10**11)) # Michael S. Branicky, Oct 18 2021
A087988
Palindromic numbers whose squares and cubes are equally palindromic.
Original entry on oeis.org
0, 1, 2, 11, 101, 111, 1001, 10001, 10101, 11011, 100001, 101101, 110011, 1000001, 1001001, 1100011, 10000001, 10011001, 10100101, 11000011, 100000001, 100010001, 100101001, 101000101, 110000011, 1000000001, 1000110001
Offset: 1
-
rev:=proc(a) local aa,ct: aa:=convert(a,base,10): ct:=nops(aa): add(10^(ct-j)*aa[j],j=1..ct) end: p:=proc(n) if rev(n)=n and rev(n^2)=n^2 and rev(n^3)=n^3 then n else fi end: seq(p(n),n=0..12*10^5); # Emeric Deutsch, May 01 2005
-
ispal(n) = my(d = digits(n)); Vecrev(d) == d;
isok(n) = ispal(n) && ispal(n^2) && ispal(n^3); \\ Michel Marcus, Oct 25 2015
Showing 1-6 of 6 results.
Comments