mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-09-11, 13:13   #1398
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

I just don't understand what you're saying. Let's start from the top. Without using any Pari terminology, what are you trying to accomplish?
CRGreathouse is offline   Reply With Quote
Old 2010-09-11, 13:49   #1399
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

1)read strings into an array
2)find a meaning if possible.
3)once the array is of n length move every string forward one in the array,
4)add a new word in the last index of the array
science_man_88 is offline   Reply With Quote
Old 2010-09-11, 18:20   #1400
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
1)read strings into an array
You probably should take a string as an argument, rather than reading from the keyboard.

Quote:
Originally Posted by science_man_88 View Post
2)find a meaning if possible.
That's the hard part, of course.

Quote:
Originally Posted by science_man_88 View Post
3)once the array is of n length move every string forward one in the array,
You can do this
Code:
shiftforward(v)=vector(#v+1,i,if(i==1,"initial value", v[i-1]))
but you'd probably be better off using a function that only looks at one string at a time (which can be called by a function that takes a vector of strings).
CRGreathouse is offline   Reply With Quote
Old 2010-09-11, 20:40   #1401
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
You probably should take a string as an argument, rather than reading from the keyboard.



That's the hard part, of course.



You can do this
Code:
shiftforward(v)=vector(#v+1,i,if(i==1,"initial value", v[i-1]))
but you'd probably be better off using a function that only looks at one string at a time (which can be called by a function that takes a vector of strings).
I don't even remember your lessons of Vec of Vec or what ever it was to make the array.

yeah this part is mis-ordered but it's one we'll have to cover

the hard part is make the array I think I have away I'll try it.
yeah I was thinking of using FaR for one part and replacing with another word.
science_man_88 is offline   Reply With Quote
Old 2010-09-11, 22:01   #1402
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
I don't even remember your lessons of Vec of Vec or what ever it was to make the array.
I don't know what you want in the array. Here are general ways to make arrays/vectors:

Method 1, "Initialization":
v=vector(size_of_vector, i, vector_value_at(i))

Method 2, "Set in a Loop":
v=vector(size_of_vector);
for(i=1,#v,v[i]=vector_value_at(i))

Method 3, "Size Not Known Ahead of Time"
v=[];
for(x=start_x,stop_x,if(stuff_involving(x), v=concat(v, vector_value_at_x(x))))
CRGreathouse is offline   Reply With Quote
Old 2010-09-11, 22:03   #1403
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

I want an array of each word in sequence. into an array then i can check the array for groupings of words I think to denote what it means.
science_man_88 is offline   Reply With Quote
Old 2010-09-11, 22:45   #1404
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

I couldn't get any ecm / aliquot stuff to work for me so I built my own code unfortunately it only looks to work for perfect numbers.

Code:
Aliquot(n)= v=vector(1,x,n);for(a=2,10,d=sumdiv(v[a-1],X,X=X)-v[a-1];v=concat(v,d))
I have no clue why this doesn't work, except a factorint error.

Last fiddled with by science_man_88 on 2010-09-11 at 22:46
science_man_88 is offline   Reply With Quote
Old 2010-09-12, 05:41   #1405
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

135338 Posts
Default

What is it trying to do?
CRGreathouse is offline   Reply With Quote
Old 2010-09-12, 11:05   #1406
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
What is it trying to do?
Code:
Aliquot(n)
science_man_88 is offline   Reply With Quote
Old 2010-09-12, 14:40   #1407
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

597910 Posts
Default

Return a vector of the aliquot parts? Return the sum of the aliquot parts? Loop over the aliquot parts? Something else?
CRGreathouse is offline   Reply With Quote
Old 2010-09-12, 15:00   #1408
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
Return a vector of the aliquot parts? Return the sum of the aliquot parts? Loop over the aliquot parts? Something else?
return aliquot sequence n
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I sometimes see all the <> formatting commands when I quote or edit? cheesehead Forum Feedback 3 2013-05-25 12:56
Passing commands to PARI on Windows James Heinrich Software 2 2012-05-13 19:19
Ubiquity commands Mini-Geek Aliquot Sequences 1 2009-09-22 19:33
64-bit Pari? CRGreathouse Software 2 2009-03-13 04:22
Are these commands correct? jasong Linux 2 2007-10-18 23:40

All times are UTC. The time now is 23:11.


Fri Aug 6 23:11:57 UTC 2021 up 14 days, 17:40, 1 user, load averages: 4.26, 4.21, 4.04

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.