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.

Showing 1-2 of 2 results.

A160020 Row sums of triangle in A160019 .

Original entry on oeis.org

1, 4, 4, 16, 10, 18, 22, 64, 46, 46, 58, 76, 88, 94, 106, 256, 214, 198, 226, 196, 288, 246, 274, 312, 436, 370, 406, 388, 484, 438, 466, 1024, 934, 886, 946, 820, 1072, 934, 994, 808, 1348, 1186, 1254, 1012, 1396, 1126, 1186, 1264, 1996, 1786, 1870, 1516, 2044
Offset: 0

Views

Author

Philippe Deléham, Apr 29 2009

Keywords

Examples

			Triangle A160019 begins : 1 ; 1,3 ; 1,0,3 ; 1,3,5,7 ; 1,0,2,4,3 ; 1,3,0,2,5,7 ; ...
		

Crossrefs

Programs

  • PARI
    \\ here S(n,k) is A047999.S(n,k)={bitand(n-k, k)==0}a(n)={my(b=0); sum(k=0, n, if(S(n,k), b++; 2*b-1, 2*(k-b)))} \\ Andrew Howroyd, Feb 02 2020
    
  • PARI
    a(n)={my(b=2^hammingweight(n)); b^2 + (n+1-b)*(n-b)} \\ Andrew Howroyd, Feb 02 2020

Formula

a(n) = b^2 + (n+1-b)*(n-b), where b = 2^A000120(n). - Andrew Howroyd, Feb 02 2020

Extensions

Terms a(11) and beyond from Andrew Howroyd, Feb 02 2020

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

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

M. F. Hasler, May 03 2009

Keywords

Comments

Essentially the same sequence as A117973 and A001316. The latter entry has much more information. - N. J. A. Sloane, Jun 05 2009
First differences of A159912; every other term of A038573.
Equals Sierpinski's gasket, A047999; as an infinite lower triangular matrix * [1,2,2,2,...] as a vector. - Gary W. Adamson, Oct 16 2009
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

Examples

			From _Michael De Vlieger_, Jan 25 2016: (Start)
The number n converted to binary, "0" represented by "." for better visibility of 1's, totaling the 1's and calculating the sequence:
n    Binary   Total                         a(n)
0 -> .     ->     0, thus 2^(0+1)-1 =  2-1 =  1
1 -> 1     ->     1,   "  2^(1+1)-1 =  4-1 =  3
2 -> 1.    ->     1,   "  2^(1+1)-1 =  4-1 =  3
3 -> 11    ->     2,   "  2^(2+1)-1 =  8-1 =  7
4 -> 1..   ->     1,   "  2^(1+1)-1 =  4-1 =  3
5 -> 1.1   ->     2,   "  2^(2+1)-1 =  8-1 =  7
6 -> 11.   ->     2,   "  2^(2+1)-1 =  8-1 =  7
7 -> 111   ->     3,   "  2^(3+1)-1 = 16-1 = 15
8 -> 1...  ->     1,   "  2^(1+1)-1 =  4-1 =  3
9 -> 1..1  ->     2,   "  2^(2+1)-1 =  8-1 =  7
10-> 1.1.  ->     2,   "  2^(2+1)-1 =  8-1 =  7
(End)
		

Crossrefs

Rows of triangle in A038573 converge to this sequence. - N. J. A. Sloane, Jun 05 2009

Programs

  • Mathematica
    Table[2^(DigitCount[n, 2][[1]] + 1) - 1, {n, 0, 78}] (* or *)
    Table[2^(Total@ IntegerDigits[n, 2] + 1) - 1, {n, 0, 78}] (* Michael De Vlieger, Jan 25 2016 *)
  • PARI
    A159913(n)=2<
    				
  • Python
    def A159913(n): return (1<Chai Wah Wu, Nov 15 2022

Formula

a(n) = 2^A000120(2n+1) - 1 = A038573(2n+1) = 2*A038573(n) + 1 = A159912(n+1) - A159912(n).
a(n) = A160019(n,n). - Philippe Deléham, Nov 15 2011
a(n) = n - Sum_{k=0..n} (-1)^binomial(n, k). - Peter Luschny, Jan 14 2018
Showing 1-2 of 2 results.