@lucifier :
Please tell how you reduce SuperSum ( k, n) into
SuperSum(k,n) = SuperSum (k-1, n) * (n+k) / (k+1)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
@Lucifier : your reduced form is not generating right output...
remove modulo and calculate for SuperSum(2,3)
On Tue, Jan 10, 2012 at 6:12 PM, priyanka priyankajag...@gmail.com wrote:
@lucifier :
Please tell how you reduce SuperSum ( k, n) into
SuperSum(k,n) = SuperSum (k-1, n) * (n+k) /
@atul
First of all, i must say you are really good at catching my editing
mistakes :)..
Correction:
superSum = ( superSum * ( ( n + i )%17 ) ) / (i+1);
On Jan 10, 8:29 pm, atul anand atul.87fri...@gmail.com wrote:
@Lucifier : your reduced form is not generating right output...
remove
@Lucifier : hehehe...i dont accept solution blindly..may be dats why :D :D
yeah got your editing mistake after i posted it bcoz you where not using i
in the loop so same calculation were goin on.
On Tue, Jan 10, 2012 at 9:05 PM, Lucifer sourabhd2...@gmail.com wrote:
@atul
First of all, i
@priyanka..
SuperSum(k, n) :
For any given base X representation there will be X digits..
Now say, the digits are named as A(i) ... such that,
A1 A2 A3 A(X)...
[ all digits being significant ]
Then SuperSum basically says that what are the no. of (k+1) sized
integers that can formed
@priyanka..
If you are looking for some problem where the same concept has been
applied, then go thru the following link...
http://groups.google.com/group/algogeeks/browse_thread/thread/0751e67f32266e53#
and look for the explanation and code that has been posted for the
following problem:
@Anurag...
'SuperSum' can be reduced to the following form..
SuperSum ( k, n) = SuperSum (k-1, n) * (n+k) / (k+1) ..
Time Complexity : O(K) , Space Complexity : O(1)
Code:
int getSuperSum(int k, int n)
{
int superSum = n; // SuperSum(0, n)
int i = 0;
while( ++i = k)
{