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 A255066 #20 Apr 01 2017 20:47:27 %S A255066 0,2,6,4,14,12,10,30,28,26,22,18,62,60,58,54,50,46,42,36,32,126,124, %T A255066 122,118,114,110,106,100,96,94,90,84,78,74,68,64,254,252,250,246,242, %U A255066 238,234,228,224,222,218,212,206,202,196,192,190,186,180,174,168,162,156,152,148,142,138,132,128,510 %N A255066 The trunk of number-of-runs beanstalk (A255056) with reversed subsections. %C A255066 This can be viewed as an irregular table: after the initial zero on row 0, start each row n with term x = (2^(n+1))-2 and subtract repeatedly the number of runs in binary representation of x to get successive x's, until the number that has already been listed (which is always (2^n)-2) is encountered, which is not listed second time, but instead, the current row is finished [and thus containing only terms of equal binary length, A000523(n) on row n]. The next row then starts with (2^(n+2))-2, with the same process repeated. %H A255066 Antti Karttunen, <a href="/A255066/b255066.txt">Table of n, a(n) for n = 0..16142; Rows 0..16, flattened</a> %F A255066 a(0) = 0, a(1) = 2, a(2) = 6; and for n > 2, a(n) = A004755(A004755(A236840(a(n-1)))) if A236840(a(n-1))+2 is power of 2, otherwise just A236840(a(n-1)) [where A004755(x) adds one 1-bit to the left of the most significant bit of x]. %F A255066 In other words, for n > 2, let k = A236840(a(n-1)). Then, if k+2 is not a power of 2, a(n) = k, otherwise a(n) = k + (6 * (2^A000523(k))). %F A255066 Other identities. For all n >= 0: %F A255066 a(n) = A255056(A255122(n)). %e A255066 Rows 0 - 5 of the array: %e A255066 0; %e A255066 2; %e A255066 6, 4; %e A255066 14, 12, 10; %e A255066 30, 28, 26, 22, 18; %e A255066 62, 60, 58, 54, 50, 46, 42, 36, 32; %e A255066 After row 0, the length of row n is given by A255071(n). %o A255066 (Scheme, with memoization-macro definec) %o A255066 (definec (A255066 n) (cond ((< n 2) (+ n n)) ((= n 2) 6) ((A236840 (A255066 (- n 1))) => (lambda (next) (if (pow2? (+ 2 next)) (A004755 (A004755 next)) next))))) %o A255066 (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1))))) ;; A004198bi implements bitwise and. See A004198, A209229. %Y A255066 Cf. A255067 (same seq, terms divided by 2). %Y A255066 Cf. A255071 (gives row lengths). %Y A255066 Cf. A000523, A004755, A005811, A236840, A255056, A255122. %Y A255066 Analogous sequences: A218616, A230416. %K A255066 nonn,base,tabf %O A255066 0,2 %A A255066 _Antti Karttunen_, Feb 14 2015