Created
February 10, 2021 20:46
-
-
Save mtovmassian/eae3f5eeb0da56644ed995f15cb818cc to your computer and use it in GitHub Desktop.
Demlo palindromic triangle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc_base_one_repunits(n): | |
# https://en.wikipedia.org/wiki/Repunit | |
return sum( | |
map(lambda x: pow(10, x), range(0, n)) | |
) | |
for i in range(1, int(input("Triangle size: "))+1): | |
print(pow(calc_base_one_repunits(i), 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment