cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A341691 a(0) = 0, and for any n > 0, a(n) = n - a(k) where k is the greatest number < n such that n AND a(k) = a(k) (where AND denotes the bitwise AND operator).

This page as a plain text file.
%I A341691 #10 Feb 18 2021 00:18:29
%S A341691 0,1,2,1,4,1,2,5,8,1,2,9,4,9,10,5,16,1,2,17,4,17,18,5,8,17,18,9,20,9,
%T A341691 10,21,32,1,2,33,4,33,34,5,8,33,34,9,36,9,10,37,16,33,34,17,36,17,18,
%U A341691 37,40,17,18,41,20,41,42,21,64,1,2,65,4,65,66,5,8,65
%N A341691 a(0) = 0, and for any n > 0, a(n) = n - a(k) where k is the greatest number < n such that n AND a(k) = a(k) (where AND denotes the bitwise AND operator).
%C A341691 This sequence is a binary variant of A341679; here we look for a term whose binary 1's match those of n, there we look for a term that divides n.
%H A341691 Rémy Sigrist, <a href="/A341691/b341691.txt">Table of n, a(n) for n = 0..8191</a>
%H A341691 Rémy Sigrist, <a href="/A341691/a341691.txt">C program for A341691</a>
%F A341691 a(n) = n iff n = 0 or n is a power of 2.
%F A341691 a(2*n) = 2*a(n).
%F A341691 Apparently, a(n) = n - a(n - A006519(n)).
%e A341691 The first terms, alongside the corresponding value of k, are:
%e A341691   n   a(n)  k
%e A341691   --  ----  ---
%e A341691    0     0  N/A
%e A341691    1     1    0
%e A341691    2     2    0
%e A341691    3     1    2
%e A341691    4     4    0
%e A341691    5     1    4
%e A341691    6     2    4
%e A341691    7     5    6
%e A341691    8     8    0
%e A341691    9     1    8
%o A341691 (C) See Links section.
%Y A341691 Cf. A006519, A295989, A341679.
%K A341691 nonn,base
%O A341691 0,3
%A A341691 _Rémy Sigrist_, Feb 17 2021