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.

A255063 Number of times an evil 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 A255063 #24 Dec 20 2024 16:12:42
%S A255063 1,0,1,2,2,5,7,14,24,52,84,173,290,586,1038,2025,3740,7177,13498,
%T A255063 25832,49027,93918,179291,344128,660058,1270590,2447944,4728357,
%U A255063 9145214,17718039,34365068,66717630,129619518,251953756,489964171,953141850,1854911347
%N A255063 Number of times an evil 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 A255063 a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A254113(k).
%F A255063 a(n) = Sum_{k = A255062(n) .. A255061(n+1)} A010059(A255066(k)).
%F A255063 Other identities. For all n >= 1:
%F A255063 a(n) = A255071(n) - A255064(n).
%e A255063 For n=0 we count the evil numbers (A001969) found in range A255056(0..0), and A255056(0) = 0 is an evil number, thus a(0) = 1.
%e A255063 For n=1 we count the evil numbers in range A255056(1..1), and A255056(1) = 2 is not an evil number, thus a(1) = 0.
%e A255063 For n=2 we look at the numbers in range A255056(2..3), i.e. 4 and 6 and while 4 is not an evil number, 6 is, thus a(2) = 1.
%e A255063 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 we take them in the order they 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 60, 58, 54, 46 and 36 are evil numbers, thus a(5) = 5.
%o A255063 (PARI)
%o A255063 \\ Compute sequences A255063, A255064 and A255071 at the same time, starting from n=1:
%o A255063 A005811(n) = hammingweight(bitxor(n, n\2));
%o A255063 write_A255063_and_A255064_and_A255071(n) = { my(k, i, s63, s64); k = (2^(n+1))-2; i = 1; s63 = 0; s64 = 0; while(1, if((hammingweight(k)%2),s64++,s63++); k = k - A005811(k); if(!bitand(k+1, k+2), break, i++)); write("b255063.txt", n, " ", s63); write("b255064.txt", n, " ", s64); write("b255071.txt", n, " ", i); };
%o A255063 for(n=1,36,write_A255063_and_A255064_and_A255071(n));
%o A255063 (Scheme)
%o A255063 (define (A255063 n) (if (zero? n) 1 (let loop ((i (- (expt 2 (+ 1 n)) 4)) (s (modulo (+ 1 n) 2))) (cond ((pow2? (+ 2 i)) s) (else (loop (- i (A005811 i)) (+ s (A010059 i))))))))
%o A255063 (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))
%o A255063 (Scheme)
%o A255063 (define (A255063 n) (add A254113 (A255062 n) (A255061 (+ 1 n))))
%o A255063 (Scheme)
%o A255063 (define (A255063 n) (add (COMPOSE A010059 A255066) (A255062 n) (A255061 (+ 1 n))))
%Y A255063 Cf. A001969, A005811, A010059, A236840, A254113, A255056, A255064, A255066, A255071.
%Y A255063 Similar sequences: A255125, A218542.
%K A255063 nonn
%O A255063 0,4
%A A255063 _Antti Karttunen_, Feb 14 2015