Prime as sum of three numbers whose product is a cube Good evening! 
I am very new to this site. I would like to put the following material 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,31,43,73$
$$
\begin{align}
3 = 1 + 1 + 1 &\Longrightarrow 1 \times 1 \times 1 =  1^3\\
7 = 1 + 2 + 4 &\Longrightarrow  1 \times 2 \times 4 = 2^3\\
13 = 1 + 3 + 9 &\Longrightarrow 1 \times 3 \times 9 = 3^3\\
31 = 1 + 5 + 25 &\Longrightarrow 1 \times 5 \times 25 = 5^3\\
43 = 1 + 6 + 36 &\Longrightarrow 1 \times 6 \times 36 = 6^3\\
73 = 1 + 8 + 64 &\Longrightarrow 1 \times 8 \times 64 = 8^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.
edit
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.
 A: 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$.
A: Here is an attempt that doesn't quite work. In this post, $\left( \frac{a}{p} \right)$ is the quadratic residue symbol.
If $\left( \frac{-3}{p} \right) = 1$, then $p$ is of the form $x^2+xy+y^2$.
If $\left( \frac{85}{p} \right) = 1$, then $p$ is either of the form $9 x^2 + 25 xy + 15 y^2$ or $3 x^2 + 25 xy + 45 y^2$.
If $\left( \frac{-255}{p} \right) = 1$, then $p$ is of one of the forms $x^2+xy+64 y^2$, $2 x^2 + xy + 32 y^2$, $4 x^2 + xy + 16 y^2$, $8 x^2 + xy + 8 y^2$, $3 x^2 + 3 xy + 22 y^2$, $5 x^2 + 5 xy + 14 y^2$, $6 x^2 + 3 xy + 11 y^2$ or $7 x^2 + 5 xy + 11 y^2$.
Now, one of the three quadratic residues must be $1$, since $\left( \frac{-255}{p} \right) = \left( \frac{-3}{p} \right)\left( \frac{85}{p} \right)$. And for a lot of the quadratic forms above, we win: $(x^2)(xy)(y^2)$, $(9 x^2)(25 xy)(15 y^2)$, $(3 x^2)(25 xy)(45 y^2)$, $(x^2)(xy)(64 y^2)$, $(2 x^2)(xy)(32 y^2)$, $(4 x^2)(xy)(16 y^2)$ and $(8 x^2)(xy)(8 y^2)$ are all cubes. Unfortunately, the last $4$ quadratic forms of discriminant $-255$ don't work when written in reduced form. I haven't yet done a serious search to see whether some change of basis might put them into the form $a x^2 + bxy + c y^2$, with $abc$ a cube. 
Also, we don't know what the signs of $x$ and $y$ are, so this doesn't necessarily get us three positive integers whose product is a cube. 
Still, I am optimistic that we might be able to find enough quadratic forms of the form $a x^2 + bxy + c y^2$, with $abc=1$, to cover all the primes, at least if we ignore the sign issue.
A: 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) {
  f.WriteLine(txt);
  WScript.Echo(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");
          return;
        }
      }
    }
  }
  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);
f.Close();

A: To add pessimism in finding such prime $p$ that cannot be written as sum of $3$ co-divisors of cube, I've drawn images:
Number of ways to write an integer number $p$ as the sum $x+y+z$, where $x\cdot y\cdot z=c^3$.
($\color{red}{\bf{red}}$ dots $-$ composite numbers, $\bf{black}$ dots $-$ prime numbers)

$$p\le 500$$


$$p\le 5\;000$$


$$p\le 50\;000$$


$$p\le 500\;000$$


$$p\le 5\;000\;000$$


Control points:

$p=486$ (composite): $1$ way: $486 = 162+162+162$;

$p=2048$ (composite): $2$ ways: $2048 = 128+720+1200 = 224+256+1568$;

$p=6656$ (composite): $3$ ways: $\small {6656 = 416+2340+3900 = 512+1536+4608 = 728+832+5096}$;

$p=7559$ (prime): $4$ ways: $\scriptsize{7559 = 9+50+7500 = 114+225+7220 = 135+1024+6400 = 722+2809+4028}$;

$p=26624$ (composite): $5$ ways;

$p=58757$ (prime): $10$ ways;

$p=80429$ (prime): $13$ ways;

$p=111611$ (prime): $15$ ways;

$...$

These images were made in style like here.
(Since I've seen images for Goldbach's conjecture, I lost any hope to find contradiction for it).

Method of search:
to build array $a[3N]$ for storing number of ways;
$a[p]$ is the number of ways to write $p$ as such sum;  (initially, each $a[j]=0$);
for $c = 1 ... N$
$\quad$ create list of prime divisors of $c^3$;
$\quad$ (there is enough to know prime decomposition of $c$)
$\quad$ for each pair $x,y$ of divisors of $c^3$ to find  $z=\dfrac{c^3}{xy}$;
$\quad$ if $z\in\mathbb{Z}$ and if $x\le y\le z$, then increase $a[x+y+z]$.
(if $c>N$, then sum of co-divisors of $c^3$ is greater than $3N$).
A: Kindly notice that I have left out the numbers 4,7 and 9 in this context as for these numbers,even though 1*n*n^2 is a cube,yet 1+n+n^2 is not a prime number.
