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

 

Logo

Annual Appeal: Today, Nov 11 2014, is the 4th anniversary of the launch of the new OEIS web site. 70,000 sequences have been added in these four years, all edited by volunteers. Please make a donation (tax deductible in the US) to help keep the OEIS running.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A118362 a(1)=1; for n>1, a(n) = "n AND a(n-1)" if that number is positive and not already in the sequence, otherwise a(n) = "n OR a(n-1)". 2
1, 3, 3, 7, 5, 4, 7, 15, 9, 8, 11, 15, 13, 12, 15, 31, 17, 16, 19, 23, 21, 20, 23, 31, 25, 24, 27, 31, 29, 28, 31, 63, 33, 32, 35, 39, 37, 36, 39, 47, 41, 40, 43, 47, 45, 44, 47, 63, 49, 48, 51, 55, 53, 52, 55, 63, 57, 56, 59, 63, 61, 60, 63, 127, 65, 64, 67, 71, 69, 68, 71, 79 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Here "AND" and "OR" refer to operations on the binary expansions of the argument.

LINKS

Table of n, a(n) for n=1..72.

PROG

(PARI) A118362(maxn)= { local(a, aSet, aand, newa) ; a=[1] ; for(n=2, maxn, aSet=Set(a) ; aand=bitand(a[n-1], n) ; if( aand >0 && setsearch(aSet, aand) == 0, newa=aand, newa=bitor(a[n-1], n) ; ) ; a=concat(a, newa) ; print(newa) ; ) ; return(a) ; } print(A118362(80)) ; (Mathar)

CROSSREFS

Cf. A005132.

Sequence in context: A085870 A096633 A175482 * A205680 A137695 A209085

Adjacent sequences:  A118359 A118360 A118361 * A118363 A118364 A118365

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane, May 17 2006

EXTENSIONS

More terms from R. J. Mathar and Joshua Zucker, May 18 2006

STATUS

approved

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

Content is available under The OEIS End-User License Agreement .

Last modified December 20 04:40 EST 2014. Contains 252241 sequences.