Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Square-Triangle Numbers
""" This program finds numbers that are both square and triangular. A square number can be written in the form n*n. A triangular number can be written in the form a(a+1)/2. With some manipulation of the two equations, you can generate the formua that is used. """ from math import sqrt a:int = 0 while True: a = a+1 b = 8 * a * a + 1 c = sqrt(b) if c % 1 == 0: print(a*a)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Metric failed
Ozan Taşdemir 9/B 499
check this converting week number (int) into week day name (string) [solved]
0403_diamond
count(even/odd)fromlist.py
factorial.py
Game4
Komalsri123
shiva
HW L3
Please log in to post a comment.