mersenneforum.org Sums of all Squares
 Register FAQ Search Today's Posts Mark Forums Read

 2010-12-13, 03:52 #122 davar55     May 2004 New York City 2×2,099 Posts While this is current, any other mathematicians here want to comment on whether this sequence is provably infinite? Perhaps by a density heuristic argument?
2010-12-13, 04:45   #123
CRGreathouse

Aug 2006

2×2,969 Posts

Quote:
 Originally Posted by davar55 While this is current, any other mathematicians here want to comment on whether this sequence is provably infinite? Perhaps by a density heuristic argument?
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).

2010-12-13, 13:15   #124
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

836910 Posts

Quote:
 Originally Posted by davar55 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?
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)))

 2010-12-13, 13:50 #125 davar55     May 2004 New York City 2×2,099 Posts The next step would be to filter out to only values = 0. But I think you need a double loop.
2010-12-13, 14:51   #126
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

8,369 Posts

Quote:
 Originally Posted by davar55 The next step would be to filter out to only values = 0. But I think you need a double loop.
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)
like this ?

2010-12-13, 16:09   #127
axn

Jun 2003

17×281 Posts

Quote:
 Originally Posted by CRGreathouse 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.
Verified the first 7 terms:
11, 751, 1129, 361649, 361649, 12462809, 12462809.

 2010-12-13, 16:41 #128 science_man_88     "Forget I exist" Jul 2009 Dumbassville 202618 Posts with an outer loop I got 11 661 for the start.
2010-12-13, 23:57   #129
CRGreathouse

Aug 2006

2×2,969 Posts

Quote:
 Originally Posted by science_man_88 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) like this ?
As a rule of thumb, any time you write

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

you should be writing

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

2010-12-14, 00:56   #130
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

8,369 Posts

Quote:
 Originally Posted by CRGreathouse As a rule of thumb, any time you write for(n=1, _, ... prime(n) ...) you should be writing forprime(p=2, prime(_), ... p ...) instead.
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.

2010-12-14, 04:37   #131
CRGreathouse

Aug 2006

10111001100102 Posts

Quote:
 Originally Posted by science_man_88 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.
Well, that's what I get for trying to help improve your programming skills.

Quote:
 Originally Posted by science_man_88 1) isn't always faster
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:
 Originally Posted by science_man_88 2) results of our codes don't line up so why improve performance of something that gives wrong supposedly inaccurate results
Post an example. The only times that
Code:
forprime(p=2,prime(floor(N)), f(p))
should differ from
Code:
for(n=1,N, f(prime(n)))
are
• 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)

2010-12-14, 09:18   #132
NBtarheel_33

"Nathan"
Jul 2008
Maryland, USA

21318 Posts
p^2 or p^p?

Quote:
 Originally Posted by davar55 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?
Isn't this the sum of P^2 for p prime, NOT p^p? This thread has me confused...

 Similar Threads Thread Thread Starter Forum Replies Last Post a1call Miscellaneous Math 42 2017-02-03 01:29 Nick Number Theory Discussion Group 0 2016-12-11 11:30 3.14159 Miscellaneous Math 12 2010-07-21 11:47 CRGreathouse Math 6 2009-11-06 19:20 m_f_h Puzzles 45 2007-06-15 17:46

All times are UTC. The time now is 20:45.

Wed Nov 25 20:45:51 UTC 2020 up 76 days, 17:56, 3 users, load averages: 1.39, 1.48, 1.53