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”).

A255064
Number of times an odious number is encountered when iterating from 2^(n+1)-2 to (2^n)-2 with the map x -> x - (number of runs in binary representation of x).
7
0, 1, 1, 1, 3, 4, 9, 15, 29, 45, 94, 155, 318, 548, 1088, 1976, 3812, 7115, 13617, 25733, 49247, 93739, 179691, 343816, 660735, 1270112, 2448975, 4727786, 9146539, 17717760, 34366228, 66718749, 129619199, 251958752, 489959621, 953155315, 1854898028
OFFSET
0,5
FORMULA
a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A254114(k).
a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A010060(A255066(k)).
Other identities. For all n >= 1:
a(n) = A255071(n) - A255063(n).
EXAMPLE
For n=0 we count the odious numbers (A000069) found in range A255056(0..0), and A255056(0) = 0 is not an odious number, thus a(0) = 0.
For n=1 we count the odious numbers in range A255056(1..1), and A255056(1) = 2 is an odious number, thus a(1) = 1.
For n=2 we look at the numbers in range A255056(2..3), i.e. 4 and 6 and while 4 is an odious number, 6 is not, thus a(2) = 1.
For n=5 we look at the numbers in range A255056(12..20) which are (32, 36, 42, 46, 50, 54, 58, 60, 62), or if we take them in the order the come when iterating A236840 (as in A255066(12..20): 62, 60, 58, 54, 50, 46, 42, 36, 32), that is, we start iterating with map m(n) = A236840(n) from the initial value (2^(5+1))-2 = 62. Thus we get m(62) = 60, m(60) = 58, m(58) = 54, m(54) = 50, m(50) = 46, m(46) = 42, m(42) = 36 and finally m(36) = 32 which is (2^5). Of the nine numbers encountered, only 62, 50, 42 and 32 are odious numbers, thus a(5) = 4.
PROG
(PARI) \\ Use the Pari-code given in A255063.
(Scheme, different versions)
(define (A255064 n) (if (zero? n) n (let loop ((i (- (expt 2 (+ 1 n)) 4)) (s (modulo n 2))) (cond ((pow2? (+ 2 i)) s) (else (loop (- i (A005811 i)) (+ s (A010060 i))))))))
(define (A255064 n) (add A254114 (A255062 n) (A255061 (+ 1 n))))
(define (A255064 n) (add (COMPOSE A010060 A255066) (A255062 n) (A255061 (+ 1 n))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 14 2015
STATUS
approved