Find integer values of p such that $(2^p - (2^2)(3^2))/ (3^3)$ is an integer

Find integer values of p such that $(2^p - (2^2)(3^2))/ (3^3)$ is an integer.

• Details are crucial. – Artes Sep 5 '13 at 20:55
• Please edit your question to provide a complete definition of $Z$ in Mathematica form. Without this we can not help. – m_goldberg Sep 5 '13 at 22:49
• Is this about Mathematica (the software)? If it is a math question, you should try math.stackexchange.com – Pinguin Dirk Sep 6 '13 at 6:44
• You can edit your question and include some code. E.g. somethig like this finds integer numbers such that $\frac{2^p - 2^2 7^2}{3^3}$ is an integer for $1 \leq p\leq100\quad$: Select[Table[ p, {p, 100}], ((2^# - 2^2 7^2)/3^3) ∈ Integers &]. However if you change 7 -> 3 you won't find any integer. – Artes Sep 6 '13 at 7:49

Even though Mathematica has a broad range of powerful capabilites (see e.g. this comparison of computer algebra systems) in related fields (number theory, quantifier elimination) it sometimes doesn't appear to be clever enough to prove simple theorems, e.g. this should yield False however we get back the input:

Resolve[ Exists[p, p ∈ Integers && Divisible[2^p, 3]], Integers] // TraditionalForm On the other hand there are examples of hard (to prove) theorems which are known to the system, e.g. Fermat's Last Theorem:

Resolve[ Exists[{a, b, c, n}, (a | b | c | n) ∈ Integers
&& a > 0 && b > 0 && c > 0 && n > 2 && a^n + b^n == c^n]]
False

Since it is not very difficult to prove there are no integers p such that (2^p - 2^2 3^2)/3^3 is an integer let's demonstrate an appropriate mathematical proof.

Assume there exist integers $p$ and $k$, such that $$\frac{2^p - 2^2 3^2}{3^3} = k$$ i.e. $$2^p = 27k + 36$$

The right hand side is divisible by $3$ while the left hand side is not. QED.

Some kind of evidence of this result we can get with e.g.:

Select[ Range @ 100000, ((2^# - 2^2 3^2)/3^3) ∈ Integers &]
{}

similarly we could demonstrate that there are no integers p, such that 0 < p < 10^6 satisfying the above relation, while taking e.g. 13 instead of 3 we could easily find adequate natural numbers p <= 100, i.e.:

Select[ Range @ 100, ((2^# - 2^2 13^2)/3^3) ∈ Integers &]
{18, 36, 54, 72, 90}

There are slightly related problems (with $2$ and $3$ in assumptions) which might seem quite easy however they are still open see e.g. Collatz conjecture even though it had been stated many years ago.

We can use Reduce to give us:

expr = (2^p - (2^2) (3^2))/(3^3);

Reduce[{expr == n, n ∈ Integers}, p, Integers]
(n | p) ∈ Integers && n >= -1 && p == Log2[9 (4 + 3 n)]

Since the only x such that Log2[x] ∈ Integers are powers of two, we must have 9 (4 + 3 n) equal a power of two while n is simultaneously an integer. This clearly cannot be done, since 9 (4+3n) is divisible by 3, whereas no power of 2 is divisible by 3.

How you might approach this is going to depend on your function. Here's something to get the discussion rolling. Say the function is

z[m_] := Sqrt[m];

and you wish to know what values of m in the range 1 to 1000 have integer-valued z[m]. Then you can use:

Position[Boole[IntegerQ /@ z[Range[1, 200]]], 1] // Flatten

which gives a list of all the numbers with integer square-roots.

{1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256,
289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961}