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.
%I A227183 #52 Dec 01 2021 03:52:52 %S A227183 0,1,2,2,4,3,3,3,6,5,4,6,5,4,4,4,8,7,6,8,8,5,7,9,7,6,5,7,6,5,5,5,10,9, %T A227183 8,10,10,7,9,11,12,9,6,10,11,8,10,12,9,8,7,9,9,6,8,10,8,7,6,8,7,6,6,6, %U A227183 12,11,10,12,12,9,11,13,14,11,8,12,13,10,12,14 %N A227183 a(n) is the sum of parts of the unique unordered partition encoded in the run lengths of the binary expansion of n; row sums of A227739 for n >= 1. %C A227183 Like A129594 this sequence utilizes the fact that compositions (i.e., ordered partitions) can be bijectively mapped to (unordered) partitions by taking the partial sums of the list of composants after one has been subtracted from each except the first one. Compositions in turn are mapped to nonnegative integers via the runlength encoding, where the lengths of maximum runs of 0's or 1's in binary representation of n give the composants. See the OEIS Wiki page and the example below. %C A227183 Each n occurs A000041(n) times in total and occurs for the first time at A227368(n) and for the last time at position A000225(n). See further comments and conjectures at A227368 and A227370. %H A227183 Antti Karttunen, <a href="/A227183/b227183.txt">Table of n, a(n) for n = 0..8192</a> %H A227183 A. Karttunen et al., <a href="http://oeis.org/wiki/Runlength_encoding">Run-length encoding</a>, OEIS Wiki. %H A227183 <a href="/index/Par#part">Index entries for sequences related to partitions</a> %F A227183 a(n) = Sum_{i=0..A005811(n)-1} A227189(n,i). [The defining formula] %F A227183 Equivalently, for n>=1, a(n) = Sum_{i=(A173318(n-1)+1)..A173318(n)} A227739(i). %F A227183 a(n) = A227192(n) - A000217(A005811(n)-1). %F A227183 Other identities: %F A227183 a(A129594(n)) = a(n). [This follows from the fact that conjugating a partition doesn't change its total sum] %F A227183 a(A226062(n)) = a(n). [Which is also true for the "Bulgarian operation"] %F A227183 From _Antti Karttunen_, Mar 08 2015: (Start) %F A227183 Can be also obtained by mapping with an appropriate permutation from the sequences giving sizes of each partition (i.e., sum of their parts) computed for other enumerations similar to A227739: %F A227183 a(n) = A036042(A229119(n)). %F A227183 a(n) = A161511(A003188(n)). %F A227183 a(n) = A056239(A243353(n)). %F A227183 a(n) = A243503(1+A075157(n)). %F A227183 (End) %e A227183 19 has binary expansion "10011", thus the maximal runs of identical bits (scanned from right to left) are [2,2,1]. We subtract one from each after the first one, to get [2,1,0] and then form their partial sums as [2,2+1,2+1+0], which thus maps to unordered partition {2+3+3} which adds to 8. Thus a(19)=8. %t A227183 Table[Function[b, Total@ Accumulate@ Prepend[If[Length@ b > 1, Rest[b] - 1, {}], First@ b] - Boole[n == 0]]@ Map[Length, Split@ Reverse@ IntegerDigits[n, 2]], {n, 0, 79}] // Flatten (* _Michael De Vlieger_, May 09 2017 *) %o A227183 (Scheme, with _Antti Karttunen_'s IntSeq-library): %o A227183 (definec (A227183 n) (let loop ((n n) (i (A005811 n)) (d 0) (s 0)) (cond ((zero? n) s) (else (loop (A163575 n) (- i 1) (expt 1 d) (+ s (* i (- (A136480 n) d)))))))) %o A227183 (define (A227183v2 n) (if (zero? n) n (apply + (binexp_to_ascpart n)))) ;; Alternative definition, using the same auxiliary functions as A227184, which are given there. %o A227183 (define (A227183v3 n) (let loop ((i (- (A005811 n) 1)) (s 0)) (cond ((< i 0) s) (else (loop (- i 1) (+ s (A227189bi n i))))))) ;; Another variant which sums the nonzero terms of the row n of array A227189. %o A227183 (define (A227183v4 n) (- (A227192 n) (A000217 (- (A005811 n) 1)))) ;; Yet another variant. %o A227183 ;; As well: %o A227183 (define (A227183v5 n) (add A227739 (+ 1 (A173318 (- n 1))) (A173318 n))) %o A227183 ;; This implements Sum_{i=lowlim..uplim} intfun(i) %o A227183 (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i))))))) %o A227183 (Python) %o A227183 def A227183(n): %o A227183 '''Sum of parts of the unique unordered partition encoded in the run lengths of the binary expansion of n.''' %o A227183 s = 0 %o A227183 b = n%2 %o A227183 i = 1 %o A227183 while (n != 0): %o A227183 n >>= 1 %o A227183 if ((n%2) == b): # Staying in the same run of bits? %o A227183 i += 1 %o A227183 else: # The run changes. %o A227183 b = n%2 %o A227183 s += i %o A227183 return(s) %Y A227183 Row sums of A227189 and A227739. Cf. A227184 (corresponding products), A227185, A227189, A227192, A129594, A226062, A227368. %Y A227183 Analogous sum sequences computed for other encoding schemes of unordered partitions: A036042, A056239, A161511, A243503. Cf. also A229119, A003188, A075157, A243353 (associated permutations mapping between these schemes). %K A227183 nonn,base,look %O A227183 0,3 %A A227183 _Antti Karttunen_, Jul 05 2013