login
a(1) = 1, a(2) = 2 and for n > 2, a(n) is the smallest number not of the form OR(a(i),a(j)) for 1 <= i < j < n.
1

%I #18 Dec 21 2020 23:04:15

%S 1,2,4,7,8,11,13,14,16,19,21,22,25,26,28,32,35,37,38,41,42,44,49,50,

%T 52,56,64,67,69,70,73,74,76,81,82,84,88,97,98,100

%N a(1) = 1, a(2) = 2 and for n > 2, a(n) is the smallest number not of the form OR(a(i),a(j)) for 1 <= i < j < n.

%H Chai Wah Wu, <a href="/A333975/b333975.txt">Table of n, a(n) for n = 1..10000</a>

%t a[1] = 1; a[2] = 2;

%t a[n_] := a[n] =

%t For[k = a[n - 1] + 1, True, k++,

%t If[FreeQ[

%t Table[BitOr[a[i], a[j]], {i, 1, n - 2}, {j, i + 1, n - 1}], k],

%t Return[k]]];

%o (Python)

%o A333975_list, aset, m = [1,2], set(), 2

%o for i in range(3,10001):

%o for j in range(i-2):

%o aset.add(m|A333975_list[j])

%o m += 1

%o while m in aset:

%o m += 1

%o A333975_list.append(m) # _Chai Wah Wu_, Dec 21 2020

%K nonn

%O 1,2

%A _Michal D. Kuczynski_, Sep 03 2020