mersenneforum.org Need help pari gp
 Register FAQ Search Today's Posts Mark Forums Read

 2020-04-24, 19:54 #1 User133   Apr 2020 22·5 Posts Need help pari gp Hello, I really need help solving this problem in Pari / gp "Among the numbers 3 (10 ^ 8) ≤n≤4 (10 ^ 8), find the number with the largest sum of divisors. If there are several such numbers, find all"
 2020-04-24, 19:59 #2 Uncwilly 6809 > 6502     """"""""""""""""""" Aug 2003 101×103 Posts 47×233 Posts Post moved to Homework Help. This is a homework issue. What have you done so far?
 2020-04-25, 07:13 #3 User133   Apr 2020 22×5 Posts Need help pari gp hello, I need help with the task for Pari / gp "Among the numbers 3 (10 ^ 8) ≤n≤4 (10 ^ 8), find the number that has the greatest sum of divisors. If there are several such numbers, find all"
 2020-04-25, 07:28 #4 axn     Jun 2003 154616 Posts Use numdiv function
 2020-04-25, 07:54 #5 User133   Apr 2020 22·5 Posts my problem is that I do not know this program. I have not been able to collect the task in this program for several days Last fiddled with by User133 on 2020-04-25 at 07:54
 2020-04-25, 08:10 #6 User133   Apr 2020 2010 Posts . Last fiddled with by User133 on 2020-04-25 at 08:11
2020-04-25, 08:13   #7
User133

Apr 2020

22·5 Posts

Quote:
 Originally Posted by axn Use numdiv function
I don’t even know the structure of building, I work for the first time in my life. You can more details please

 2020-04-25, 08:13 #8 LaurV Romulan Interpreter     "name field" Jun 2011 Thailand 5×112×17 Posts This is for homework thread. It may be moved there later, as it has nothing to do with num theory. Anyhow, we are trying to help. 1. Do you need just to know the answer? If so, you can easily find it on the web. 397837440, with the sum 1974067200 2. Do you need to learn pari functions? Or to use pari predefined functions to get the answer? If so, look at help for vecsum() and divisors() functions. s=0; for(n=3*10^8,4*10^8,z=vecsum(divisors(n)); if(s30 years ago, we had to sort a list (in Pascal, or C), and learn different ways to sort it, in the process (bubblesort, flagsort, quicksort, etc). One colleague presented program with one line of code only, he was calling the "sort" function in dBase (at the time) and was very upset when the professor, laughing his lungs out, marked him "failed". He even didn't understand that the requirement was not to sort a stupid, 20 items list, which could be easily sorted by pencil, but to learn the algorithms. True story! P.S. at axn: numdiv ??? gotcha! Last fiddled with by LaurV on 2020-04-25 at 08:22
 2020-04-25, 08:17 #9 User133   Apr 2020 22×5 Posts the teacher gave it and didn’t even explain anything. We asked him to help and explain, but he refuses. I quickly solved the problem itself, but I can’t build it in pari (I’ve been trying to figure out the program myself for 3 days but can’t do anything) Last fiddled with by LaurV on 2020-04-25 at 08:24
2020-04-25, 08:40   #11
User133

Apr 2020

248 Posts

Quote:
 Originally Posted by Uncwilly Post moved to Homework Help. This is a homework issue. What have you done so far?
{
n0=0; m0=1; p0=0;
for(n=40,50,
if(vecsum(divisors(n))>m0, m0=vecsum(divisors(n));n0=n);
if(vecsum(divisors(n))==m0, p0+1);
print("summa_del_chisla(", n, ")=", vecsum(divisors(n)), "; MAX summa_del_chisla(",n0, ")=", m0, " povtorov- ", p0 );
)
}

 Similar Threads Thread Thread Starter Forum Replies Last Post paul0 Programming 2 2015-11-17 13:04 skan Miscellaneous Math 0 2012-12-16 00:13 devarajkandadai Programming 21 2012-08-31 18:08 CRGreathouse Software 2 2009-03-13 04:22

All times are UTC. The time now is 15:38.

Wed Mar 29 15:38:05 UTC 2023 up 223 days, 13:06, 0 users, load averages: 1.64, 1.19, 1.06