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 A355809 #9 Jul 19 2022 10:43:15 %S A355809 0,1,2,3,4,5,6,9,8,9,10,13,12,17,18,27,16,17,18,21,20,25,26,35,24,33, %T A355809 34,47,36,53,54,81,32,33,34,37,36,41,42,51,40,49,50,63,52,69,70,97,48, %U A355809 65,66,87,68,93,94,129,72,105,106,153,108,161,162,243,64,65 %N A355809 a(n) is the number at the apex of a triangle whose base contains the distinct powers of 2 summing to n (in ascending order), and each number in a higher row is the sum of the two numbers directly below it; a(0) = 0. %H A355809 Rémy Sigrist, <a href="/A355809/b355809.txt">Table of n, a(n) for n = 0..8192</a> %H A355809 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A355809 a(n) >= n with equality iff n = 0 or n belongs to A048645. %F A355809 a(2*n) = 2*a(n). %e A355809 For n = 27: %e A355809 - we have the following triangle: %e A355809 47 %e A355809 13 34 %e A355809 3 10 24 %e A355809 1 2 8 16 %e A355809 - so a(27) = 47. %o A355809 (PARI) a(n) = { my (b=vector(hammingweight(n))); for (k=1, #b, n-=b[k]=2^valuation(n, 2)); while (#b>1, b=vector(#b-1, k, b[k+1]+b[k])); if (#b, b[1], 0) } %Y A355809 See A355807 for similar sequences. %Y A355809 Cf. A048645, A348296. %K A355809 nonn,base %O A355809 0,3 %A A355809 _Rémy Sigrist_, Jul 18 2022