The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A182539 a(n) = a(n-1) + (a(n-2) AND n). 0
0, 1, 1, 2, 2, 2, 4, 6, 6, 6, 8, 10, 18, 26, 28, 38, 54, 54, 72, 90, 90, 106, 124, 126, 150, 174, 192, 202, 202, 210, 220, 238, 238, 270, 304, 306, 338, 370, 372, 406, 438, 438, 472, 506, 514, 554, 556, 598, 630, 646, 696, 698, 746, 794, 828, 846, 902, 910, 912, 922, 938, 962, 1004, 1006, 1070 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(0)=0, a(1)=1, a(n) = a(n-1) + (a(n-2) AND n), where AND is the bitwise AND operator.
MATHEMATICA
RecurrenceTable[{a[0]==0, a[1]==1, a[n]==a[n-1]+BitAnd[a[n-2], n]}, a, {n, 70}] (* Harvey P. Dale, Jan 23 2013 *)
PROG
(Python)
prpr, prev = 0, 1
for n in range(2, 99):
. current = prev + (prpr & n)
. print prpr,
. prpr, prev = prev, current
CROSSREFS
Cf. A182537.
Sequence in context: A361404 A248781 A236840 * A170887 A103265 A341695
KEYWORD
nonn,base,easy
AUTHOR
Alex Ratushnyak, May 04 2012
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 28 22:13 EDT 2024. Contains 372921 sequences. (Running on oeis4.)