All Questions
20
questions
6
votes
4
answers
2k
views
Find all ways to express each of a list of even numbers as the sum of 2 positive, even numbers
This code was a challenge from a friend. Essentially she wanted a way to
"Divide an even number into 2 even numbers."
So I made this quick and dirty Python program to find the solutions up ...
3
votes
1
answer
424
views
Find perfect squares within a given range
I managed to make this work without breaking the program if you enter some weird numbers in the range. The thing is I know this could have been done simpler and smarter. I can't really see how right ...
1
vote
2
answers
67
views
Ask 2 terms from user and add them
I'm making a program that can add 2 terms that the user types.
I think I've got identifying or evaluating the terms down. I used classes because I just recently learned it and I also heard it was good ...
0
votes
1
answer
428
views
Finding Mersenne primes
An attempt to find Mersenne primes using the Lucas-Lehmer primality test:
...
2
votes
1
answer
48
views
A prime number checker (Multi numbers).py
so obviously this SIMPLE code checks if the number is prime or not. I need to make it more advanced, easier to use, fewer lines or any improvement.
...
2
votes
1
answer
484
views
Graphing various mathematical functions in Python
1) This code's task is to create graphs of various algebraic, logarithmic and trigonometric functions and relations using Python's matplotlib.plyplot module. ...
1
vote
2
answers
410
views
Monte-Carlo method to check triangle inequality
This is code for finding if inequality \$abc > 2(\text{area of triangle})\$
where \$a\$, \$b\$ and \$c\$ are the sides of any triangle.
The below, and repl, code work as intended. However they ...
1
vote
1
answer
2k
views
Linear Equation in Two Variables Solver using Python
I made this simple program that can solve every set of linear equations in two variables.
You just need to enter two linear equations of the form ax+by=c (without any unnecessary spaces) where 'a' is ...
5
votes
2
answers
1k
views
Magic Square with Five Methods (Python)
Problem
Write a program to return a boolean if an input grid is magic square.
A magic square of order \$N\$ is an arrangement of \$N^2\$ distinct integers in a square such that the \$N\$ numbers in ...
7
votes
2
answers
3k
views
Magic Square (Python)
Problem
Write a method to return a boolean if an input grid is magic square.
A magic square is a \$NxN\$ square grid (where N is the number of cells on each side) filled with distinct positive ...
8
votes
1
answer
330
views
Find "prime polynomials" for a user's given prime, bounds, and degree
Very amateur programmer and first-time poster here.
The program I wrote asks the user for a prime number, a lower and upper bound, and a degree (all of these are integers). I want to generate a list ...
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 ...
5
votes
2
answers
510
views
Find numbers that are palindromic in consecutive number bases
I want to generate numbers which are palindromic in three or more
consecutive number bases in the most optimal, fastest way (up to some
range). I do not count trivial one digit palindromes.
(...
10
votes
2
answers
1k
views
Find highly composite number using Python 3
A highly composite number (HCN) is a positive integer with more divisors than any smaller positive integer ha according to Wikipedia. Here is a YouTube video about it.
...