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.

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

This page as a plain text file.
%I A066122 #13 Dec 05 2024 21:48:57
%S A066122 2,4,6,8,10,12,14,16,18,24,30,32,34,36,38,40,42,48,52,56,62,64,66,68,
%T A066122 70,80,82,96,100,102,112,114,126,128,130,132,134,136,138,140,142,144,
%U A066122 146,148,150,160,162,168,170,176,178,192,196,198,200,204,208,212,224
%N A066122 Numbers that in base 2 need one 'Reverse and Add' step to reach a palindrome.
%C A066122 The analog of A065206 in base 2. The number of steps starts at 0, so palindromes (cf. A006995) are excluded.
%C A066122 Numbers k such that A066057(k) = 1. - _Andrew Howroyd_, Dec 05 2024
%H A066122 Harry J. Smith, <a href="/A066122/b066122.txt">Table of n, a(n) for n=1..1000</a>
%H A066122 <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>
%o A066122 (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).
%o A066122 (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
%Y A066122 Cf. A006995, A065206, A066057.
%Y A066122 Sequences for 2..12 steps needed are: A066123, A066124, A066125, A066126, A066127, A066128, A066129, A066130, A066131, A066132, A066133.
%K A066122 base,nonn
%O A066122 1,1
%A A066122 _Klaus Brockhaus_, Dec 08 2001
%E A066122 Offset changed from 0 to 1 by _Harry J. Smith_, Feb 01 2010