Skip to main content

Questions tagged [factors]

For code working with the factors (divisors) of a number

6 votes
3 answers
925 views

Problem (Rephrased from here): The radical of \$n\$, \$rad(n)\$, is the product of distinct prime factors of \$n\$. For example, \$504 = 2^3 × 3^2 × 7\$, so \$rad(504) = 2 × 3 × 7 = 42\$. We shall ...
Nadav Nevo's user avatar
6 votes
0 answers
125 views

I'm trying to reproduce a paper on Prime Factorization. This paper converts the problem into a QUBO form, which then we can map it to an Ising Minimizer. I've basically done everything and I've ...
Amirhossein Rezaei's user avatar
3 votes
1 answer
120 views

I've been playing with perfect, amicable and social numbers lately, and created a class for investigating these. At present, it has functions to return the perfect and amicable numbers in a specified ...
Toby Speight's user avatar
  • 88.5k
2 votes
2 answers
181 views

I want to factor random values of n that range from uint.MinValue to uint.MaxValue as ...
Kittoes0124's user avatar
  • 1,960
3 votes
1 answer
251 views

I'm trying to efficiently generate all pairs of factors of a number n. For example, when n=27, the factor pairs are (1, 27), (3, 9), (9, 3), (27, 1) The order in which the pairs are found is not ...
Bram's user avatar
  • 93
4 votes
2 answers
214 views

I have implementted a simple JavaScript function to find the list of abundant numbers and print them on the screen. an abundant number is a number for which the sum of its proper divisors is greater ...
Napoleon Bonaparte's user avatar
8 votes
3 answers
2k views

I have written a simple CLI app that finds factors in 3 different forms. I would like the code to be reviewed. Here's the code: ...
SHUBHAM KULKARNI's user avatar
5 votes
1 answer
128 views

While working on Project Euler, I have come across a few questions involving usage of the little omega function, big omega function, and Möbius function. My prior code wrote factors into an array and ...
Ethan Slota's user avatar
1 vote
3 answers
282 views

I need help optimizing my Python code for CodeWars Integers: Recreation One Kata. We are given a range of numbers and we have to return the number and the sum of the divisors squared that is a square ...
melike's user avatar
  • 57
4 votes
1 answer
139 views

This code finds highly composite numbers (numbers with more factors than any smaller number) in Swift. I'm not too familiar with Swift, I did this in python but it was too slow so I decided to try it....
Octobass's user avatar
0 votes
1 answer
226 views

On RosettaCode I found this C++ version of modPow (compute 2ᵖ mod n) to find the factors of a Mersenne number. ...
user140242's user avatar
2 votes
1 answer
4k views

Problem description: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of ...
Amir Motefaker's user avatar
5 votes
2 answers
1k views

ٍProblem description: The prime factors of 13195 are 5, 7, 13 and 29. Largest prime factor 13195 is 29. What is the largest prime factor of the number 600851475143 ? Prime Factor: any of the prime ...
Amir Motefaker's user avatar
3 votes
1 answer
292 views

Highly divisible triangular number, my solution My solution of challenge from Project Euler takes too much time to execute. Although on lower numbers it works fine. Anyone could look up to my code and ...
Hubert's user avatar
  • 31
3 votes
2 answers
177 views

My code finds the prime factorization of numbers, ordering the prime numbers from least to greatest. It prints a list of 999999 prime factorizations (which can be changed if you edit the function call ...
Some Guy's user avatar
  • 131

15 30 50 per page
1
2 3 4 5
9