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.

Previous Showing 11-13 of 13 results.

A102037 Triangle of BitAnd(BitNot(n), k).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 2, 2, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 2, 2, 4, 4, 6, 6, 0, 0, 0, 1, 0, 1, 4, 5, 4, 5, 0, 1, 0, 0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0
Offset: 0

Views

Author

Eric W. Weisstein, Dec 25 2004

Keywords

Comments

As a logical operation on two variables this is also called the 'converse nonimplication'. - Peter Luschny, Sep 25 2021

Examples

			Table starts:
[0] 0;
[1] 0, 0;
[2] 0, 1, 0;
[3] 0, 0, 0, 0;
[4] 0, 1, 2, 3, 0;
[5] 0, 0, 2, 2, 0, 0;
[6] 0, 1, 0, 1, 0, 1, 0;
[7] 0, 0, 0, 0, 0, 0, 0, 0;
[8] 0, 1, 2, 3, 4, 5, 6, 7, 0;
[9] 0, 0, 2, 2, 4, 4, 6, 6, 0, 0.
		

Crossrefs

Cf. A350094 (row sums), A268040 (array).
Other triangles: A080099 (AND), A080098 (OR), A051933 (XOR), A265705 (IMPL).

Programs

  • Julia
    using IntegerSequences
    A102037Row(n) = [Bits("CNIMP", n, k) for k in 0:n]
    for n in 0:20 println(A102037Row(n)) end  # Peter Luschny, Sep 25 2021
  • Maple
    with(Bits): cnimp := (n, k) -> And(Not(n), k):
    seq(print(seq(cnimp(n,k), k=0..n)), n = 0..12); # Peter Luschny, Sep 25 2021

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

A265885 a(n) = n IMPL prime(n), where IMPL is the bitwise logical implication.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 25, 23, 23, 29, 31, 55, 59, 59, 63, 63, 63, 61, 111, 111, 107, 111, 123, 127, 103, 101, 103, 107, 111, 113, 127, 223, 223, 223, 221, 223, 223, 251, 255, 255, 247, 245, 255, 211, 215, 215, 211, 223, 239, 237, 237, 239, 251, 251, 457, 455
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 17 2015

Keywords

Examples

			.   prime(25)=97 | 1100001
.             25 |   11001
.   -------------+--------
.     25 IMPL 97 | 1100111 -> a(25) = 103 .
		

Crossrefs

Programs

  • Haskell
    a265885 n = n `bimpl` a000040 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
    
  • Julia
    using IntegerSequences
    [Bits("IMP", n, p) for (n, p) in enumerate(Primes(1, 263))] |> println  # Peter Luschny, Sep 25 2021
    
  • Maple
    a:= n-> Bits[Implies](n, ithprime(n)):
    seq(a(n), n=1..56);  # Alois P. Heinz, Sep 24 2021
  • Mathematica
    IMPL[n_, k_] := If[n == 0, 0, BitOr[2^Length[IntegerDigits[k, 2]]-1-n, k]];
    a[n_] := n ~IMPL~ Prime[n];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Sep 25 2021, after David A. Corneth's code in A265705 *)
  • PARI
    a(n) = bitor((2<Michel Marcus, Jan 22 2022

Formula

a(n) = A265705(A000040(n),n).
Previous Showing 11-13 of 13 results.