Luigi
is there a way to make a counter that takes numbers invidually?
Luigi
i mean
Luigi
without using cout, because i need to put in output the biggest number of a group of numbers, that i have to put in a counter
Luigi
yeah sure, wait a moment
Luigi
i have to find prime factors of a number (600851475143). And i have to output only the biggest prime factor
Luigi
I think i should put in a counter all the prime factors, so then i can output only the biggest one
Anonymous
and try to find a mathematical solution
Anonymous
then implement it
Luigi
i have the mathematical solution
Luigi
i just don't have the programming solution ahah
Anonymous
use arrays
Luigi
mh
Luigi
i think i got it
Anonymous
i just don't have the programming solution ahah
I think you should start taking two numbers, and check their divisibility
Luigi
well, that's the exercise ahah
Ariana
at that point you will have to implement primality test
Anonymous
N = (a + b)(a - b) = a(pw2) - b(pw2) this is how I do via math
Anonymous
eh
Luigi
wait, let me send you my code
Anonymous
Checkout: Fermat's factorization method
Luigi
int f,p,pmax; pmax=0; while (f<=600851475143) { if (f%600851475143==0) f=p; if (p>pmax) p=pmax; f++; } cout<<"Il fattore primo piu' grande e' "<<p; (it's wrote in italian ahah)
Luigi
but it doesn't work, that's is my idea btw
Luigi
what do you mean with fermat?
Anonymous
Is there way to use system function and use %d in it
Ariana
wut
Anonymous
what do you mean with fermat?
Google "Fermat factorization method wikipedia"
Ariana
Wayyyy too slow
Anonymous
Ariana
Fermat factorization sucks unless the number is known to be easily factored under fermat factorization
Anonymous
There is better solution, but I am not familar to
Ariana
Just dont use fermat
Ariana
Its worse than trial divisopn
Anonymous
did i do it?
There looks like a bit logical error
Luigi
like where?
Ariana
Pollard's rho algorithm is rather easy to do
Luigi
that looks hard tho
Anonymous
like where?
You start with "If a(^p) is divided by p, then the remainder obtained is the same when a is divided by p." I don't know better than this algo
Ariana
factorization is hard
Ariana
Thats why no one writes their own code for it mdr
Anonymous
that looks hard tho
Factorization is hard, but there is better way to solve this
Luigi
and what does (^p) mean?
Anonymous
and what does (^p) mean?
a to the power p, a is lesser than p
Anonymous
Hi all!
klimi
Hi
MᏫᎻᎯᎷᎷᎬᎠ
Hi
Anonymous
Is there way to use system function and use %d in it
No one know how to put value of %d in system function input
Anonymous
Ask an intelligent question.
Anonymous
Google it
in vain 😭😭😭😭😭
Pete
If I have a game in c++ and I need to modify it in c, do I have to go through the whole thing and convert it to c first?
Pete
yes
Okay. Because you can’t program physical features of a pi3 in c++?
Pete
Like button, lights , motors
Nehemiah Aklil
Try falcon c++
i love tht thing
Anonymous
I thought about that, but since he said he's a beginner I pickup falcon
Anonymous
(I'm a beginner as well)
Nehemiah Aklil
I thought about that, but since he said he's a beginner I pickup falcon
I like the code outline thing for complicated programs with many fuction plus its light weight
Nehemiah Aklil
Luigi
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ?
Luigi
Any tip to give me?
Luigi
That's how i actually did it, but it's not working.
Luigi
while (f<=600851475143) { if (f%600851475143==0) f=p; if (p>pmax) p=pmax; f++; }
Luigi
( this is only the loop )
Luigi
Could someone explain me Pollard's rho algorithm?
Luigi
6857
I didn't need that answer ahah, i needing a tip on how could i make it
Luigi
I don't know how to do pollard's algorithm, it's impossibile ahah