I've got this code in mathematica that could be used in other programming languages. Would a patent protect me against people transferring the mathematical formulas I've developed into other programming languages ? Books are written in different languages but the content stays the same. Can I patent a mathematical formula ?

I've developed a bit of mathematica code that can find primes within a range of numbers. For example, if I wanted all the primes between one million and two million, it could do that. Of what use is this code I invented ?

the code is based on a bigger structure of numbers formed by the Sieve of Eratosthenes.

  • 1
    Dude never disclose what you have in public first consult a agent then figure out what to do, first criteria of any invention is novel you are making it public.. i have removed what you disclose moderator can revise if based on author consent.
    – Pushpak
    Commented Mar 13, 2015 at 4:58
  • @Pushpak It's of no use, I've already disclosed the information on a couple of different forums. It's gone public.
    – user24719
    Commented Mar 19, 2015 at 3:46
  • still you can check your attorney or agent you might have grace period of 12 months for at least national patent application.
    – Pushpak
    Commented Mar 20, 2015 at 6:33

2 Answers 2


You can't patent ideas, and "finding prime numbers" unfortunately isn't really a tangible process.

You'd be better off going for a patent on a use for that formula. Coming up with a use for such a thing is out of the scope of this site, but I'd suggest looking into encryption. As far as I know, that's the heaviest use of prime numbers out there. I don't know, granted, whether your formula would be useful there or not.

Speaking to the part of your question that is on-topic, however, inventions need to have practical utility to be patentable. "Utility" is, of course, a somewhat subjective term, and it leaves a lot up for interpretations by the patent office and, ultimately, courts. But speaking as broadly as I may through a format such as this, it would be difficult to argue a theoretical mathematical formula as innately having real-world applicability. You'd likely have more luck digging for an implementation of that formula, then somehow patenting the use of that formula to achieve that practice.

There's an interesting grey-area in one, reported in a story in the New York Times, where a financial formula was deemed as having direct real-world applications because a court found it to directly make money. It's, unfortunately, unlikely that your pure-math formula would find a similar conclusion.

As far as cross-applicability over platforms is concerned, that's another interesting question. That depends a bit on how the patent is phrased. I suspect you'd be able to get something, as long as you could overcome the inherent struggle of patenting a formula like this.

Your best bet, rather unsurprisingly, would be to speak with a patent professional about your specific invention and its uses, then go from there. Many such professionals offer fairly cheap (or even free) initial consultations, where you could get a very good idea of what options you may have.

On a side note, and I know Pushpak mentioned this in comments, it is extremely important that you don't disclose your invention publicly prior to speaking with a patent professional and filing an application. In the United States, you're lucky enough to be given a one-year grace period from the time of public disclosure to the time of filing, but even in light of that, you're giving up some rights, including the ability to file elsewhere.


All depends where in the world you lurk. Ignoring the originality of your idea, algorithms are only patentable in a very small number of jurisdictions.

If not patentable you could investigate whether you could copyright the algorithm, again this will depend on territory, as the WIPO treaty (1996) explicitly excluded "mathematical concepts" from copyright. But some jurisdictions offer some protection eg. Ibcos Computers Ltd -v- Barclays Mercantile Highland Finance Ltd; ChD 1994

If neither of these cover you you may, again depending on territory, go down the trade secret / confidence route, assuming your algorithm is still a secret. You'll simply need to ensure anyone you reveal your algorithm to has first signed a nondisclosure agreement.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .