login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A174091 OR(n, 2). 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

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

LINKS

Table of n, a(n) for n=0..66.

Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).

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

EXAMPLE

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.

MAPLE

with(Bits): seq(Or(n, 2), n=0..60)

MATHEMATICA

Table[BitOr[n, 2], {n, 0, 100}] (* Alonso del Arte, Feb 06 2013 *)

LinearRecurrence[{2, -2, 2, -1}, {2, 3, 2, 3}, 80] (* Harvey P. Dale, Oct 25 2016 *)

PROG

(PARI) a(n)=bitor(n, 2) \\ Charles R Greathouse IV, Feb 27 2013

CROSSREFS

Cf. similar sequences listed in A244587.

Sequence in context: A165930 A064895 A120877 * A276008 A193917 A089135

Adjacent sequences:  A174088 A174089 A174090 * A174092 A174093 A174094

KEYWORD

nonn,easy

AUTHOR

Gary Detlefs, Feb 06 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified December 7 19:05 EST 2016. Contains 278895 sequences.