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.

A342123 a(n) is the remainder when n is divided by its binary reverse.

This page as a plain text file.
%I A342123 #18 Mar 01 2021 11:53:54
%S A342123 0,0,0,0,0,0,0,0,0,0,11,0,2,0,0,0,0,0,19,0,0,9,23,0,6,4,0,0,6,0,0,0,0,
%T A342123 0,35,0,37,13,39,0,4,0,43,5,0,17,47,0,14,12,0,8,10,0,55,0,18,12,4,0,
%U A342123 14,0,0,0,0,0,67,0,69,21,71,0,0,33,75,1,77,21
%N A342123 a(n) is the remainder when n is divided by its binary reverse.
%C A342123 The binary reverse of a number is given by A030101.
%C A342123 This sequence is the analog of A071955 for the binary base.
%H A342123 Rémy Sigrist, <a href="/A342123/b342123.txt">Table of n, a(n) for n = 1..8192</a>
%H A342123 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A342123 a(n) = n mod A030101(n).
%F A342123 a(n) <= n with equality iff n belongs to A161601.
%F A342123 a(n) = 0 iff n belongs to A057890.
%e A342123 For n = 43,
%e A342123 - the binary reverse of 43 ("101011" in binary) is 53 ("110101" in binary),
%e A342123 - so a(43) = 43 mod 53 = 43.
%o A342123 (PARI) a(n, base=2) = { my (r=fromdigits(Vecrev(digits(n, base)), base)); n%r }
%o A342123 (Python)
%o A342123 def A342123(n): return n % int(bin(n)[:1:-1],2) if n > 0 else 0 # _Chai Wah Wu_, Mar 01 2021
%Y A342123 Cf. A030101, A057890, A071955, A161601, A342121, A342122.
%K A342123 nonn,base,look,easy
%O A342123 1,11
%A A342123 _Rémy Sigrist_, Feb 28 2021