nassss

Untitled

Jan 8th, 2020
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace SequenceInMatrix
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. BigInteger N = BigInteger.Parse(Console.ReadLine());
  11. BigInteger sum = 0;
  12.  
  13. for (int row = 0; row < N; row++)
  14. {
  15. for (int col = row; col< N; col++)
  16. {
  17. if (col >= row)
  18. {
  19. sum += BigInteger.Pow(2, row + col);
  20. }
  21. }
  22. }
  23. Console.WriteLine(sum);
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment