+ Reply to Thread
Results 1 to 2 of 2

How to get functions about prime numbers in Excel 2013?

  1. #1
    Registered User
    Join Date
    04-19-2014
    Location
    France
    MS-Off Ver
    Excel 2013
    Posts
    25

    How to get functions about prime numbers in Excel 2013?

    Hi.

    Is there any way to get any of these four functions in Excel 2013? :

    - pi(x) the prime counting function: http://mathworld.wolfram.com/PrimeCountingFunction.html

    - li(x) the logarithmic integral function: http://mathworld.wolfram.com/LogarithmicIntegral.html

    - prime(n) = the n-th prime. Example: prime(6) = 13

    - R(x) Riemann’s R-function: http://mathworld.wolfram.com/Riemann...gFunction.html (not the first function, the function at the middle of the article)

    Thanks in advance for your answers.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,926

    Re: How to get functions about prime numbers in Excel 2013?

    I have very limited experience in number theory like that. I do know that the algorithms for these kind of functions are fairly complex, but also fairly well established.

    The short but useless answer to your question is, yes, it can be done. The difficult part is how best to approach it.

    One approach would be to take code from the internet (most of it seems to be in C, some of the older stuff is in Fortran), adapt and compile it into a dll in such a way that Excel can call those functions as user-defined functions.

    Another approach would be to take the same C code, convert it to VBA, then you can use those VBA UDF's in your spreadsheet.

    For some of these (like pi(x) or prime(n)) the "easiest" approach might be to compute the results using the Mathematica function and build a table of results. This table could then be imported into Excel and used as a simple lookup table.

    I realize it is not much help, but this will at least bump your question back to the top and see if anyone else has any additional suggestions.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Highlight all prime numbers in column
    By bluecat2013 in forum Excel General
    Replies: 3
    Last Post: 02-21-2014, 01:19 PM
  2. Excel 2013: Cells to Numbers
    By Image in forum Excel General
    Replies: 13
    Last Post: 01-30-2014, 05:04 PM
  3. Functions not recognized (error) in Excel 2013 64bit,
    By PlamenGo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2013, 05:36 AM
  4. Prime numbers
    By Gearcutter in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-08-2007, 09:03 AM
  5. [SOLVED] Prime Numbers
    By Flyone in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-02-2005, 10:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1