OFFSET
1,3
COMMENTS
There is no Table 3 in reference (?).
Equation (28) from the Sloping Binary Numbers arXiv paper:
f(1) = 1, and for i >= 0, 1 <= j <= 2^i,
f(2^i + j) =
1) f(j) + 1, if 1 <= j <= i
2) f(j) , if i+1 <= j <= 2^i
Table 3, from the arXiv paper: f(n), ie A103318, the number of 1 <= k <= n such that k == n mod 2^k . The central columns show how f(n) is built up recursively using (28).
LINKS
David Cleaver, Table of n, a(n) for n = 1..10000
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers, J. Integer Seq. 8 (2005), no. 3, Article 05.3.6, 15 pp.
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping Binary Numbers: A New Sequence Related to the Binary Numbers, arXiv:math/0505295 [math.NT], 2005.
EXAMPLE
n | Reverse(a(n)) | f(n)
-------------------------
8 | 100000 | 1
9 | 100100 | 2
10 | 100100 | 2
11 | 110100 | 3
12 | 100000 | 1
13 | 101000 | 2
14 | 101000 | 2
15 | 110000 | 2
16 | 100000 | 1
PROG
(PARI) f(n)={my(i, j); if(n<2, return(1)); i=floor(log(n-1)/log(2)); j=n-2^i; if(j<=i, return(f(j)+2^i), return(f(j)))};
a(n) = fromdigits(digits(f(n), 2), 10) \\ David Cleaver, Jun 09 2026
CROSSREFS
KEYWORD
nonn,base,changed
AUTHOR
Philippe Deléham, Apr 20 2005
EXTENSIONS
More terms from David Cleaver, Jun 09 2026
STATUS
approved
