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.

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

This page as a plain text file.
%I A255064 #22 Dec 20 2024 16:13:02
%S A255064 0,1,1,1,3,4,9,15,29,45,94,155,318,548,1088,1976,3812,7115,13617,
%T A255064 25733,49247,93739,179691,343816,660735,1270112,2448975,4727786,
%U A255064 9146539,17717760,34366228,66718749,129619199,251958752,489959621,953155315,1854898028
%N 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).
%F A255064 a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A254114(k).
%F A255064 a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A010060(A255066(k)).
%F A255064 Other identities. For all n >= 1:
%F A255064 a(n) = A255071(n) - A255063(n).
%e A255064 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.
%e A255064 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.
%e A255064 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.
%e A255064 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.
%o A255064 (PARI) \\ Use the Pari-code given in A255063.
%o A255064 (Scheme)
%o A255064 (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))))))))
%o A255064 (Scheme)
%o A255064 (define (A255064 n) (add A254114 (A255062 n) (A255061 (+ 1 n))))
%o A255064 (Scheme)
%o A255064 (define (A255064 n) (add (COMPOSE A010060 A255066) (A255062 n) (A255061 (+ 1 n))))
%Y A255064 Cf. A000069, A005811, A010060, A236840, A254114, A255056, A255063, A255066, A255071.
%Y A255064 Similar sequences: A255126, A218543.
%K A255064 nonn
%O A255064 0,5
%A A255064 _Antti Karttunen_, Feb 14 2015