Sum of the sequence 2 , 22 , 222 , ... ... ... | function which return the the sum of series ; Driver Code
< ? php function sumOfSeries ( $ n ) { return 0.0246 * ( pow ( 10 , $ n ) - 1 - ( 9 * $ n ) ) ; } $ n = 3 ; echo ( sumOfSeries ( $ n ) ) ; ? >