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.

Showing 1-4 of 4 results.

A065206 Numbers which need one 'Reverse and Add' step to reach a palindrome.

Original entry on oeis.org

10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 38, 40, 41, 42, 43, 45, 47, 50, 51, 52, 53, 54, 56, 60, 61, 62, 63, 65, 70, 71, 72, 74, 80, 81, 83, 90, 92, 100, 102, 103, 104, 105, 106, 107, 108, 110, 112, 113, 114, 115, 116, 117
Offset: 1

Views

Author

Klaus Brockhaus, Oct 21 2001

Keywords

Comments

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

Crossrefs

Programs

  • ARIBAS
    function revadd_steps(k,stop: integer); var c,n,m,steps,rev: integer; begin n := 0; c := 0; while c < stop do m := n; rev := int_reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := int_reverse(m); inc(steps); end; if steps = k and m = rev then write(n," "); inc(c); end; inc(n); end; end; revadd_steps(1,66).
    
  • Haskell
    a065206 n = a065206_list !! (n-1)
    a065206_list = filter ((== 1) . a136522 . a056964) a029742_list
    -- Reinhard Zumkeller, Oct 14 2011
    
  • Mathematica
    Select[Range[10,120],!PalindromeQ[#]&&PalindromeQ[#+IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 14 2017 *)
  • PARI
    isok(n,s=1)={for(k=0, s, my(r=fromdigits(Vecrev(digits(n)))); if(r==n, return(k==s)); n += r); 0} \\ Andrew Howroyd, Dec 05 2024

Extensions

Offset corrected by Harry J. Smith, Oct 13 2009

A015977 Two iterations of Reverse and Add are needed to reach a palindrome.

Original entry on oeis.org

5, 6, 7, 8, 9, 19, 28, 37, 39, 46, 48, 49, 55, 57, 58, 64, 66, 67, 73, 75, 76, 82, 84, 85, 91, 93, 94, 109, 119, 129, 139, 149, 150, 151, 152, 153, 154, 159, 160, 161, 162, 163, 169, 170, 171, 172, 173, 179, 189, 208, 218, 219, 228, 229, 238, 239, 248
Offset: 0

Views

Author

Keywords

Comments

The number of iterations starts at 1, so palindromes (cf. A002113) are not excluded. The corresponding sequence excluding palindromes is A065207.

Crossrefs

Programs

  • Mathematica
    Select[Range[250],Boole[PalindromeQ/@Rest[NestList[#+IntegerReverse[#]&,#,2]]] == {0,1}&] (* Harvey P. Dale, May 11 2022 *)
  • 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):
        k2 = ra(k)
        if ispal(k2): continue
        if ispal(ra(k2)): alst.append(k)
      return alst
    print(aupto(250)) # Michael S. Branicky, May 06 2021

A066123 Numbers that in base 2 need two 'Reverse and Add' steps to reach a palindrome.

Original entry on oeis.org

11, 13, 23, 29, 39, 43, 53, 55, 57, 59, 69, 79, 81, 87, 91, 109, 117, 121, 133, 143, 151, 161, 167, 171, 173, 175, 179, 181, 183, 205, 207, 213, 215, 229, 233, 235, 237, 239, 241, 243, 245, 247, 261, 265, 277, 287, 289, 303, 311, 321, 327, 337, 343, 347, 349
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

The analog of A065207 in base 2. The number of steps starts at 0, so palindromes (cf. A006995) are excluded.
Numbers k such that A066057(k) = 2. - Andrew Howroyd, Dec 05 2024

Crossrefs

Programs

  • PARI
    isok(n,s=2)={for(k=0, s, my(r=fromdigits(Vecrev(binary(n)),2)); if(r==n, return(k==s)); n += r); 0} \\ Andrew Howroyd, Dec 05 2024

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Feb 01 2010

A236689 The sum of two neighboring digits is a palindrome; a(n) is the smallest possible nonnegative integer not occurring earlier.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 10, 7, 11, 8, 12, 9, 20, 13, 14, 15, 16, 17, 18, 30, 21, 22, 23, 24, 25, 26, 27, 29, 200, 31, 32, 33, 34, 35, 36, 38, 100, 40, 41, 42, 43, 44, 45, 47, 101, 50, 51, 52, 53, 54, 56, 102, 60, 61, 62, 63, 65, 103, 80, 70, 71, 72, 74, 104
Offset: 0

Views

Author

Eric Angelini and M. F. Hasler, Jan 29 2014

Keywords

Comments

The sum of two digits is a palindrome iff it is less than 10 or equal to 11. Therefore, numbers with substrings 19, 28, 37, 39, 46, ... (this is not A065207) can never occur, and this is not a permutation of the nonnegative integers.

Crossrefs

Cf. A228730.

Programs

  • PARI
    a=u=0;(isp(s)=s<10||s==11);for(n=1,100,print1(a",");u+=1<1,d[j-1],a%10)+d[j])&&next;k=(k\10^(#d-j)+1)*10^(#d-j)-1;next(2));a=k;break))
Showing 1-4 of 4 results.