Thoughts?

Thoughts?

Good for people interested in CS but thats it really

Good for people interested in CS but thats it really

Good for people interested in CS but that's pretty much it.

Good for people interested in CS but there's not much else to it.

Good for people interested in CS but you're a brainlet if you are.

Good for people interested in CS but ehh... I've seen better.

Good for people interested in CS but it's overrated

Crashing this combo... With no survivors.

Interesting, so the psychology research that proved that at least 1 in 8 people are faggots is right.

Wew, who knew. Turns out psychology IS a science after all this time. And we thought they were just making up numbers and p hacking.

>good for people interested in CS
CS babies just brute force everything and waste thousands of computations because they couldn't do the math

granted, a basic knowledge of programming is required for most of it, but the real meat of the problems is in the math

...

What's wrong wit that. Do you know a better way to find prime factors smart guy?

And also, does this even work? Isn't that number too large for an int?

Well after 2 you only have to test every odd number, that cuts the workload in half.

It's not hilariously retarded like most of those images there's just a bunch of inefficiencies all over it
like checking primality before checking if it even divides the big number, checking all the numbers when only up to n/2 can possibly work, starting from 0 when you're looking for the biggest one (start from n/2 and go down instead), checking if every single even number divides rather than just 2, etc.

>What's wrong wit that. Do you know a better way to find prime factors smart guy?

Confirmed for being a CS major.

Really though how come int can climb to NUMBER when 600,000,000,000 is larger than 2^31?

...

It can't. You have to use a long long.

Some challenges are good CS intro. Then it gets into palindromic number bullshit. Numerology rather than mathematics, which I find frustrating.

And only up to the square root of n.

Wait what, if I want to find all primes between 1 and 100, then I stop at 10?

Then it's not mathematical but string and bit manipulation, both valuable tools.

no, what they meant that if you want to find the prime factorization of 100 you only need to check numbers between 1 and it's square root wich is 10

well actually you only need to test numbers in the form 6n+1 and 6n-1 because these are the only forms primes can take

>Writing code this wrong
Confirmed math major

kek

You also only need the isprime function to test divisibility by other primes.

This was literally one of the first examples we looked at in algorithms.

>CS
>literally a subfield of math
>they couldn't do the math
wew lad

How do you test divisbility by primes if primes are the thing you are trying to find, maybe storing previous values and use them later?

>store them
Yeah, iterate through a linked list or something. It might get unweildly with a huge number but it would run faster since you arent redundantly checking every single integer.

he's not wrong you know, all primes > 3 take that form.