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.

A065207 Numbers which need two 'Reverse and Add' steps to reach a palindrome.

Original entry on oeis.org

19, 28, 37, 39, 46, 48, 49, 57, 58, 64, 67, 73, 75, 76, 82, 84, 85, 91, 93, 94, 109, 119, 129, 139, 149, 150, 152, 153, 154, 159, 160, 162, 163, 169, 170, 172, 173, 179, 189, 208, 218, 219, 228, 229, 238, 239, 248, 250, 251, 253, 258, 259, 260, 261, 268, 269
Offset: 1

Views

Author

Klaus Brockhaus, Oct 21 2001

Keywords

Comments

The number of steps starts at 0, so palindromes (cf. A002113) are excluded.
Numbers k such that A033665(k) = 2. - Andrew Howroyd, Dec 06 2024

Crossrefs

Programs

  • ARIBAS
    revadd_steps(2,58); (* For the definition of function revadd_steps see A065206. *)
    
  • Mathematica
    trasQ[n_]:=Length[NestWhileList[IntegerReverse[#]+#&,n,!PalindromeQ[ #]&,1,5]] ==3; Select[Range[300],trasQ] (* Harvey P. Dale, Apr 13 2022 *)
  • PARI
    isok(n,s=2)={for(k=0, s, my(r=fromdigits(Vecrev(digits(n)))); if(r==n, return(k==s)); n += r); 0} \\ Andrew Howroyd, Dec 06 2024
  • Python
    def ra(n): s = str(n); return int(s) + int(s[::-1])
    def ispal(n): s = str(n); return s == s[::-1]
    def aupto(limit):
      alst = []
      for k in range(limit+1):
        if ispal(k): continue
        k2 = ra(k)
        if ispal(k2): continue
        if ispal(ra(k2)): alst.append(k)
      return alst
    print(aupto(269)) # Michael S. Branicky, May 06 2021
    

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Oct 14 2009