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