A358919 a(0) = 0, and for any n >= 0, a(n+1) is the sum of the lengths of the runs of consecutive terms a(i), ..., a(j) with 0 <= i <= j <= n such that a(i) XOR ... XOR a(j) = a(n) (where XOR denotes the bitwise XOR operator).
0, 1, 3, 1, 4, 1, 5, 5, 10, 4, 12, 18, 1, 13, 8, 22, 44, 7, 52, 1, 19, 35, 10, 43, 53, 7, 68, 1, 31, 24, 56, 73, 8, 126, 105, 35, 71, 36, 71, 60, 70, 1, 124, 180, 10, 172, 41, 182, 40, 288, 1, 232, 15, 201, 4, 271, 6, 213, 1, 233, 14, 230, 25, 216, 9, 157, 115
Offset: 0
Examples
The first terms, alongside the corresponding pairs (i,j), are: n a(n) (i,j)'s -- ---- --------------------------------- 0 0 N/A 1 1 (0,0) 2 3 (0,1), (1,1) 3 1 (2,2) 4 4 (0,1), (1,1), (3,3) 5 1 (4,4) 6 5 (0,1), (1,1), (3,3), (5,5) 7 5 (3,4), (4,5), (6,6) 8 10 (3,4), (4,5), (4,7), (6,6), (7,7) 9 4 (6,8), (8,8) 10 12 (3,5), (3,7), (4,4), (5,6), (9,9) 11 18 (0,8), (1,8), (10,10) 12 1 (11,11)
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..15722
- Rémy Sigrist, C program
- Rémy Sigrist, Scatterplot of the first 350000 terms
Programs
-
C
See Links section.
Comments