A061562 Old, obsolete version of A003075.
0, 1, 3, 5, 9, 12, 16, 19, 25, 29, 35, 39, 46, 51, 56, 60
Offset: 1
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.
a(2)=6 from the antichains {}, {{}}, {{1}}, {{2}}, {{1,2}}, {{1},{2}}. From _Gus Wiseman_, Feb 20 2019: (Start) The a(0) = 2 through a(3) = 20 antichains: {} {} {} {} {{}} {{}} {{}} {{}} {{1}} {{1}} {{1}} {{2}} {{2}} {{12}} {{3}} {{1}{2}} {{12}} {{13}} {{23}} {{123}} {{1}{2}} {{1}{3}} {{2}{3}} {{1}{23}} {{2}{13}} {{3}{12}} {{12}{13}} {{12}{23}} {{13}{23}} {{1}{2}{3}} {{12}{13}{23}} (End)
nn=5; stableSets[u_,Q_]:=If[Length[u]===0,{{}},With[{w=First[u]},Join[stableSets[DeleteCases[u,w],Q],Prepend[#,w]&/@stableSets[DeleteCases[u,r_/;r===w||Q[r,w]||Q[w,r]],Q]]]]; Table[Length[stableSets[Subsets[Range[n]],SubsetQ]],{n,0,nn}] (* Gus Wiseman, Feb 20 2019 *) Table[Total[Boole[Table[UnateQ[BooleanFunction[k, n]], {k, 0, 2^(2^n) - 1}]]], {n, 0, 4}] (* Eric W. Weisstein, Jun 27 2023 *)
a000788_list = scanl1 (+) A000120_list -- Walt Rorie-Baety, Jun 30 2012
{a000788 0 = 0; a00788 n = a000788 n2 + a000788 (n-n2-1) + (n-n2) where n2 = n `div` 2} -- Walt Rorie-Baety, Jul 15 2012
a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+add(i, i=Bits[Split](n))) end: seq(a(n), n=0..62); # Alois P. Heinz, Nov 11 2024
a[n_] := Count[ Table[ IntegerDigits[k, 2], {k, 0, n}], 1, 2]; Table[a[n], {n, 0, 62}] (* Jean-François Alcover, Dec 16 2011 *) Table[Plus@@Flatten[IntegerDigits[Range[n], 2]], {n, 0, 62}] (* Alonso del Arte, Dec 16 2011 *) Accumulate[DigitCount[Range[0,70],2,1]] (* Harvey P. Dale, Jun 08 2013 *)
A000788(n)={ n<3 && return(n); if( bittest(n,0) \\ , n+1 == 1<A000788(n>>1)*2+n>>1+1 \\ , n == 1< A000788(n>>=1)+A000788(n-1)+n )} \\ M. F. Hasler, Nov 22 2009
a(n)=sum(k=1,n,hammingweight(k)) \\ Charles R Greathouse IV, Oct 04 2013
a(n) = if (n==0, 0, m = logint(n, 2); r = n % 2^m; m*2^(m-1) + r + 1 + a(r)); \\ Michel Marcus, Mar 27 2018
a(n)={n++; my(t, i, s); c=n; while(c!=0, i++; c\=2); for(j=1, i, d=(n\2^(i-j))%2; t+=(2^(i-j)*(s*d+d*(i-j)/2)); s+=d); t} \\ David A. Corneth, Nov 26 2024 (C++) /* See David W. Wilson link. */
def A000788(n): return sum(i.bit_count() for i in range(1,n+1)) # Chai Wah Wu, Mar 01 2023
def A000788(n): return (n+1)*n.bit_count()+(sum((m:=1<>j)-(r if n<<1>=m*(r:=k<<1|1) else 0)) for j in range(1,n.bit_length()+1))>>1) # Chai Wah Wu, Nov 11 2024
G.f. = x^2 + 3*x^3 + 5*x^4 + 9*x^5 + 12*x^6 + 16*x^7 + 19*x^8 + 26*x^9 + 31*x^10 + ...
c[m_, n_] /; m*n <= 1 = m*n; c[m_, n_] := c[m, n] = c[ Ceiling[m/2], Ceiling[n/2] ] + c[ Floor[m/2], Floor[n/2] ] + Floor[(m + n - 1)/2]; a[1] = 0; a[n_] := a[n] = a[ Ceiling[n/2] ] + a[ Floor[n/2] ] + c[ Ceiling[n/2], Floor[n/2] ]; Table[ a[n], {n, 1, 57}] (* Jean-François Alcover, Jan 19 2012, from formula *)
(c(m, n) = local(i, j); i=ceil(m/2); j=ceil(n/2); if( m*n<2, m*n, c(i, j) + c(m\2, n\2) + (m+n-1)\2)); {a(n) = local(i, j); i=ceil(n/2); j=floor(n/2); if( n<2, 0, a(i) + a(j) + c(i, j))}; /* Michael Somos, Feb 07 2004 */
Comments