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 A228367 #40 Jul 16 2022 01:04:36 %S A228367 2,4,2,7,2,4,2,12,2,4,2,7,2,4,2,21,2,4,2,7,2,4,2,12,2,4,2,7,2,4,2,38, %T A228367 2,4,2,7,2,4,2,12,2,4,2,7,2,4,2,21,2,4,2,7,2,4,2,12,2,4,2,7,2,4,2,71, %U A228367 2,4,2,7,2,4,2,12,2,4,2,7,2,4,2,21,2,4,2,7 %N A228367 n-th element of the ruler function plus the highest power of 2 dividing n. %C A228367 a(n) is also the length of the n-th pair of orthogonal line segments in a diagram of compositions, see example. %C A228367 a(n) is also the largest part plus the number of parts of the n-th region of the mentioned diagram (if the axes both "x" and "y" are included in the diagram). %C A228367 a(n) is also the number of toothpicks added at n-th stage to the structure of A228366. Essentially the first differences of A228366. %C A228367 The equivalent sequence for partitions is A207779. %H A228367 Antti Karttunen, <a href="/A228367/b228367.txt">Table of n, a(n) for n = 1..16383</a> %H A228367 N. J. A. Sloane, <a href="/wiki/Catalog_of_Toothpick_and_CA_Sequences_in_OEIS">Catalog of Toothpick and Cellular Automata Sequences in the OEIS</a> %H A228367 <a href="/index/To#toothpick">Index entries for sequences related to toothpick sequences</a> %F A228367 a(n) = A001511(n) + A006519(n). %e A228367 Illustration of initial terms (n = 1..16) using a diagram of compositions in which A001511(n) is the length of the horizontal line segment in row n and A006519(n) is the length of the vertical line segment ending in row n. Hence a(n) is the length of the n-th pair of orthogonal line segments. Also counting both the x-axis and the y-axis we have that A001511(n) is also the largest part of the n-th region of the diagram and A006519(n) is also the number of parts of the n-th region of the diagram, see below. %e A228367 --------------------------------------------------------- %e A228367 . Diagram of %e A228367 n A001511(n) compositions A006519(n) a(n) %e A228367 --------------------------------------------------------- %e A228367 1 1 _| | | | | 1 2 %e A228367 2 2 _ _| | | | 2 4 %e A228367 3 1 _| | | | 1 2 %e A228367 4 3 _ _ _| | | 4 7 %e A228367 5 1 _| | | | 1 2 %e A228367 6 2 _ _| | | 2 4 %e A228367 7 1 _| | | 1 2 %e A228367 8 4 _ _ _ _| | 8 12 %e A228367 9 1 _| | | | 1 2 %e A228367 10 2 _ _| | | 2 4 %e A228367 11 1 _| | | 1 2 %e A228367 12 3 _ _ _| | 4 7 %e A228367 13 1 _| | | 1 2 %e A228367 14 2 _ _| | 2 4 %e A228367 15 1 _| | 1 2 %e A228367 16 5 _ _ _ _ _| 16 21 %e A228367 ... %e A228367 If written as an irregular triangle the sequence begins: %e A228367 2; %e A228367 4; %e A228367 2, 7; %e A228367 2, 4, 2, 12; %e A228367 2, 4, 2, 7, 2, 4, 2, 21; %e A228367 2, 4, 2, 7, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 38; %e A228367 ... %e A228367 Row lengths is A011782. Right border gives A005126. %e A228367 Counting both the x-axis and the y-axis we have that A038712(n) is the area (or the number of cells) of the n-th region of the diagram. Note that adding only the x-axis to the diagram we have a tree. - _Omar E. Pol_, Nov 07 2018 %t A228367 Array[1 + # + 2^# &[IntegerExponent[#, 2]] &, 84] (* _Michael De Vlieger_, Nov 06 2018 *) %o A228367 (PARI) A228367(n) = (1 + valuation(n,2) + 2^valuation(n,2)); \\ _Antti Karttunen_, Nov 06 2018 %o A228367 (Python) %o A228367 def A228367(n): return (m:=n&-n)+m.bit_length() # _Chai Wah Wu_, Jul 14 2022 %Y A228367 Cf. A001511, A001792, A005126, A006519, A011782, A038712, A139250, A139251, A207779, A228366. %K A228367 nonn,tabf %O A228367 1,1 %A A228367 _Omar E. Pol_, Aug 22 2013