OFFSET
1,4
LINKS
Rémy Sigrist, C program for A338824
FORMULA
a(2*n) = 2*n-2 for any n > 0.
a(4*n+1) = 0 for any n >= 0.
a(4*n+3) = 1 for any n >= 0.
a(n) OR a(n+1) = A116966(n-2) for any n > 1.
EXAMPLE
The first terms, alongside a(n) OR a(n+1), are:
n a(n) a(n) OR a(n+1)
-- ---- --------------
1 0 0
2 0 1
3 1 3
4 2 2
5 0 4
6 4 5
7 1 7
8 6 6
9 0 8
10 8 9
11 1 11
12 10 10
MATHEMATICA
Block[{a = {0, 0}, b = {0}}, Do[Block[{k = 0, m}, While[! FreeQ[b, Set[m, BitOr @@ {a[[-1]], k}]], k++]; AppendTo[a, k]; AppendTo[b, m]], {i, 3, 76}]; a] (* Michael De Vlieger, Nov 12 2020 *)
PROG
(C) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 11 2020
STATUS
approved