phanindhar1

without delegate

Nov 25th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.31 KB | None | 0 0
  1. private static long Ylee(long N)
  2.         {
  3.             long count = 0; // verifiy valid (n,k) as sigma(n+k) - sigma(n) = sigma(k) + n*k
  4.  
  5.             for (Int64 i = Convert.ToInt64(Math.Sqrt(2 * N)); i > 1; i--)
  6.  
  7.                 if ((N - ((i * (i + 1)) / 2)) % i == 0) count++;
  8.  
  9.             return count;
  10.         }
Add Comment
Please, Sign In to add comment