cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

N. J. A. Sloane, Apr 21 2008

Keywords

Comments

a(A002113(n)) = 1; a(A029742(n)) = 0.
a(n) = A202022(n) for n <= 100, a(101) = 1, A202022(101) = 0. - Reinhard Zumkeller, Dec 10 2011

Crossrefs

Programs

  • Haskell
    a136522 n = fromEnum $ n == a004086 n  -- Reinhard Zumkeller, Apr 08 2011
    
  • Mathematica
    fQ[n_]:=Module[{id=IntegerDigits[n]}, Boole[id==Reverse[id]]]; Array[fQ, 100] (* Vladimir Joseph Stephan Orlovsky, Dec 29 2010 *)
    Table[If[PalindromeQ[n],1,0],{n,0,120}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 23 2019 *)
  • Python
    def A136522(n): return int((s:=str(n))[:(t:=(len(s)+1)//2)]==s[:-t-1:-1]) # Chai Wah Wu, Jun 23 2022

Formula

a(n) = if A004086(n) = n then 1 else 0. - Reinhard Zumkeller, Apr 08 2011
a(n) = A000007(A064834(n)). - Reinhard Zumkeller, Sep 18 2013