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 A065413 #20 May 11 2016 16:23:31 %S A065413 1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,3,1,0,0,2,1,1,1,1,1,1,1, %T A065413 0,1,2,0,1,1,2,1,1,1,1,3,0,1,0,0,1,0,2,2,0,1,2,1,1,1,1,1,1,1,1,1,0,1, %U A065413 2,0,2,1,1,2,1,0,2,1,2,1,2,2,2,1,2,1,1,1,2,1,2,3,1,0,0,1,0,0,1,0,2,1,0,0,2 %N A065413 Number of positive solutions to "numbers that are n times their number of binary 1's". %C A065413 Equivalently, this is the number of ways to write n as an arithmetic mean of distinct powers of 2. [_Brian Kell_, Mar 01 2009] %H A065413 Peter Kagey, <a href="/A065413/b065413.txt">Table of n, a(n) for n = 1..10000</a> %e A065413 a(23)=3 since 69, 92 and 115 are written in binary as 1000101, 1011100 and 1110011 and 69=23*3, 92=23*4 and 115=23*5. %p A065413 N:= 1000: # to get a(1) to a(N) %p A065413 A:= Vector(N): %p A065413 for x from 1 while x/(1+ilog2(x)) <= N do %p A065413 v:= x/convert(convert(x,base,2),`+`); %p A065413 if v::integer and v <= N then %p A065413 A[v]:= A[v]+1 %p A065413 fi %p A065413 od: %p A065413 seq(A[i],i=1..N); # _Robert Israel_, May 06 2016 %p A065413 # alternative program %p A065413 read("transforms") : %p A065413 A065413 := proc(n) %p A065413 local bdgs,a,x; %p A065413 a := 0 ; %p A065413 for bdgs from 1 do %p A065413 x := n*bdgs ; %p A065413 # x must have bdgs bits set, so x =bdgs*n >= 2^bdgs-1. %p A065413 if n < (2^bdgs-1)/x then %p A065413 break; %p A065413 elif wt(x) = bdgs then %p A065413 a := a+1 ; %p A065413 end if; %p A065413 end do: %p A065413 a ; %p A065413 end proc: # _R. J. Mathar_, May 11 2016 %Y A065413 Cf. A000120, A037478, A058898, A272797 (greedy inverse). %K A065413 base,nonn %O A065413 1,23 %A A065413 _Henry Bottomley_, Nov 23 2001