login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A136522 a(n) = 1 if n is a palindrome, otherwise 0. 55

%I #37 Jun 23 2022 15:42:56

%S 1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,

%T 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,

%U 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0

%N a(n) = 1 if n is a palindrome, otherwise 0.

%C a(A002113(n)) = 1; a(A029742(n)) = 0.

%C a(n) = A202022(n) for n <= 100, a(101) = 1, A202022(101) = 0. - _Reinhard Zumkeller_, Dec 10 2011

%H Reinhard Zumkeller, <a href="/A136522/b136522.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%H <a href="/index/Pac#palindromes">Index entries for sequences related to palindromes</a>

%F a(n) = if A004086(n) = n then 1 else 0. - _Reinhard Zumkeller_, Apr 08 2011

%F a(n) = A000007(A064834(n)). - _Reinhard Zumkeller_, Sep 18 2013

%t fQ[n_]:=Module[{id=IntegerDigits[n]}, Boole[id==Reverse[id]]]; Array[fQ, 100] (* _Vladimir Joseph Stephan Orlovsky_, Dec 29 2010 *)

%t Table[If[PalindromeQ[n],1,0],{n,0,120}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Aug 23 2019 *)

%o (Haskell)

%o a136522 n = fromEnum $ n == a004086 n -- _Reinhard Zumkeller_, Apr 08 2011

%o (Python)

%o def A136522(n): return int((s:=str(n))[:(t:=(len(s)+1)//2)]==s[:-t-1:-1]) # _Chai Wah Wu_, Jun 23 2022

%Y Cf. A002113, A136687, A137180.

%Y Cf. A178225.

%K nonn,base

%O 0,1

%A _N. J. A. Sloane_, Apr 21 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)