Smallest triangular number larger than p | PHP code to find the bucket to choose for picking flowers out of it ; Driver code
< ? php function findBucketNo ( $ p ) { return ceil ( ( sqrt ( 8 * $ p + 1 ) - 1 ) / 2 ) ; } $ p = 10 ; echo ( findBucketNo ( $ p ) ) ; ? >