Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #22 Jan 20 2023 16:41:29
%S 0,2,5,6,11,10,13,14,23,22,21,22,27,26,29,30,47,46,45,46,43,42,45,46,
%T 55,54,53,54,59,58,61,62,95,94,93,94,91,90,93,94,87,86,85,86,91,90,93,
%U 94,111,110,109,110,107,106,109,110,119,118,117,118,123,122
%N a(n) = n IMPL (2*n), where IMPL is the bitwise logical implication.
%C The scatterplot exhibits fractal qualities. - _Bill McEachen_, Dec 27 2022
%H Reinhard Zumkeller, <a href="/A265716/b265716.txt">Table of n, a(n) for n = 0..8191</a> <= 2^13-1
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Implies.html">Implies</a>
%F a(n) = A265705(2*n,n): central terms of triangle A265705;
%F a(A247648(n)) = 2*A247648(n).
%F a(n)= bitor(A003817(n)-n, 2*n) (conjectured). - _Bill McEachen_, Dec 13 2021
%F 2n <= a(n) <= 3n. - _Charles R Greathouse IV_, Jan 20 2023
%e . 2*21=42 | 101010 2*6=12 | 1100
%e . 21 | 10101 6 | 110
%e . -----------+------- ----------+-----
%e . 21 IMPL 42 | 101010 -> a(21) = 42 6 IMPL 12 | 1101 -> a(6) = 13 .
%p A265716 := n -> Bits:-Implies(n, 2*n):
%p seq(A265716(n), n=0..61); # _Peter Luschny_, Sep 23 2019
%t IMPL[n_, k_] := If[n == 0, 0, BitOr[2^Length[IntegerDigits[k, 2]]-1-n, k]];
%t a[n_] := n ~IMPL~ (2n);
%t Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Nov 16 2021 *)
%o (Haskell)
%o a265716 n = n `bimpl` (2 * n) where
%o bimpl 0 0 = 0
%o bimpl p q = 2 * bimpl p' q' + if u <= v then 1 else 0
%o where (p', u) = divMod p 2; (q', v) = divMod q 2
%o (PARI) a(n)=bitor(bitneg(n, exponent(n)+1), 2*n) \\ _Charles R Greathouse IV_, Jan 20 2023
%Y Cf. A265705, A247648, A003817.
%K nonn,look,easy
%O 0,2
%A _Reinhard Zumkeller_, Dec 15 2015