mersenneforum.org  

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

Reply
 
Thread Tools
Old 2010-12-01, 18:02   #1860
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
I can't quite follow you, but
Code:
n=0;
while(1,
  print1(n++);
  if(n>9, break);
  print1(", ")
);
does the trick.

Wonder how fast we could finish off the list? You know most of them by the sounds of it. I'm still a little stumped on how to fix my rle script but I know ( and ) shouldn't be used to code something with. By the looks of it and I need ways to check for control characters,spaces and numbers that appear out of nowhere
in the strings but aren't part of the count of characters) maybe a Vec, and a scan of type will do but maybe not. I'm so stupid maybe tab in between would help lol.

Last fiddled with by science_man_88 on 2010-12-01 at 18:03
science_man_88 is offline   Reply With Quote
Old 2010-12-01, 18:15   #1861
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

if something can be done to files in the file system root:

http://rosettacode.org/wiki/File_size the hard part to this one that must have landed it in the too hard category must be how to read the original given file size to compare something with.
science_man_88 is offline   Reply With Quote
Old 2010-12-01, 18:38   #1862
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

http://rosettacode.org/wiki/Pascal's_triangle/Puzzle

Doesn't sound hard in one sense.

solve:
Quote:
[ 151]
[ ][ ]
[40][ ][ ]
[ ][ ][ ][ ]
[ X][11][ Y][ 4][ Z]
first piece I can gather is x+y+22 = 40;so x+y=18 this is a fact to check for; also once a pair of x and y =18; also x+2y+z+30 = 151; so x+2y+z = 121; another fact to check for when going through z values.

Last fiddled with by science_man_88 on 2010-12-01 at 18:39
science_man_88 is offline   Reply With Quote
Old 2010-12-01, 18:44   #1863
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

100000110000002 Posts
Default

Code:
for(x=0,18,for(y=0,18,if(x+y=18,for(z=1,103,if((x+2*y+z)==121,print(x","y","z);break(3))))))
First one it found was 0,18,85 . It never says the program has to use only the data given, I used what I could gather.

Last fiddled with by science_man_88 on 2010-12-01 at 18:47
science_man_88 is offline   Reply With Quote
Old 2010-12-01, 19:45   #1864
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
Code:
for(x=0,18,for(y=0,18,if(x+y=18,for(z=1,103,if((x+2*y+z)==121,print(x","y","z);break(3))))))
First one it found was 0,18,85 . It never says the program has to use only the data given, I used what I could gather.
oops forgot y=x+z but that doesn't work I've messed up
science_man_88 is offline   Reply With Quote
Old 2010-12-01, 20:25   #1865
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

I've determined y=13 by:


[ 6y+x+z+4a[2]+4a[4]= 7y +4a[2]+4a[4]]
[3y+x+37 ][3y+z+23]
[40=x+y+22][ 2y+15][ y+z+8 ]
[ x+11 ][y+11 ][y+4 ][z+4 ]
[ X][11][ Y][ 4][ Z]

if a = [] bottom row


for this sized triangle we see in this case 151-(44+16) = 91 ; 91/7 =13 y=13
40-13-22 =x = 5; 13-5=z=8;

however I now know how to solve it in this case.
science_man_88 is offline   Reply With Quote
Old 2010-12-01, 20:47   #1866
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Code:
 Pascals_triangle_puzzle(topvalue=151,leftsidevalue=40,bottomvalue1=11,bottomvalue2=4) = {
y=(topvalue-(4*(bottomvalue1+bottomvalue2)))/7;
x=leftsidevalue-(y+2*bottomvalue1);
z=y-x;
print(x","y","z); }
This easy enough ? I might try to make one for any size. just have to figure out the patterns lol.

Last fiddled with by science_man_88 on 2010-12-01 at 20:48
science_man_88 is offline   Reply With Quote
Old 2010-12-01, 23:24   #1867
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

I figured out how to falsify factoring a large number (somewhat);

Code:
[866876601688257388041953428681474799611455578456879011971315052706094788178469895182220494116473202297231530219967803566778120639 528365543601153323389150907773258262552994601295053933845142213535320241754514748728875053183803012869853716977772216817067444377]

[361704130063529693429159107448019863732305480622816041454555619831169499041663864963068219490947259594777674878198147873998732309 326729818580681541350657067987755793696856969106820654842683490163988042729198926945304899046855890448333533668661395285070725039]
Which is..
Code:
866876601688257388041953428681474799611455578456879011971315052706094788178469895182220494116473202297231530219967803566778120639528365543601153323389150907773258262552994601295053933845142213535320241754514748728875053183803012869853716977772216817067444377 * 361704130063529693429159107448019863732305480622816041454555619831169499041663864963068219490947259594777674878198147873998732309326729818580681541350657067987755793696856969106820654842683490163988042729198926945304899046855890448333533668661395285070725039

Last fiddled with by 3.14159 on 2010-12-01 at 23:24
3.14159 is offline   Reply With Quote
Old 2010-12-01, 23:26   #1868
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
I figured out how to falsify factoring a large number (somewhat);

Code:
[866876601688257388041953428681474799611455578456879011971315052706094788178469895182220494116473202297231530219967803566778120639 528365543601153323389150907773258262552994601295053933845142213535320241754514748728875053183803012869853716977772216817067444377]

[361704130063529693429159107448019863732305480622816041454555619831169499041663864963068219490947259594777674878198147873998732309 326729818580681541350657067987755793696856969106820654842683490163988042729198926945304899046855890448333533668661395285070725039]
Which is..
Code:
866876601688257388041953428681474799611455578456879011971315052706094788178469895182220494116473202297231530219967803566778120639528365543601153323389150907773258262552994601295053933845142213535320241754514748728875053183803012869853716977772216817067444377 * 361704130063529693429159107448019863732305480622816041454555619831169499041663864963068219490947259594777674878198147873998732309326729818580681541350657067987755793696856969106820654842683490163988042729198926945304899046855890448333533668661395285070725039
finally Pi is back lol.
science_man_88 is offline   Reply With Quote
Old 2010-12-01, 23:31   #1869
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
finally Pi is back lol.
Thanks. I get + 1 years added to my current age today.
3.14159 is offline   Reply With Quote
Old 2010-12-01, 23:41   #1870
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
so in other words if(string==type(0) ||string==type(1/2), print("this string is numerical")) would work ?
No.

if(type(string) == "t_STR", print("It's a string."))

Quote:
Originally Posted by science_man_88 View Post
Though I haven't covered floating point types.
t_REAL and t_COMPLEX.
CRGreathouse 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:01.


Fri Aug 6 23:01:48 UTC 2021 up 14 days, 17:30, 1 user, load averages: 3.99, 4.10, 4.01

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.