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.

A029742 Nonpalindromic numbers.

Original entry on oeis.org

10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 102, 103, 104, 105, 106, 107
Offset: 1

Views

Author

Keywords

Comments

Complement of A002113; A136522(a(n)) = 0.
A064834(a(n)) > 0. - Reinhard Zumkeller, Sep 18 2013

Crossrefs

Cf. A002113. Different from A031955.

Programs

  • Haskell
    a029742 n = a029742_list !! (n-1)
    a029742_list = filter ((== 0) . a136522) [1..]
    -- Reinhard Zumkeller, Oct 09 2011
    
  • Magma
    [n: n in [0..150] | Intseq(n) ne Reverse(Intseq(n))]; // Bruno Berselli, Apr 01 2015
    
  • Mathematica
    palQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn]]; DeleteCases[ Range[10,110],?palQ] (* _Harvey P. Dale, Jan 28 2012 *)
    Table[If[PalindromeQ[n],Nothing,n],{n,120}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 13 2019 *)
  • PARI
    is(n)=my(d=digits(n)); d!=Vecrev(d) \\ Charles R Greathouse IV, Feb 06 2017
    
  • Python
    def ok(n): s = str(n); return s != s[::-1]
    print(list(filter(ok, range(108)))) # Michael S. Branicky, Oct 12 2021
    
  • Python
    def A029742(n):
        def f(x): return n+x//10**((l:=len(s:=str(x)))-(k:=l+1>>1))-(int(s[k-1::-1])>x%10**k)+10**(k-1+(l&1^1))-1
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Jul 24 2024

Extensions

Offset corrected by Reinhard Zumkeller, Oct 09 2011