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-1 of 1 results.

A066122 Numbers that in base 2 need one 'Reverse and Add' step to reach a palindrome.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 18, 24, 30, 32, 34, 36, 38, 40, 42, 48, 52, 56, 62, 64, 66, 68, 70, 80, 82, 96, 100, 102, 112, 114, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 160, 162, 168, 170, 176, 178, 192, 196, 198, 200, 204, 208, 212, 224
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

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

Crossrefs

Sequences for 2..12 steps needed are: A066123, A066124, A066125, A066126, A066127, A066128, A066129, A066130, A066131, A066132, A066133.

Programs

  • ARIBAS
    : function b2revadd_steps(k,stop: integer); var c,n,m,steps,rev: integer; begin n := 0; c := 0; while c < stop do m := n; rev := b2reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := b2reverse(m); inc(steps); end; if steps = k and m = rev then write(n," "); inc(c); end; inc(n); end; end; b2revadd_steps(1,66).
    
  • PARI
    isok(n,s=1)={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
Showing 1-1 of 1 results.