cp's OEIS Frontend

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.

A159913 a(n) = 2^(A000120(n) + 1) - 1, where A000120(n) = number of nonzero bits in n.

This page as a plain text file.
%I A159913 #38 Jun 25 2025 19:34:11
%S A159913 1,3,3,7,3,7,7,15,3,7,7,15,7,15,15,31,3,7,7,15,7,15,15,31,7,15,15,31,
%T A159913 15,31,31,63,3,7,7,15,7,15,15,31,7,15,15,31,15,31,31,63,7,15,15,31,15,
%U A159913 31,31,63,15,31,31,63,31,63,63,127,3,7,7,15,7,15,15,31,7,15,15,31,15,31,31
%N A159913 a(n) = 2^(A000120(n) + 1) - 1, where A000120(n) = number of nonzero bits in n.
%C A159913 Essentially the same sequence as A117973 and A001316. The latter entry has much more information. - _N. J. A. Sloane_, Jun 05 2009
%C A159913 First differences of A159912; every other term of A038573.
%C A159913 Equals Sierpinski's gasket, A047999; as an infinite lower triangular matrix * [1,2,2,2,...] as a vector. - _Gary W. Adamson_, Oct 16 2009
%C A159913 a(n) is also the number of cells turned ON at n-th generation in the outward corner version of the Ulam-Warburton cellular automaton of A147562, and a(n) is also the number of Y-toothpicks added at n-th generation in the outward corner version of the Y-toothpick structure of A160120. - _David Applegate_ and _Omar E. Pol_, Jan 24 2016
%H A159913 David Applegate, <a href="/A139250/a139250.anim.html">The movie version</a>
%H A159913 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 A159913 <a href="/index/Ce#cell">Index entries for sequences related to cellular automata</a>
%H A159913 <a href="/index/To#toothpick">Index entries for sequences related to toothpick sequences</a>
%F A159913 a(n) = 2^A000120(2n+1) - 1 = A038573(2n+1) = 2*A038573(n) + 1 = A159912(n+1) - A159912(n).
%F A159913 a(n) = A160019(n,n). - _Philippe Deléham_, Nov 15 2011
%F A159913 a(n) = n - Sum_{k=0..n} (-1)^binomial(n, k). - _Peter Luschny_, Jan 14 2018
%e A159913 From _Michael De Vlieger_, Jan 25 2016: (Start)
%e A159913 The number n converted to binary, "0" represented by "." for better visibility of 1's, totaling the 1's and calculating the sequence:
%e A159913 n    Binary   Total                         a(n)
%e A159913 0 -> .     ->     0, thus 2^(0+1)-1 =  2-1 =  1
%e A159913 1 -> 1     ->     1,   "  2^(1+1)-1 =  4-1 =  3
%e A159913 2 -> 1.    ->     1,   "  2^(1+1)-1 =  4-1 =  3
%e A159913 3 -> 11    ->     2,   "  2^(2+1)-1 =  8-1 =  7
%e A159913 4 -> 1..   ->     1,   "  2^(1+1)-1 =  4-1 =  3
%e A159913 5 -> 1.1   ->     2,   "  2^(2+1)-1 =  8-1 =  7
%e A159913 6 -> 11.   ->     2,   "  2^(2+1)-1 =  8-1 =  7
%e A159913 7 -> 111   ->     3,   "  2^(3+1)-1 = 16-1 = 15
%e A159913 8 -> 1...  ->     1,   "  2^(1+1)-1 =  4-1 =  3
%e A159913 9 -> 1..1  ->     2,   "  2^(2+1)-1 =  8-1 =  7
%e A159913 10-> 1.1.  ->     2,   "  2^(2+1)-1 =  8-1 =  7
%e A159913 (End)
%t A159913 Table[2^(DigitCount[n, 2][[1]] + 1) - 1, {n, 0, 78}] (* or *)
%t A159913 Table[2^(Total@ IntegerDigits[n, 2] + 1) - 1, {n, 0, 78}] (* _Michael De Vlieger_, Jan 25 2016 *)
%o A159913 (PARI) A159913(n)=2<<norml2(binary(n))-1
%o A159913 (Python)
%o A159913 def A159913(n): return (1<<n.bit_count()+1)-1 # _Chai Wah Wu_, Nov 15 2022
%Y A159913 Rows of triangle in A038573 converge to this sequence. - _N. J. A. Sloane_, Jun 05 2009
%Y A159913 Cf. A000120, A038573, A047999, A159912, A117973, A001316, A147582, A160121.
%K A159913 nonn
%O A159913 0,2
%A A159913 _M. F. Hasler_, May 03 2009