Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

PalindromeQ

PalindromeQ[list]
returns True if the given list is identical to Reverse[list], and False otherwise.

PalindromeQ[n]
returns True if the integer n is identical to IntegerReverse[n], and False otherwise.

PalindromeQ[string]
returns True if the given string is identical to StringReverse[string], and False otherwise.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

A palindromic string:

In[1]:=
Click for copyable input
Out[1]=

Check the palindromic property with its list of characters:

In[2]:=
Click for copyable input
Out[2]=

A palindromic integer:

In[1]:=
Click for copyable input
Out[1]=

This is not palindromic:

In[2]:=
Click for copyable input
Out[2]=

Search for palindromic primes:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2015
(10.3)
| Updated in 2016
(10.4)