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 #17 Jan 22 2022 09:39:19
%S 2,3,5,7,11,13,25,23,23,29,31,55,59,59,63,63,63,61,111,111,107,111,
%T 123,127,103,101,103,107,111,113,127,223,223,223,221,223,223,251,255,
%U 255,247,245,255,211,215,215,211,223,239,237,237,239,251,251,457,455
%N a(n) = n IMPL prime(n), where IMPL is the bitwise logical implication.
%H Reinhard Zumkeller, <a href="/A265885/b265885.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Implies.html">Implies</a>
%F a(n) = A265705(A000040(n),n).
%e . prime(25)=97 | 1100001
%e . 25 | 11001
%e . -------------+--------
%e . 25 IMPL 97 | 1100111 -> a(25) = 103 .
%p a:= n-> Bits[Implies](n, ithprime(n)):
%p seq(a(n), n=1..56); # _Alois P. Heinz_, Sep 24 2021
%t IMPL[n_, k_] := If[n == 0, 0, BitOr[2^Length[IntegerDigits[k, 2]]-1-n, k]];
%t a[n_] := n ~IMPL~ Prime[n];
%t Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Sep 25 2021, after _David A. Corneth_'s code in A265705 *)
%o (Haskell)
%o a265885 n = n `bimpl` a000040 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 (Julia)
%o using IntegerSequences
%o [Bits("IMP", n, p) for (n, p) in enumerate(Primes(1, 263))] |> println # _Peter Luschny_, Sep 25 2021
%o (PARI) a(n) = bitor((2<<logint(prime(n), 2))-1-n, prime(n)); \\ _Michel Marcus_, Jan 22 2022
%Y Cf. A000040, A004676, A007088, A070883 (XOR), A265705.
%K nonn
%O 1,1
%A _Reinhard Zumkeller_, Dec 17 2015