login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A050072
a(n) = |a(n-1) - a(m)| for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = a(3) = 1.
0
1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0
OFFSET
1,1
MAPLE
a := proc(n) option remember; `if`(n < 4, 1,
abs(a(n - 1) - a(Bits:-Iff(n - 2$2) + 3 - n)))
end:
seq(a(n), n = 1..90); # Petros Hadjicostas, Nov 08 2019
CROSSREFS
Sequence in context: A275737 A080909 A087755 * A267576 A156707 A131309
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 08 2019
STATUS
approved