login
Integers from 0 to A037834(n) followed by integers from 0 to A037834(n+1) and so on.
8

%I #12 May 12 2017 15:15:28

%S 0,0,1,0,0,1,0,1,2,0,1,0,0,1,0,1,2,0,1,2,3,0,1,2,0,1,0,1,2,0,1,0,0,1,

%T 0,1,2,0,1,2,3,0,1,2,0,1,2,3,0,1,2,3,4,0,1,2,3,0,1,2,0,1,0,1,2,0,1,2,

%U 3,0,1,2,0,1,0,1,2,0,1,0,0,1,0,1,2,0,1,2,3

%N Integers from 0 to A037834(n) followed by integers from 0 to A037834(n+1) and so on.

%C Equivalently, integers from 0 to A005811(n)-1 followed by integers from 0 to A005811(n+1)-1 and so on.

%H Vincenzo Librandi, <a href="/A227740/b227740.txt">Table of n, a(n) for n = 1..2272</a>

%F a(n) = n - (1 + A173318(A227737(n)-1)).

%t Table[Range[0, #] &@ Total@ Flatten@ Map[Abs@ Differences@ # &,

%t Partition[IntegerDigits[n, 2], 2, 1]], {n, 34}] // Flatten (* _Michael De Vlieger_, May 09 2017 *)

%o (Scheme) (define (A227740 n) (- n (+ 1 (A173318 (- (A227737 n) 1)))))

%Y Cf. A227737, A227741, A005811, A037834, A173318.

%Y Cf. also A227736, A227738, A227739.

%K nonn

%O 1,9

%A _Antti Karttunen_, Jul 25 2013