daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Feb 8th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def tss(n):
  2.     """Calculating Triangular Super Sums"""
  3.     if n == 1:
  4.         return 1
  5.     else:
  6.         numbers = []
  7.         for x in range(1, n+1):
  8.             numbers.append(x)
  9.         for x in range(n-1, 0, -1):
  10.             numbers.append(x)
  11.         while len(numbers) > 1:
  12.             nextnumbers = []
  13.             for x in range(0, len(numbers)-1):
  14.                 nextnumbers.append(numbers[x]+numbers[x+1])
  15.             numbers = nextnumbers
  16.     return numbers[0]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top