The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A342123 a(n) is the remainder when n is divided by its binary reverse. 3
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, 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, 14, 0, 0, 0, 0, 0, 67, 0, 69, 21, 71, 0, 0, 33, 75, 1, 77, 21 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,11
COMMENTS
The binary reverse of a number is given by A030101.
This sequence is the analog of A071955 for the binary base.
LINKS
FORMULA
a(n) = n mod A030101(n).
a(n) <= n with equality iff n belongs to A161601.
a(n) = 0 iff n belongs to A057890.
EXAMPLE
For n = 43,
- the binary reverse of 43 ("101011" in binary) is 53 ("110101" in binary),
- so a(43) = 43 mod 53 = 43.
PROG
(PARI) a(n, base=2) = { my (r=fromdigits(Vecrev(digits(n, base)), base)); n%r }
(Python)
def A342123(n): return n % int(bin(n)[:1:-1], 2) if n > 0 else 0 # Chai Wah Wu, Mar 01 2021
CROSSREFS
Sequence in context: A138066 A173189 A115595 * A187553 A003621 A348006
KEYWORD
nonn,base,look,easy
AUTHOR
Rémy Sigrist, Feb 28 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 02:58 EDT 2024. Contains 372536 sequences. (Running on oeis4.)