OFFSET
0,1
LINKS
EXAMPLE
5 = 101 = (1<<len( 10)) or ( 10 xor 11) or 1 = 100 | 1 | 1
7 = 111 = (1<<len( 11)) or ( 11 xor 101) or 1 = 100 | 110 | 1
11 = 1011 = (1<<len( 101)) or ( 101 xor 111) or 1 = 1000 | 10 | 1
13 = 1101 = (1<<len( 111)) or ( 111 xor 1011) or 1 = 1000 | 1100 | 1
23 = 10111 = (1<<len( 1011)) or ( 1011 xor 1101) or 1 = 10000 | 110 | 1
27 = 11011 = (1<<len( 1101)) or ( 1101 xor 10111) or 1 = 10000 | 11010 | 1
45 = 101101 = (1<<len(10111)) or (10111 xor 11011) or 1 = 100000 | 1100 | 1
MAPLE
a:= proc(n) option remember; uses Bits; `if`(n<2, n+2,
Or(1, Or(2^ilog2(2*a(n-2)), Xor(a(n-2), a(n-1)))))
end:
seq(a(n), n=0..50); # Alois P. Heinz, Apr 13 2020
PROG
(Ruby) v=[2, 3]; 100.times{a=v[-2]; b=v[-1]; v<<((1<<a.bit_length)|(a^b)|1)}; p v
(PARI) f(x, y)=bitor(1<<(exponent(x)+1)+1, bitxor(x, y))
first(n)=if(n<1, return([2])); my(v=vector(n+1)); v[1]=2; v[2]=3; for(i=3, n+1, v[i]=f(v[i-2], v[i-1])); v \\ Charles R Greathouse IV, Apr 19 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Simon Strandgaard, Apr 13 2020
STATUS
approved