Message Boards Message Boards

0
|
6733 Views
|
6 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[Solved] Print n-th number from list

Posted 11 years ago

I want to print 2547-th prime number after 982400000.

Listing primes from 982400000 to 982500000 is easy:

primes between 982400000 and 982500000

But then I need to get 2547-th element from the list and I don't know how. I've tried using take function like this:

take[{primes between 982400000 and 982500000},{2547}]
take[(primes between 982400000 and 982500000),{2547}]
take[primes between 982400000 and 982500000,{2547}]

...and I've tried part function:

Part[primes between 982400000 and 982500000, 2547]
Part[{primes between 982400000 and 982500000}, 2547]
Part[(primes between 982400000 and 982500000), 2547]
{primes between 982400000 and 982500000}[[2547]]
(primes between 982400000 and 982500000)[[2547]]

...but with no success. Any ideas?

POSTED BY: Piotr K?kol
6 Replies
Posted 11 years ago

From now on I will. Thanks for suggesting.

POSTED BY: Piotr K?kol

It can be a bit subtle to get Wolfram|Alpha to know what one is asking. If it doesn't respond properly to a sensibly phrased query it's always good to submit a report: they are taken seriously and used to update Wolfram|Alpha's parser.

POSTED BY: David Reiss
Posted 11 years ago

Ach. Thanks! I was close though - tried this one as the first guess:

2547th prime from 982400000
POSTED BY: Piotr K?kol

This works in Woflram|Alpha

2547th prime after 982400000

http://www.wolframalpha.com/input/?i=2547th+prime+after+982400000

POSTED BY: David Reiss
Posted 11 years ago

It doesn't work in Wolfram|Alpha. I thought that this language works there. It seems I was wrong. Any ideas how to get the result in Wolfram|Alpha?

POSTED BY: Piotr K?kol
Select[Range[982400000 , 982500000], PrimeQ][[2547]]

gives

982451653
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract