![]() |
|
|
#2366 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
newest idea for the BHP script:
Code:
BHP(n) =until(n==0,print(dp(n));n=n%(10^(length(Str(n))-1))) Last fiddled with by science_man_88 on 2012-07-17 at 13:54 |
|
|
|
|
|
#2367 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
the closest I could get to what's needed for BHP to be like a human searching is:
Code:
n=33191;
a=Vec(Str(n));
b="";
c=vector(#a,z,[]);
for(x=1,#a,
for(y=x,#a,
b=concat(b,a[y]);
if(isprime(eval(b)),
c[x]=concat(c[x],eval(b))
)
);
b="")
;c
|
|
|
|
|
|
#2368 |
|
If I May
"Chris Halsall"
Sep 2002
Barbados
2·67·73 Posts |
If a tree falls in a forest and no one is around to hear it, does it make a sound?
|
|
|
|
|
|
#2369 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
Code:
y=1;
a=vector(2000000,n,
until(isprime(y) && !(y>3 && y%4==3 && isprime(2*y+1)),
y=y+1);
y
)
remade with Code:
y=y+1 Code:
if(y%6==1,y=y+4,y=y+2) Last fiddled with by science_man_88 on 2012-09-08 at 22:02 |
|
|
|
|
|
#2370 |
|
Aug 2006
3×1,993 Posts |
You should use the select command.
Start with a list of primes Code:
candidates=primes(1000); Code:
candidates=select(p -> p%4==1 || !isprime(2*p+1), candidates); Code:
candidates=select(candidates, p -> p%4==3 && isprime(2*p+1)); |
|
|
|
|
|
#2371 | |
|
"Forget I exist"
Jul 2009
Dumbassville
838410 Posts |
Quote:
Last fiddled with by science_man_88 on 2012-09-08 at 23:22 |
|
|
|
|
|
|
#2372 |
|
"(^r'°:.:)^n;e'e"
Nov 2008
;t:.:;^
99910 Posts |
|
|
|
|
|
|
#2373 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
this came out of someone talking annual capital gains percentage but me interpreting it as interest rate annually:
Code:
gainsversusinterest(a,b,c,d)= (((a/b)/c)*d)^(1/d) Last fiddled with by science_man_88 on 2012-11-17 at 01:36 |
|
|
|
|
|
#2374 |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
an attempted remake ( and correction at last check) of the FaR script:
Code:
FaR(S1,S2,S3) = aa=eval(Vec(S1));for(x=1,#aa,if(vecextract(aa,)==eval(Vec(S2)),)) |
|
|
|
|
|
#2375 |
|
Aug 2006
135338 Posts |
If you can be very specific in explaining what you want, I may be able to help.
|
|
|
|
|
|
#2376 | ||
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
Quote:
Quote:
edit: I realized that the vector option was an option but then I still fail to make it work. Last fiddled with by science_man_88 on 2013-06-12 at 02:14 |
||
|
|
|
![]() |
| 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 |