Run Code
|
API
|
Code Wall
|
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
CICLO WHILE PYTHON 3
alternative dict.get (faster)
"Hello,world!"
abracadabra
problem
Game3
Decimal, Octal, Hexadecimal and Binary Format
PySuper
linked_lists_2
Atur cara mengira luas permukaan dan isipadu sebuah trapezium