17 lines
350 B
Python
17 lines
350 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
def nth_con(x):
|
||
|
# 212 114 116 118
|
||
|
if not x % 3:
|
||
|
n = 1
|
||
|
d = 0
|
||
|
else:
|
||
|
n = x % 3
|
||
|
d = 1
|
||
|
for m in range(2 * (x // 3), 2, -2):
|
||
|
n, d = 2*m*n + 2*d + n, m*n + n + d
|
||
|
return 8*n + 3*d, 2*n + d + n
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
print(sum(map(int, list(str(nth_con(100)[0])))))
|