The link: http://www.geeksforgeeks.org/segment-tree-set-1-sum-of-given-range/. This is the quoted text:
We start with a segment arr[0 . . . n-1]. And ever
Let the size of input array is n.
All the input array elements will be leaf nodes in segment tree so the number of leaf nodes = n
Since the Segment tree is a complete tree so the Hight of Segment Tree h = ⌈ Log2n ⌉ + 1
Maximum number of nodes in a binary tree of height ‘h’ is 2h-1
So Number of nodes in a segment tree = 2⌈ Log2n ⌉ + 1 -1
Equals to 2*2⌈ Log2n ⌉ -1