mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Puzzles (https://www.mersenneforum.org/forumdisplay.php?f=18)
-   -   Sums of all Squares (https://www.mersenneforum.org/showthread.php?t=13181)

davar55 2010-12-13 03:52

While this is current, any other mathematicians here want
to comment on whether this sequence is provably infinite?
Perhaps by a density heuristic argument?

CRGreathouse 2010-12-13 04:45

[QUOTE=davar55;241537]While this is current, any other mathematicians here want
to comment on whether this sequence is provably infinite?
Perhaps by a density heuristic argument?[/QUOTE]

It's heuristically infinite with the n-th term about 2.3n * 10^n. I doubt it can be proven infinite with present technology, but a conditional proof on the k-tuple conjecture seems plausible (though it would give bounds wildly out of proportion with the true size of the terms).

science_man_88 2010-12-13 13:15

[QUOTE=davar55;241534]Well, so far the sequence of sum(p^p)mod(10^n)
(I think it needs a better name) is:

11
751
1129
361649
361649
12462809
12462809
1273183931
1273183931

Any bets that the tenth and eleventh terms are equal,
and whether the twelfth breaks THAT pattern?[/QUOTE]

I don't know what you're doing obviously because all I came up with that your description could be is:

[CODE]a=0;for(n=1,100,a=a+prime(n)^prime(n);print(a%(10^n)))
[/CODE]

davar55 2010-12-13 13:50

The next step would be to filter out to only values = 0.

But I think you need a double loop.

science_man_88 2010-12-13 14:51

[QUOTE=davar55;241584]The next step would be to filter out to only values = 0.

But I think you need a double loop.[/QUOTE]

[CODE]a=0;for(m=1,2,for(n=1,1000,a=a+prime(n)^prime(n);if(a%(10^m)==0,print(n":"m)));a=0)
[/CODE]
like this ?

axn 2010-12-13 16:09

[QUOTE=CRGreathouse;241528]Five, actually -- it will be fourth and fifth on your list:

11, 751, 1129, 361649, 361649, 12462809, 12462809, 1273183931, 1273183931.

Would someone check me on these? The repeating entries are freaking me out.[/QUOTE]

Verified the first 7 terms:
11, 751, 1129, 361649, 361649, 12462809, 12462809.

science_man_88 2010-12-13 16:41

with an outer loop I got 11 661 for the start.

CRGreathouse 2010-12-13 23:57

[QUOTE=science_man_88;241605][CODE]a=0;for(m=1,2,for(n=1,1000,a=a+prime(n)^prime(n);if(a%(10^m)==0,print(n":"m)));a=0)
[/CODE]
like this ?[/QUOTE]

As a rule of thumb, any time you write

for(n=1, _, ... prime(n) ...)

you should be writing

forprime(p=2, prime(_), ... p ...)

instead.

science_man_88 2010-12-14 00:56

[QUOTE=CRGreathouse;241693]As a rule of thumb, any time you write

for(n=1, _, ... prime(n) ...)

you should be writing

forprime(p=2, prime(_), ... p ...)

instead.[/QUOTE]

flaws:

1) isn't always faster
2) results of our codes don't line up so why improve performance of something that gives wrong supposedly inaccurate results
3) I'm already in a bad mood as my sister just called to ask for any mail for here then told me to goto the end of our driveway to check any newer mail and it's almost 9 at night then got mad when i said do I have to, because they technically shouldn't be sending anything here for her or the thing they have planned for my mom.so I'm kinda not in the caring mood.

CRGreathouse 2010-12-14 04:37

[QUOTE=science_man_88;241706]3) I'm already in a bad mood as my sister just called to ask for any mail for here then told me to goto the end of our driveway to check any newer mail and it's almost 9 at night then got mad when i said do I have to, because they technically shouldn't be sending anything here for her or the thing they have planned for my mom.so I'm kinda not in the caring mood.[/QUOTE]

Well, that's what I get for trying to help improve your programming skills. :smile:

[QUOTE=science_man_88;241706]1) isn't always faster[/QUOTE]

It's pretty much faster in all cases. prime() is very inefficient, it typically just goes through the primes until it hits the right one.

for(n=1,10,prime(n)) goes through numbers in this order: 2, 2, 3, 2, 3, 5, 2, 3, 5, 7, 2, 3, 5, 7, 11, 2, 3, 5, 7, 11, 13, 2, 3, 5, 7, 11, 13, 17, 2, 3, 5, 7, 11, 13, 17, 19, 2, 3, 5, 7, 11, 13, 17, 19, 23, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 for a total of 10(10+1)/2 = 55 numbers. forprime(p=2,29,p) goes straight through: 2, 3, 5, 7, 11, 13, 17, 19, 23. forprime(p=2, prime(10), p) goes through the primes once to discover the tenth prime, then again for the actual loop.

[QUOTE=science_man_88;241706]2) results of our codes don't line up so why improve performance of something that gives wrong supposedly inaccurate results[/QUOTE]

Post an example. The only times that
[code]forprime(p=2,prime(floor(N)), f(p))[/code]
should differ from
[code]for(n=1,N, f(prime(n)))[/code]
are[list][*] When n or p are used in f (in which case you might just need to change variables!)[*] When N is not a t_INT, t_REAL, or t_FRAC, in which case both give errors, but the errors are different[*] When you run out of primes (in which case forprime tells you upfront and for() only tells you when you run out)[*] When you look at the time taken (essentially, forprime is always faster)[/list]

NBtarheel_33 2010-12-14 09:18

p^2 or p^p?
 
[QUOTE=davar55;241534]Well, so far the sequence of sum(p^p)mod(10^n)
(I think it needs a better name) is:

11
751
1129
361649
361649
12462809
12462809
1273183931
1273183931

Any bets that the tenth and eleventh terms are equal,
and whether the twelfth breaks THAT pattern?[/QUOTE]

Isn't this the sum of P^2 for p prime, NOT p^p? This thread has me confused...


All times are UTC. The time now is 05:34.

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