mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PARI/GP (https://www.mersenneforum.org/forumdisplay.php?f=155)
-   -   PARI's commands (https://www.mersenneforum.org/showthread.php?t=13636)

Batalov 2012-07-10 21:24

It was sarcasm, man. I actually made a bet that it will go undetected.

Sarcasm is when adjectives are deliberately inverted. Example: "That movie? I simply [I]loved*[/I] every bit of it. [URL="http://tvtropes.org/pmwiki/pmwiki.php/Main/SoBadItsGood"]It is so bad that it's actually hilarious[/URL]!"

____
*sarcasm detected. In plain speak, a person would say "hated it"

science_man_88 2012-07-10 21:39

[QUOTE=Batalov;304421]It was sarcasm, man. I actually made a bet that it will go undetected.

Sarcasm is when adjectives are deliberately inverted. Example: "That movie? I simply [I]loved*[/I] every bit of it. [URL="http://tvtropes.org/pmwiki/pmwiki.php/Main/SoBadItsGood"]It is so bad that it's actually hilarious[/URL]!"

____
*sarcasm detected. In plain speak, a person would say "hated it"[/QUOTE]

maybe it went undetected because if I'm serious about things, I'm not involving sarcasm.

science_man_88 2012-07-10 23:58

I can see why it might be hard to do though:

ex. 33191

[CODE]? isprime(3)
%25 = 1
? isprime(331)
%26 = 1
? isprime(3319)
%27 = 1
? isprime(33191)
%28 = 1
? isprime(31)
%29 = 1
? isprime(319)
%30 = 0
? isprime(3191)
%31 = 1
? isprime(19)
%32 = 1
? isprime(191)
%33 = 1[/CODE]

8 primes in 5 digits so just looking for primes without looking for is this greater/less than this becomes practically impossible, even looking for greater/less than might be somewhat impossible because it could be 191 or 3191 for the high limit depending on how you break it down. so you can by eye come up with 3*3*191 or 3*3191 for it but using a computer program will get rather complex.

CRGreathouse 2012-07-11 03:27

[code]dp(n)={
if(n<12, return(if(isprime(n), [n], [])));
my(v=vecsort(select(isprime, eval(Vec(Str(n)))), , 8), t);
while(n>9,
if(gcd(n%10, 10)>1, n\=10; next);
t=10;
while((t*=10)<n*10,
if(isprime(n%t), v=concat(v, n%t))
);
v=vecsort(v, , 8);
n\=10
);
v
};
addhelp(dp, "dp(n): Distinct primes formed from substrings of n. Related to Sloane's A039997 and A093301.");[/code]

[code]> dp(33191)
%1 = [3, 19, 31, 191, 331, 3191, 3319, 33191]
> #%
%2 = 8[/code]

science_man_88 2012-07-11 11:43

[QUOTE=CRGreathouse;304465][code]dp(n)={
if(n<12, return(if(isprime(n), [n], [])));
my(v=vecsort(select(isprime, eval(Vec(Str(n)))), , 8), t);
while(n>9,
if(gcd(n%10, 10)>1, n\=10; next);
t=10;
while((t*=10)<n*10,
if(isprime(n%t), v=concat(v, n%t))
);
v=vecsort(v, , 8);
n\=10
);
v
};
addhelp(dp, "dp(n): Distinct primes formed from substrings of n. Related to Sloane's A039997 and A093301.");[/code]

[code]> dp(33191)
%1 = [3, 19, 31, 191, 331, 3191, 3319, 33191]
> #%
%2 = 8[/code][/QUOTE]

now I'm going to have to figure out which come together to form the numbers .

science_man_88 2012-07-15 17:53

I'll have to refocus on the backwards home prime stuff again but for some reason my brain is stuck in do things backwards mode:

[CODE]reverse_collatz(n)=if(n%3==1&&((n-1)/3)%2==1,return([(n-1)/3,2*n]),return([2*n]))[/CODE]

CRGreathouse 2012-07-15 19:31

[code]reverse_collatz(n)=if(n%6==4,[n\3,2*n],[2*n])[/code]

science_man_88 2012-07-15 19:34

[QUOTE=CRGreathouse;304832]Why are you returning one-element vectors?[/QUOTE]

I clearly didn't think deep enough, maybe it would help in recall if it's mixed in with 2 element ones to check for repeating because 1,4,2,1 does exist even if you make it look for n%2==1 values.

edit: I messed up everything after 1,4,2,1 I think

science_man_88 2012-07-15 21:25

[QUOTE=CRGreathouse;304832][code]reverse_collatz(n)=if(n%6==4,[n\3,2*n],[2*n])[/code][/QUOTE]

I just looked into it using modular arithmetic how can it work because I get:

[QUOTE]0->0
1->2,4,0
2->4
3->0
4->1,2,3,5
5->4[/QUOTE]

going backwards if 4 mod 6 is the only way to get 1 3 and 5 mod 6 then the Collatz conjecture can't be true over all the positive numbers because the number of numbers that are 1 3 and 5 mod 6 have a total greater than the amount of 4 mod 6 .

CRGreathouse 2012-07-15 21:30

If n is 1 mod 3 and (n-1)/3 is 2k+1 for some k then n-1 is 6k+3 and so n =6k+4 for some k, i.e., is 4 mod 6.

science_man_88 2012-07-15 21:35

[QUOTE=CRGreathouse;304847]If n is 1 mod 3 and (n-1)/3 is 2k+1 for some k then n-1 is 6k+3 and so n =6k+4 for some k, i.e., is 4 mod 6.[/QUOTE]

I get some of that and I see my error it's treating infinity as a limit and treating it like any positive number because there's no limit on the size of number to go through it can continue to stay true even with the 4 mod 6 outnumbered.


All times are UTC. The time now is 22:48.

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