Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Good evening! I am very new to this site. I would like to put the following materiel from Prof. Gandhi's note book and my observations. Of course it is little long with more questions. But, with good belief on this site, I am sending for good solutions/answers.

If we take other than primes $2$, $5$ and $11$, every prime can be written as $x + y + z$, where $x$, $y$ and $z$ are some positive numbers. Interestingly, $x \times y \times z = c^3$, where $c$ is again some positive number. Let us see the magic for primes $3$, $7,13,17,\ldots$ $$ \begin{align} 3 = 1 + 1 + 1 &\Longrightarrow 1 \times 1 \times 1 = 1^3\\ 7 = 1 + 2 + 4 &\Longrightarrow 1 \times 2 \times 4 = 8 = 2^3\\ 13 = 1 + 3 + 9 &\Longrightarrow 1 \times 3 \times 9 = 3^3\\ 17 = 1 + 8 + 8 &\Longrightarrow 1 \times 8 \times 8 = 4^3 \end{align} $$ Can you justify the above pattern? How to generalize the above statement either mathematically or by computer?

But, I observed that it is true for primes less than $9500$. Can your provide a computational algorithm to describe this?

Also, prove that, we conjecture that except $1, 2, 3, 5, 6, 7, 11, 13, 14, 15, 17, 22, 23$, every positive number can be written as a sum of four positive numbers and the product is again can be expressible in 4th power. Now, can we generalize this? Also, I want to know that, is there any such numbers can be expressible as some of $n$-integers with their product is again in $n$-th power?

Thank you so much.


Concerning this cubic property :

Notice that this can be extended to hold for almost all squarefree positive integers $> 2$, not just the primes.

for instance : we know for the prime $7$ : $7=1+2+4$ so we also get $7A = 1A + 2A + 4A$ and $1A * 2A * 4A$ is simply equal to $8A^3$.

In fact this can be extended to all odd positive integers $>11$ if $25,121$ have a solution.

Hence I am intrested in this and I placed a bounty.

I edited the question because its to much for a comment and certainly not an answer.

Btw Im curious about this Ghandi person though info about that does not get the bounty naturally.

I would like to remind David Speyer's comment : Every prime that is $1 mod 3$ is of the form $a^ 2 +ab+b^ 2$ , so that covers half the primes immediately.

So that might be a line of attack.


share|improve this question

This question has an open bounty worth +50 reputation from mick ending in 4 days.

This question has not received enough attention.

I think you probably want a "such that" - something like "every prime other than $2$, $5$ or $11$ can be written as $x+y+z$ such that $xyz$ is a cube". Every positive integer greater than $2$ can be written as a sum of three positive integers, so you need some property of this triple to make the statement interesting. –  Matt Pressland Jun 15 '12 at 10:28
A further generalization would be that there is an integer $N_{k, m}$ such that for any prime $p\gt N_{k,m}$, there exist positive $x_1,\dots, x_k$ such that $x_1+\cdots+x_k=p$ and $x_1x_2\cdots x_k$ is a perfect $m$-th power. There is also no real reason to confine attention to primes. –  André Nicolas Jun 18 '12 at 15:39
There is no reason to focus attention on primes. Let's say that $N$ is clean if we can find positive integers $(x,y,z)$ with $x+y+z=N$ and $xyz$ a cube. If $N$ is clean, so is every multiple of $N$. Now, $2^6=7+8+49$, $5^2=3+4+18$ and $11^2=1+45+75$ are all clean. So the conjecture is equivalent to the much more natural conjecture every sufficiently large integer is clean. –  David Speyer Jun 18 '12 at 19:58
We can pull a little more information out. $\gcd(x,y,z) = 1$, otherwise $p$ wouldn't be prime. Let $\displaystyle x=\prod_{i=1}^{j}p_{i}^{a_{i}}$, $\displaystyle y=\prod_{i=1}^{k}p_{i}^{b_{i}}$, and $\displaystyle z=\prod_{i=1}^{l}p_{i}^{c_{i}}$. Let $m=\max(j,k,l)$. Then $\displaystyle xyz=\prod_{i=1}^{m}p_{i}^{a_{i}+b_{i}+c_{i}}$. If $xyz$ is a cube, then for all $1 \le i \le m$, we know that $a_{i}+b_{i}+c_{i} \in 3\mathbb{Z}$. But we also know that $gcd(x,y,z)=1$, so either $a_{i}=0$, $b_{i}=0$, or $c_{i}=0$. Suppose $c_{i}=0$. Then $a_{i}+b_{i} \in 3\mathbb{Z}$, so $(a_{i},b_{i})$ is in –  Jackson Walters Jun 18 '12 at 21:33
Every prime that is $1 \mod 3$ is of the form $a^2+ab+b^2$, so that covers half the primes immediately. –  David Speyer Jun 18 '12 at 22:15

2 Answers 2

I wrote a small script in MATLAB and verified your claim for all the primes less than $150,000$. Only $2,5,11$ do not satisfy your claim. For many of the primes, there are multiple ways to write it as a sum of three number such that its product is a cube. My script just looks for the first occurrence of such triplets for each prime.

Here is a .txt file with the "first" set of triplets for primes less than $150,000$.

share|improve this answer
Is it me, or does that link not work? I do have Dropbox, but I cannot access your file. –  TMM Jun 18 '12 at 22:58
@TMM Oops... I have fixed it now. Can you kindly let me know if you can access the file now? –  user17762 Jun 18 '12 at 23:06
Thanks, yes it works now. –  TMM Jun 18 '12 at 23:12
I wrote some Mathematica code to compute the number of triples satisfying the property for a given $n$, with the following caveat. Suppose $(x,y,z)$ is a 3-tuple satisfying the property. Any permutation of $(x,y,z)$ also satisfies the property. Say $(x,y,z) \sim (x',y',z')$ if $(x',y',z')$ is a permutation of $(x,y,z)$. Then let $T_{n}$ be the number of such equivalence classes. Here's a plot of $T_{n}$ for $1 \le n \le 200$. Note: There are no solutions for $n= 44$ or $176$. picasaweb.google.com/lh/photo/… –  Jackson Walters Jun 19 '12 at 20:38
Notice that $176$ is a multiple of $44$ ! –  mick Aug 16 at 22:18

I wrote the following JavaScript which is designed to run in Windows Script host:

  • isprime(n) - determine whether a number is prime via brute force method
  • showmagic(f, txt) - writes a line to both screen and text file
  • findmagic(f, n) - detects and writes the magic for a given prime
  • main - tests the first 500 numbers

Save the script to a JavaScript file, say magic.js and invoke cscript magic.js from the command prompt to execute the script using the console version of the Windows Script Host. Because it's written in JavaScript, the script gets exponentially slower to run if you set it to test the first 10000 numbers.

function isprime(n) {
  if (n < 2) return false;
  for (var i=2; i*i<=n; i++)
    if (n % i === 0) return false;
  return true;

function showmagic(f, txt) {

function findmagic(f, n) {
  for (var i=1; i<=n-2; i++) {
    for (var j=1; j<=n-1-i; j++) {
      var k=n-i-j;
      var c3=i*j*k;
      for (var c=1; c*c*c<=c3; c++) {
        if (c*c*c === c3) {
          showmagic(f, n + "=" + i + "+" + j + "+" + k + " ; " + i + "*" + j + "*" + k + "=" + c + "^3");
  showmagic(f, n + "=no magic");

var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.CreateTextFile("magic.txt", true);
for (var n=1; n<=500; n++)
  if (isprime(n))
    findmagic(f, n);
share|improve this answer
Does this add anything over the two-year-old answer which provides the results of such a calculation for the first 13K or so primes? The other answer doesn't show its code, but this is a very straightforward approach (and inefficient in a few spots - your method for finding out whether c3 is a cube is much slower than it could be). –  Steven Stadnicki 18 hours ago

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.