All Questions
6
questions
0
votes
3
answers
85
views
Print greatest factor if it is same for both numbers
Take input n1 and n2 and check if they have the same greatest factor. If they do, print that factor. If they don't, print "No".
example:
input:
6
9
output:
3
input:
15
27
output:
No
...
1
vote
1
answer
99
views
Solving roots of negative numbers
As part of an assignment for college summer classes, I was tasked with writing a program that solves roots of negative numbers. I've ran it through the test cases I was provided and it computes ...
4
votes
2
answers
289
views
Factoring and solving a quadratic polynomial
So i code stuff for my fx-cg50 calculator's micropython as I'm an a level student and a python beginner, and i need help pointing out the bugs and some programming tips to further improve my code, and ...
5
votes
2
answers
3k
views
Project Euler Problem 21 in Python: Summing amicable numbers
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b ...
0
votes
1
answer
164
views
Project Euler problem 12 Python
I'm new to python and programming in general and I found Project Euler problems a good way to practice python. But my code is pretty slow. It seems to work, didn't wait long enough for the code to ...
3
votes
1
answer
109
views
Counting Divisors of a number with restrictions on the divisors
Given a fraction p/q, I want to count the number of unit fraction solutions
$$\frac{p}{q} = \frac{1}{u} + \frac{1}{v}$$
with some contraints
$$lower \le u \le upper$$
By manipulating the first ...