I AM HERE TO KILL

I AM HERE TO KILL
QUICK WRITE A PROGRAM THAT FINDS THE SMALLEST NUMBER WITH 2^500500 DIVISORS AND OUTPUT number%500700
START CODING MA/G/GOTS

Other urls found in this thread:

en.wikipedia.org/wiki/Euler's_totient_function
en.wikipedia.org/wiki/Divisor_function#Properties
projecteuler.net/problem=500
twitter.com/NSFWRedditImage

did japamoot kill >>>/prog/ ?

That's a big number

STABBY STABBY
START WORKING

My stabby bird is gonna fite yours
1v1 de_dust n00b

But the smallest (positive) number with X divisors is and will always be 1. This program has no meaning.

puts 1%500700

pickle pee

YOU ARE GOING TO DIE
120 IS THE SMALLEST NUMBER WITH 16 DIVISORS
1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 24, 30, 40, 60, 120

Actually, 1 is

CS MAJORS ARE KILL
1 IS DIVISOR OF ALL NUMBERS, BUT THAT DOES NOT MEANS IT HAVE INFINITE NUMBER OF DIVISORS ITSELF

1 / 1 / 1 / 1 / 1 / 1 ................. = 1

This is what happens when you're a script kiddie trying to steal OP's thread idea.

print 2 ** (2 ** 500500 - 1) % 500700

:^)

It's 1.
What you are looking for is distinct factors

It's actually 0, because he didn't say it should have only 16 divisors.

you can literally divide 1 by anything :)

>macfag
>pink
yup, checks out

>homework thread
An hero, imposter crow. :^)

i don't have a mac

GOPNIK EDUCATION
>For integers m and n, it is said that m divides n, m is a divisor of n, or n is a multiple of m, and this is written as m|n,
if there exists an integer k such that mk=n

REAL THREAD

Op always provides a reference answer himself. This guy here is an impostor.

I still haven't found a solution

I dunno man. Wolfram definition doesn't have the second constraint, but I wanted to be sure.

>if there exists an integer k such that mk=n
If only I could solve 1*k=1, then I could prove that a k exists. Damn

>I havent found a solution
>Btw, I also edited the html :*)

Good luck editing the red line from 4 chan x

go home daniel

I can't wait for Sup Forums to leave.

uh, is it print(0);?

YOU BETTER CAN INTO MATH OR I AM COMING FOR YOU

I'VE HAD ENOUGH OF YOU STUPID BIRD

print "0"

Wait a minute, bird-kun, wouldn't the smallest number be negative infinite?

POSITIVES ONLY

>Prime
>Number with 2^500500 divisors?!?!
THE MODULO IS A GIVEAWAY
YOU CAN USE MODULO 500500507 IF YOUR LANGUAGE CAN'T USE BIG NUMBERS

ruby wins suck it python fags
require 'prime'
puts Prime.take(500500).reduce(&:*).modulo(500700)

print 0

CS MAJORS ARE GOING TO GET STABBED
Sup Forums IS KILL ON THE FIRST PROBLEM THAT REQUIRES SOME MATH

So 2 hast two divisors, 1 and 2. 2^2 has 3: 1, 2 and 4. So the power of two with 500500 divisors is 2^500499. This should be the smallest, since other factors would only make it bigger.

We can also conclude that 2^19 < 500700 < 2^21. After that I'm stuck.

And yeah, the factorisation of 500700 is 2^2, 3, 5^2 and 1669

>require
topcuck

Nope, you can find the number of divisor of a number by using Euler's totient function
>en.wikipedia.org/wiki/Euler's_totient_function

cuck

Not true, I just checked the archives on all stabby bird threads, only the "nines array" one has OP posted a solution in the first post

The totient function counts the numbers coprime to n, not the ones indivisible by n. 4 and 6 are neither coprime nor divisors of each other. Nevertheless, there is a formula for the number of divisors. If you decompose n into the product of powers of primes p_i with exponents a_i, the number of divisors of n is the product of all a_i + 1.
en.wikipedia.org/wiki/Divisor_function#Properties

Then the task is to minimize 2^a_1 * 3^a_2 * ... * p_n^a_n (since the number of divisors is independent of the primes chosen, they can be chosen to be as little as possible) provided the product of all a_i + 1 is 2^500500. Since each a_i + 1 must divide 2^500500, a_i = 2^n_i - 1 where the sum of n_i is 500500.

Am i misunderstanding something?
>This should be the smallest
Same argument could be applied for searching for a number with 20 divisors.

As you have showed 2^19 fits but is in no way the smallest.
240 has 20 divisors and 240

question is taken from:
projecteuler.net/problem=500
i think i have a good way to get a solution, but i'm too lazy to write it up
he asked for the smallest number, consider why 4 has less divisors than 6

I love those threads, but i wish the bird would jsut kill me already

BIRDMIN NO

Stabby stabby

Check the post times faggot.

...

I can't do it, not even if sober. CAN'T GET THAT ENGINE TURNED OVER.

>Have had

>can't into english

A possibly easy way to do the problema would be to find if the smallest number with 2^500500 divisors is divisibile by 500700, which would mean that the output should be 0

You could also iterate between 0 and 500700 - 1, and maybe the number of full iterations from start to end and the current index could give us informations about the number of divisors... Although in the end you will still have to manage extremely big numbers...

Maybe the fact that the number of divisors is a power of two is a hint that this problem has a particular conformation in binary or another base

i don't think so, consider other ways to express big numbers, there's one that lets you easily calculate how many divisors said number has

Actually I believe the smallest number with n divisors is the smallest number with n-1 divisors multiplied by 2

Wait... no, but I'm onto something

nope

Not sure about this but 1 is the smallest number with 1 divisor, 1*2 = 2 is the smallest number with 2 divisor, 1*2*3 = 6 is the smallest number with 4, 1*2*3*4 = 24 smallest with 8, 1*2*3*4*5 = 120 is the smallest with 16 divisors...

return 1

>That's a big number
for you

Ok now I'm actually onto something:
if you multiply the first n prime numbers together you get a number that is divisible by 2^n numbers.
Why? 2^n is the cardinality of the power set of n elements, which contains all the possible combinations between the elements of the set.
In this particular case we're talking about all the possible ways to combine a set of n prime numbers by means of multiplication.
Every subset result in a different number since the prime factorization of a number is unique.
The power set has also two more members, which are the empty set, and the set itself, the former is represented by the number 1 which is the divisor of all numbers, the latter by the number itself.
Therefore the number with 2^500500 divisors is the product of the first 500500 primes.
We can agree that 1669 is between the first 500500 prime numbers, therefore the only two prime factors that our BIG number and 500700 have not in common are 2 and 5.
Now:
N / D = Q + R / D
After we remove the common factors we have
(BIG NUMBER) / (2 * 5) = Q + R / D
this look nice, 2 * 5 = 10, so the result of that division is X.Y and since Q is an integer Q.(R/D).
Therefore we only need to know what the last number of that division is! And that's where the computer becomes finally useful.
We can multiplicate the first 500500 prime numbers, except 2, 3, 5 and 1669 and simply keep the result modulo 10 after every product!
Finally you multiply whatever number you got by D = 500700 and you get the answer!

Code incoming!

This should work:
def isprime(n):
for i in range(2, int(sqrt(n)) + 1):
if n % i == 0:
return false
return true

i = 0
n = 2
p = 1
while i

This actually works:
def isprime(n):
for i in range(2, int(sqrt(n)) + 1):
if n % i == 0:
return false
return true

i = 0
n = 2
p = 1
while i

for some reason this doesn't work either

I think I don't know python so well anymore:
from math import sqrt

def isprime(x):
for d in range(2, int(sqrt(n)) + 1):
if x % d == 0:
return False
return True

i = 0
n = 2
p = 1
while i

the last line should be
print p * 50070

the while should test i < 500500

>Therefore the number with 2^500500 divisors is the product of the first 500500 primes.
it does indeed have exactly 2^500500 divisors.
but it is not the smallest number, there are a lot smaller numbers. You're on the right track though, you already solved a lot of the problem!

i think(not sure though)
that (a*b) % c = ((a % c) * b) % c

indeed, according to wikipedia:
ab mod n = [(a mod n)(b mod n)] mod n.