login
A265716
a(n) = n IMPL (2*n), where IMPL is the bitwise logical implication.
3
0, 2, 5, 6, 11, 10, 13, 14, 23, 22, 21, 22, 27, 26, 29, 30, 47, 46, 45, 46, 43, 42, 45, 46, 55, 54, 53, 54, 59, 58, 61, 62, 95, 94, 93, 94, 91, 90, 93, 94, 87, 86, 85, 86, 91, 90, 93, 94, 111, 110, 109, 110, 107, 106, 109, 110, 119, 118, 117, 118, 123, 122
OFFSET
0,2
COMMENTS
The scatterplot exhibits fractal qualities. - Bill McEachen, Dec 27 2022
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..8191 <= 2^13-1
Eric Weisstein's World of Mathematics, Implies
FORMULA
a(n) = A265705(2*n,n): central terms of triangle A265705;
a(A247648(n)) = 2*A247648(n).
a(n)= bitor(A003817(n)-n, 2*n) (conjectured). - Bill McEachen, Dec 13 2021
2n <= a(n) <= 3n. - Charles R Greathouse IV, Jan 20 2023
EXAMPLE
. 2*21=42 | 101010 2*6=12 | 1100
. 21 | 10101 6 | 110
. -----------+------- ----------+-----
. 21 IMPL 42 | 101010 -> a(21) = 42 6 IMPL 12 | 1101 -> a(6) = 13 .
MAPLE
A265716 := n -> Bits:-Implies(n, 2*n):
seq(A265716(n), n=0..61); # Peter Luschny, Sep 23 2019
MATHEMATICA
IMPL[n_, k_] := If[n == 0, 0, BitOr[2^Length[IntegerDigits[k, 2]]-1-n, k]];
a[n_] := n ~IMPL~ (2n);
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 16 2021 *)
PROG
(Haskell)
a265716 n = n `bimpl` (2 * n) where
bimpl 0 0 = 0
bimpl p q = 2 * bimpl p' q' + if u <= v then 1 else 0
where (p', u) = divMod p 2; (q', v) = divMod q 2
(PARI) a(n)=bitor(bitneg(n, exponent(n)+1), 2*n) \\ Charles R Greathouse IV, Jan 20 2023
CROSSREFS
KEYWORD
nonn,look,easy
AUTHOR
Reinhard Zumkeller, Dec 15 2015
STATUS
approved