How do you find the number of primes in a sequence up to the first thousand terms?
Clash Royale CLAN TAG#URR8PPP
up vote
-2
down vote
favorite
I have a sequence:
$ 7,19,61,193,577,1633,4417, ... $
and I'd like to find out how many primes and semiprimes there are in this sequence up to the first thousand terms? Any idea how I could do that quickly?
To form the sequence I did: $ 3(2)+1, 6(3)+1, 12(5)+1, 24(8)+1, 48(12)+1, 96(17)+1, ... $
i.e. : $ 3+3+1, 6+6+6+1, 12+12+12+12+12+1, ... $
sequences-and-series prime-numbers
add a comment |Â
up vote
-2
down vote
favorite
I have a sequence:
$ 7,19,61,193,577,1633,4417, ... $
and I'd like to find out how many primes and semiprimes there are in this sequence up to the first thousand terms? Any idea how I could do that quickly?
To form the sequence I did: $ 3(2)+1, 6(3)+1, 12(5)+1, 24(8)+1, 48(12)+1, 96(17)+1, ... $
i.e. : $ 3+3+1, 6+6+6+1, 12+12+12+12+12+1, ... $
sequences-and-series prime-numbers
Well I took 3,3,1 and then 6,6,6,1, and then 12,12,12,12,12,1 etc. so the 2,3,5,12,17 are the number of times you multiply the 3, 6, 12, etc.
– George Thomas
Jul 22 at 23:24
If $t_n$ is the $n$th triangular number, then a formula for the sequence is $a_n = 3cdot 2^n-1(2+t_n-1)+1$ and we know that $t_n = n(n+1)/2.$
– B. Goddard
Jul 22 at 23:26
So this is a triangular sequence you're saying?
– George Thomas
Jul 22 at 23:29
No. The triangular numbers come into the formula. If you simplify my calculations you get $a_n = 3cdot 2^n-2(n^2-n+4) +1.$ It's easy to write a quick loop in Maple and get the list that Robert gets below.
– B. Goddard
Jul 22 at 23:33
add a comment |Â
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
I have a sequence:
$ 7,19,61,193,577,1633,4417, ... $
and I'd like to find out how many primes and semiprimes there are in this sequence up to the first thousand terms? Any idea how I could do that quickly?
To form the sequence I did: $ 3(2)+1, 6(3)+1, 12(5)+1, 24(8)+1, 48(12)+1, 96(17)+1, ... $
i.e. : $ 3+3+1, 6+6+6+1, 12+12+12+12+12+1, ... $
sequences-and-series prime-numbers
I have a sequence:
$ 7,19,61,193,577,1633,4417, ... $
and I'd like to find out how many primes and semiprimes there are in this sequence up to the first thousand terms? Any idea how I could do that quickly?
To form the sequence I did: $ 3(2)+1, 6(3)+1, 12(5)+1, 24(8)+1, 48(12)+1, 96(17)+1, ... $
i.e. : $ 3+3+1, 6+6+6+1, 12+12+12+12+12+1, ... $
sequences-and-series prime-numbers
edited Jul 22 at 23:27
asked Jul 22 at 23:20


George Thomas
269416
269416
Well I took 3,3,1 and then 6,6,6,1, and then 12,12,12,12,12,1 etc. so the 2,3,5,12,17 are the number of times you multiply the 3, 6, 12, etc.
– George Thomas
Jul 22 at 23:24
If $t_n$ is the $n$th triangular number, then a formula for the sequence is $a_n = 3cdot 2^n-1(2+t_n-1)+1$ and we know that $t_n = n(n+1)/2.$
– B. Goddard
Jul 22 at 23:26
So this is a triangular sequence you're saying?
– George Thomas
Jul 22 at 23:29
No. The triangular numbers come into the formula. If you simplify my calculations you get $a_n = 3cdot 2^n-2(n^2-n+4) +1.$ It's easy to write a quick loop in Maple and get the list that Robert gets below.
– B. Goddard
Jul 22 at 23:33
add a comment |Â
Well I took 3,3,1 and then 6,6,6,1, and then 12,12,12,12,12,1 etc. so the 2,3,5,12,17 are the number of times you multiply the 3, 6, 12, etc.
– George Thomas
Jul 22 at 23:24
If $t_n$ is the $n$th triangular number, then a formula for the sequence is $a_n = 3cdot 2^n-1(2+t_n-1)+1$ and we know that $t_n = n(n+1)/2.$
– B. Goddard
Jul 22 at 23:26
So this is a triangular sequence you're saying?
– George Thomas
Jul 22 at 23:29
No. The triangular numbers come into the formula. If you simplify my calculations you get $a_n = 3cdot 2^n-2(n^2-n+4) +1.$ It's easy to write a quick loop in Maple and get the list that Robert gets below.
– B. Goddard
Jul 22 at 23:33
Well I took 3,3,1 and then 6,6,6,1, and then 12,12,12,12,12,1 etc. so the 2,3,5,12,17 are the number of times you multiply the 3, 6, 12, etc.
– George Thomas
Jul 22 at 23:24
Well I took 3,3,1 and then 6,6,6,1, and then 12,12,12,12,12,1 etc. so the 2,3,5,12,17 are the number of times you multiply the 3, 6, 12, etc.
– George Thomas
Jul 22 at 23:24
If $t_n$ is the $n$th triangular number, then a formula for the sequence is $a_n = 3cdot 2^n-1(2+t_n-1)+1$ and we know that $t_n = n(n+1)/2.$
– B. Goddard
Jul 22 at 23:26
If $t_n$ is the $n$th triangular number, then a formula for the sequence is $a_n = 3cdot 2^n-1(2+t_n-1)+1$ and we know that $t_n = n(n+1)/2.$
– B. Goddard
Jul 22 at 23:26
So this is a triangular sequence you're saying?
– George Thomas
Jul 22 at 23:29
So this is a triangular sequence you're saying?
– George Thomas
Jul 22 at 23:29
No. The triangular numbers come into the formula. If you simplify my calculations you get $a_n = 3cdot 2^n-2(n^2-n+4) +1.$ It's easy to write a quick loop in Maple and get the list that Robert gets below.
– B. Goddard
Jul 22 at 23:33
No. The triangular numbers come into the formula. If you simplify my calculations you get $a_n = 3cdot 2^n-2(n^2-n+4) +1.$ It's easy to write a quick loop in Maple and get the list that Robert gets below.
– B. Goddard
Jul 22 at 23:33
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
There are $24$ primes in the first $1000$ terms, namely terms number
$$1, 2, 3, 4, 5, 12, 21, 23, 24, 27, 46, 47, 48, 50, 54, 65, 68, 101, 159, 286, 483, 572, 802, 873$$
There's no shortcut, just generate the terms and test for primality.
Fortunately, that's quite fast. In Maple on my computer it took less than half a second.
Counting the semiprimes would be harder, I think, because I don't know of a way to test for semiprimes that's much faster than factoring, and the $1000$'th term has $307$ digits - no picnic to factor.
I'm sorry I don't understand this
– George Thomas
Jul 22 at 23:31
What part don't you understand?
– Robert Israel
Jul 22 at 23:33
What are the numbers you listed?
– George Thomas
Jul 22 at 23:36
Oh are those the terms in the sequence that yield primes?
– George Thomas
Jul 22 at 23:39
1
Ah I see that it's the law of small numbers taking effect here
– George Thomas
Jul 22 at 23:56
 |Â
show 4 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
There are $24$ primes in the first $1000$ terms, namely terms number
$$1, 2, 3, 4, 5, 12, 21, 23, 24, 27, 46, 47, 48, 50, 54, 65, 68, 101, 159, 286, 483, 572, 802, 873$$
There's no shortcut, just generate the terms and test for primality.
Fortunately, that's quite fast. In Maple on my computer it took less than half a second.
Counting the semiprimes would be harder, I think, because I don't know of a way to test for semiprimes that's much faster than factoring, and the $1000$'th term has $307$ digits - no picnic to factor.
I'm sorry I don't understand this
– George Thomas
Jul 22 at 23:31
What part don't you understand?
– Robert Israel
Jul 22 at 23:33
What are the numbers you listed?
– George Thomas
Jul 22 at 23:36
Oh are those the terms in the sequence that yield primes?
– George Thomas
Jul 22 at 23:39
1
Ah I see that it's the law of small numbers taking effect here
– George Thomas
Jul 22 at 23:56
 |Â
show 4 more comments
up vote
4
down vote
accepted
There are $24$ primes in the first $1000$ terms, namely terms number
$$1, 2, 3, 4, 5, 12, 21, 23, 24, 27, 46, 47, 48, 50, 54, 65, 68, 101, 159, 286, 483, 572, 802, 873$$
There's no shortcut, just generate the terms and test for primality.
Fortunately, that's quite fast. In Maple on my computer it took less than half a second.
Counting the semiprimes would be harder, I think, because I don't know of a way to test for semiprimes that's much faster than factoring, and the $1000$'th term has $307$ digits - no picnic to factor.
I'm sorry I don't understand this
– George Thomas
Jul 22 at 23:31
What part don't you understand?
– Robert Israel
Jul 22 at 23:33
What are the numbers you listed?
– George Thomas
Jul 22 at 23:36
Oh are those the terms in the sequence that yield primes?
– George Thomas
Jul 22 at 23:39
1
Ah I see that it's the law of small numbers taking effect here
– George Thomas
Jul 22 at 23:56
 |Â
show 4 more comments
up vote
4
down vote
accepted
up vote
4
down vote
accepted
There are $24$ primes in the first $1000$ terms, namely terms number
$$1, 2, 3, 4, 5, 12, 21, 23, 24, 27, 46, 47, 48, 50, 54, 65, 68, 101, 159, 286, 483, 572, 802, 873$$
There's no shortcut, just generate the terms and test for primality.
Fortunately, that's quite fast. In Maple on my computer it took less than half a second.
Counting the semiprimes would be harder, I think, because I don't know of a way to test for semiprimes that's much faster than factoring, and the $1000$'th term has $307$ digits - no picnic to factor.
There are $24$ primes in the first $1000$ terms, namely terms number
$$1, 2, 3, 4, 5, 12, 21, 23, 24, 27, 46, 47, 48, 50, 54, 65, 68, 101, 159, 286, 483, 572, 802, 873$$
There's no shortcut, just generate the terms and test for primality.
Fortunately, that's quite fast. In Maple on my computer it took less than half a second.
Counting the semiprimes would be harder, I think, because I don't know of a way to test for semiprimes that's much faster than factoring, and the $1000$'th term has $307$ digits - no picnic to factor.
edited Jul 22 at 23:37
answered Jul 22 at 23:29
Robert Israel
304k22201441
304k22201441
I'm sorry I don't understand this
– George Thomas
Jul 22 at 23:31
What part don't you understand?
– Robert Israel
Jul 22 at 23:33
What are the numbers you listed?
– George Thomas
Jul 22 at 23:36
Oh are those the terms in the sequence that yield primes?
– George Thomas
Jul 22 at 23:39
1
Ah I see that it's the law of small numbers taking effect here
– George Thomas
Jul 22 at 23:56
 |Â
show 4 more comments
I'm sorry I don't understand this
– George Thomas
Jul 22 at 23:31
What part don't you understand?
– Robert Israel
Jul 22 at 23:33
What are the numbers you listed?
– George Thomas
Jul 22 at 23:36
Oh are those the terms in the sequence that yield primes?
– George Thomas
Jul 22 at 23:39
1
Ah I see that it's the law of small numbers taking effect here
– George Thomas
Jul 22 at 23:56
I'm sorry I don't understand this
– George Thomas
Jul 22 at 23:31
I'm sorry I don't understand this
– George Thomas
Jul 22 at 23:31
What part don't you understand?
– Robert Israel
Jul 22 at 23:33
What part don't you understand?
– Robert Israel
Jul 22 at 23:33
What are the numbers you listed?
– George Thomas
Jul 22 at 23:36
What are the numbers you listed?
– George Thomas
Jul 22 at 23:36
Oh are those the terms in the sequence that yield primes?
– George Thomas
Jul 22 at 23:39
Oh are those the terms in the sequence that yield primes?
– George Thomas
Jul 22 at 23:39
1
1
Ah I see that it's the law of small numbers taking effect here
– George Thomas
Jul 22 at 23:56
Ah I see that it's the law of small numbers taking effect here
– George Thomas
Jul 22 at 23:56
 |Â
show 4 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2859864%2fhow-do-you-find-the-number-of-primes-in-a-sequence-up-to-the-first-thousand-term%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Well I took 3,3,1 and then 6,6,6,1, and then 12,12,12,12,12,1 etc. so the 2,3,5,12,17 are the number of times you multiply the 3, 6, 12, etc.
– George Thomas
Jul 22 at 23:24
If $t_n$ is the $n$th triangular number, then a formula for the sequence is $a_n = 3cdot 2^n-1(2+t_n-1)+1$ and we know that $t_n = n(n+1)/2.$
– B. Goddard
Jul 22 at 23:26
So this is a triangular sequence you're saying?
– George Thomas
Jul 22 at 23:29
No. The triangular numbers come into the formula. If you simplify my calculations you get $a_n = 3cdot 2^n-2(n^2-n+4) +1.$ It's easy to write a quick loop in Maple and get the list that Robert gets below.
– B. Goddard
Jul 22 at 23:33