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.

A061917 Either a palindrome or becomes a palindrome if trailing 0's are omitted.

This page as a plain text file.
%I A061917 #29 Jan 18 2022 03:31:48
%S A061917 0,1,2,3,4,5,6,7,8,9,10,11,20,22,30,33,40,44,50,55,60,66,70,77,80,88,
%T A061917 90,99,100,101,110,111,121,131,141,151,161,171,181,191,200,202,212,
%U A061917 220,222,232,242,252,262,272,282,292,300,303,313,323,330,333,343,353,363,373,383,393,400,404
%N A061917 Either a palindrome or becomes a palindrome if trailing 0's are omitted.
%C A061917 Numbers that are palindromes when written with a suitable number of leading zeros. - _Jeppe Stig Nielsen_, Jan 17 2022
%H A061917 Reinhard Zumkeller, <a href="/A061917/b061917.txt">Table of n, a(n) for n = 1..10000</a>
%F A061917 A136522(A004151(a(n))) = 1. - _Reinhard Zumkeller_, Sep 25 2011
%t A061917 PaleQ[n_Integer, base_Integer] := Module[{idn, trim = n/base^IntegerExponent[n, base]}, idn = IntegerDigits[trim, base]; idn == Reverse[idn]]; Select[Range[0, 500], PaleQ[#, 10] &] (* _Lei Zhou_, Dec 13 2013 *)
%t A061917 Join[{0},Select[Range[500],PalindromeQ[FromDigits[Drop[IntegerDigits[#],-IntegerExponent[#,10]]]]&]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, May 27 2017 *)
%o A061917 (Haskell)
%o A061917 a061917 n = a061917_list !! (n-1)
%o A061917 a061917_list = filter chi [0..] where
%o A061917    chi x = zs == reverse zs where
%o A061917       zs = dropWhile (== '0') $ reverse $ show x
%o A061917 -- _Reinhard Zumkeller_, Sep 25 2011
%o A061917 (PARI) isOK(k)=k==0||fromdigits(Vecrev(digits(k)))==k/10^valuation(k,10) \\ _Jeppe Stig Nielsen_, Jan 17 2022
%o A061917 (Python)
%o A061917 def ispal(s): return s == s[::-1]
%o A061917 def ok(n): s = str(n); return ispal(s) or ispal(s.rstrip('0'))
%o A061917 print([k for k in range(405) if ok(k)]) # _Michael S. Branicky_, Jan 17 2022
%Y A061917 Cf. A002113, A057890, A057891.
%K A061917 nonn,base,easy,nice
%O A061917 1,3
%A A061917 _N. J. A. Sloane_, Jun 27 2001
%E A061917 Corrected by _Ray Chandler_, Jun 08 2009