cp's OEIS Frontend

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.

A265716 a(n) = n IMPL (2*n), where IMPL is the bitwise logical implication.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 15 2015

Keywords

Comments

The scatterplot exhibits fractal qualities. - Bill McEachen, Dec 27 2022

Examples

			.      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 .
		

Crossrefs

Programs

  • 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
    
  • 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 *)
  • PARI
    a(n)=bitor(bitneg(n, exponent(n)+1), 2*n) \\ Charles R Greathouse IV, Jan 20 2023

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