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.

Showing 1-4 of 4 results.

A174091 a(n) = n OR 2.

Original entry on oeis.org

2, 3, 2, 3, 6, 7, 6, 7, 10, 11, 10, 11, 14, 15, 14, 15, 18, 19, 18, 19, 22, 23, 22, 23, 26, 27, 26, 27, 30, 31, 30, 31, 34, 35, 34, 35, 38, 39, 38, 39, 42, 43, 42, 43, 46, 47, 46, 47, 50, 51, 50, 51, 54, 55, 54, 55, 58, 59, 58, 59, 62, 63, 62, 63, 66, 67, 66
Offset: 0

Views

Author

Gary Detlefs, Feb 06 2013

Keywords

Comments

OR(n, 2) + AND(n, 2) = n + 2.
OR(n, 2) - AND(n, 2) = n + 2*(-1)^floor(n/2), A004443.
a(n) = n when n = 2 or 3 mod 4 (n is in A042964). - Alonso del Arte, Feb 07 2013

Examples

			a(3) = 3 because OR(0011, 0010) = 0011 = 3.
a(4) = 6 because OR(0100, 0010) = 0110 = 6.
a(5) = 7 because OR(0101, 0010) = 0111 = 7.
		

Crossrefs

Cf. similar sequences listed in A244587.

Programs

Formula

a(n) = n + 1 + (-1)^floor(n/2).
G.f.: ( 2-x+x^3 ) / ( (1+x^2)*(x-1)^2 ). - R. J. Mathar, Feb 27 2013
Sum_{n>=0} (-1)^n/a(n) = Pi/4 - log(2)/2 = A196521. - Peter McNair, Aug 05 2023

A244584 a(n) = n OR 3.

Original entry on oeis.org

3, 3, 3, 3, 7, 7, 7, 7, 11, 11, 11, 11, 15, 15, 15, 15, 19, 19, 19, 19, 23, 23, 23, 23, 27, 27, 27, 27, 31, 31, 31, 31, 35, 35, 35, 35, 39, 39, 39, 39, 43, 43, 43, 43, 47, 47, 47, 47, 51, 51, 51, 51, 55, 55, 55, 55, 59, 59, 59, 59, 63, 63, 63, 63, 67, 67, 67
Offset: 0

Views

Author

Gary Detlefs, Jun 30 2014

Keywords

Comments

Terms of A004767 repeated four times. [Bruno Berselli, Jul 01 2014]

Crossrefs

Cf. A004767.
Cf. similar sequences listed in A244587.

Programs

  • Magma
    [BitwiseOr(n, 3): n in [0..70]]; // Bruno Berselli, Jul 01 2014
    
  • Maple
    with(Bits): seq(Or(n,3),n = 1..60);
  • Python
    def A244584(n): return n|3 # Chai Wah Wu, Jan 18 2023

Formula

a(n) = (n+3)- (n AND 3).
a(n) = (n XOR 3) + (n AND 3).
a(n) = n + ((3*n+3) mod 4).
a(n) = 4*floor((n+4)/4)-1.
G.f.: (3 + x^4)/(1 - x - x^4 + x^5). [Bruno Berselli, Jul 01 2014]

A244586 a(n) = n OR 4.

Original entry on oeis.org

4, 5, 6, 7, 4, 5, 6, 7, 12, 13, 14, 15, 12, 13, 14, 15, 20, 21, 22, 23, 20, 21, 22, 23, 28, 29, 30, 31, 28, 29, 30, 31, 36, 37, 38, 39, 36, 37, 38, 39, 44, 45, 46, 47, 44, 45, 46, 47, 52, 53, 54, 55, 52, 53, 54, 55, 60, 61, 62, 63, 60, 61, 62, 63
Offset: 0

Views

Author

Gary Detlefs, Jun 30 2014

Keywords

Comments

a(n) = n if n is congruent to (4, 5, 6, 7) mod 8. In general, (n OR 2^k) has the closed form n + 2^k * floor( ( (n+2^k) mod 2^(k+1) )/2^k ).

Examples

			a(10) = 14 because 10 in binary is 1010 and 4 is 0100, and 1010 OR 0100 = 1110, which is 14 in decimal.
a(11) = 15 because 11 in binary is 1011 and 4 is 0100, and 1011 OR 0100 = 1111, which is 15 in decimal.
a(12) = 12 because 12 in binary is 1100 and 4 is 0100, and 1100 OR 0100 = 1100, which is 12 in decimal.
		

Crossrefs

Cf. A047566.
Cf. similar sequences listed in A244587.

Programs

  • Magma
    [BitwiseOr(n, 4): n in [0..70]]; // Bruno Berselli, Jul 01 2014
    
  • Maple
    with(Bits): seq(Or(n,4), n = 0..60);
  • Mathematica
    Table[BitOr[n, 4], {n, 0, 63}] (* Alonso del Arte, Jul 01 2014 *)
  • Python
    def A244586(n): return n|4 # Chai Wah Wu, Jan 18 2023

Formula

a(n) = (n+4) - (n AND 4).
a(n) = (n XOR 4) + (n AND 4).
a(n) = n + 4*floor(((n+4) mod 8)/4).
From Bruno Berselli, Jul 01 2014: (Start)
a(n) = 2 + n + 2*(-1)^floor(n/4).
G.f.: (4 - 3*x + x^5)/((1 - x)^2*(1 + x^4)). (End)
Sum_{n>=0} (-1)^n/a(n) = (2*sqrt(2)-1)*Pi/8 - 3*log(2)/4. - Amiram Eldar, Aug 07 2023

Extensions

Some terms corrected by Bruno Berselli, Jul 01 2014

A244588 a(n) = n OR 6.

Original entry on oeis.org

6, 7, 6, 7, 6, 7, 6, 7, 14, 15, 14, 15, 14, 15, 14, 15, 22, 23, 22, 23, 22, 23, 22, 23, 30, 31, 30, 31, 30, 31, 30, 31, 38, 39, 38, 39, 38, 39, 38, 39, 46, 47, 46, 47, 46, 47, 46, 47, 54, 55, 54, 55, 54, 55, 54, 55, 62, 63, 62, 63, 62, 63, 62, 63, 70, 71, 70, 71
Offset: 0

Views

Author

Gary Detlefs, Jun 30 2014

Keywords

Comments

a(n) = n if n is congruent to (6, 7) mod 8.

Crossrefs

Cf. similar sequences listed in A244587.

Programs

  • Magma
    [BitwiseOr(n, 6): n in [0..80]]; // Bruno Berselli, Jul 01 2014
  • Maple
    with(Bits): seq(Or(n,6), n = 0..60);
  • Mathematica
    Table[BitOr[n, 6], {n, 0, 80}] (* Bruno Berselli, Jul 01 2014 *)

Formula

a(n) = (n+6) - (n AND 6).
a(n) = (n XOR 6) + (n AND 6).
a(n) = n + ( 6*floor((n+2)/2) mod 8 ).
Sum_{n>=0} (-1)^n/a(n) = sqrt(2)*Pi/4 - sqrt(2)*log(sqrt(2)+1)/2 - log(2)/2. - Amiram Eldar, Aug 07 2023
Showing 1-4 of 4 results.