Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7779 > unrolled thread
| Started by | Ralph Dratman <ralph.dratman@gmail.com> |
|---|---|
| First post | 2012-01-13 09:55 +0000 |
| Last post | 2012-01-14 08:00 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Solve stuck at 243 Ralph Dratman <ralph.dratman@gmail.com> - 2012-01-13 09:55 +0000
Re: Solve stuck at 243 Peter Pein <petsie@dordos.net> - 2012-01-14 08:00 +0000
| From | Ralph Dratman <ralph.dratman@gmail.com> |
|---|---|
| Date | 2012-01-13 09:55 +0000 |
| Subject | Solve stuck at 243 |
| Message-ID | <jeov23$g5o$1@smc.vnet.net> |
Project Euclid asks, "What is the smallest odd composite
that cannot be written as the sum of a prime and twice a
square?"
I tried the following equation, not really expecting it to
work:
oddComposite == Prime[m] + 2 k^2
Surprisingly, the above actually does work for all the odd
composite numbers through 237.
solveInstance[oddComposite_] := Solve[{oddComposite ==
Prime[m] + 2*k^2, k > 0, m > 0}, {k, m}, Integers];
For[i = 9, i < 300, i = i + 2,
If[Not[PrimeQ[i]], Print[i,": ", solveInstance[i]]]]
9: {{k->1,m->4}}
15: {{k->1,m->6},{k->2,m->4}}
21: {{k->1,m->8},{k->2,m->6},{k->3,m->2}}
25: {{k->1,m->9},{k->2,m->7},{k->3,m->4}}
27: {{k->2,m->8}}
33: {{k->1,m->11}}
35: {{k->3,m->7},{k->4,m->2}}
39: {{k->1,m->12},{k->2,m->11},{k->4,m->4}}
45: {{k->1,m->14},{k->2,m->12},{k->4,m->6}}
49: {{k->1,m->15},{k->2,m->13},{k->3,m->11},{k->4,m->7}}
51: {{k->2,m->14},{k->4,m->8}}
- - - - - - snip - - - - - -
217: {{k->3,m->46},{k->5,m->39},{k->8,m->24},{k->10,m->7}}
219: {{k->2,m->47},{k->10,m->8}}
221: {{k->6,m->35},{k->9,m->17}}
225: {{k->1,m->48},{k->4,m->44},{k->7,m->31},{k->8,m->25}}
231:
{{k->1,m->50},{k->2,m->48},{k->4,m->46},{k->5,m->42},{k->8,m
->27},{k->10,m->11}}
235:
{{k->1,m->51},{k->2,m->49},{k->6,m->38},{k->7,m->33},{k->8,m
->28},{k->9,m->21}}
237: {{k->2,m->50},{k->7,m->34},{k->8,m->29},{k->10,m->12}}
- - - - - - but then, at 243, something changes - - - - -
243: {{k->1,m->53},{k->4,m->47},{k->5,m->44},{k->10,m->14}}
Solve::nsmet: This system cannot be solved with the methods
available to Solve. >>
245: Solve[{245==2 k^2+Prime[m],k>0,m>0},{k,m},Integers]
Solve::nsmet: This system cannot be solved with the methods
available to Solve. >>
247: Solve[{247==2 k^2+Prime[m],k>0,m>0},{k,m},Integers]
Solve::nsmet: This system cannot be solved with the methods
available to Solve. >>
... and so on. Strange.
Does anyone know why such a threshold might appear?
Thank you.
Ralph Dratman
[toc] | [next] | [standalone]
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Date | 2012-01-14 08:00 +0000 |
| Message-ID | <jercm0$1dd$1@smc.vnet.net> |
| In reply to | #7779 |
Am 13.01.2012 10:55, schrieb Ralph Dratman:
> Project Euclid asks, "What is the smallest odd composite
> that cannot be written as the sum of a prime and twice a
> square?"
>
> I tried the following equation, not really expecting it to
> work:
>
> oddComposite == Prime[m] + 2 k^2
>
> Surprisingly, the above actually does work for all the odd
> composite numbers through 237.
>
> solveInstance[oddComposite_] := Solve[{oddComposite ==
> Prime[m] + 2*k^2, k> 0, m> 0}, {k, m}, Integers];
> For[i = 9, i< 300, i = i + 2,
> If[Not[PrimeQ[i]], Print[i,": ", solveInstance[i]]]]
>
> 9: {{k->1,m->4}}
> 15: {{k->1,m->6},{k->2,m->4}}
> 21: {{k->1,m->8},{k->2,m->6},{k->3,m->2}}
> 25: {{k->1,m->9},{k->2,m->7},{k->3,m->4}}
> 27: {{k->2,m->8}}
> 33: {{k->1,m->11}}
> 35: {{k->3,m->7},{k->4,m->2}}
> 39: {{k->1,m->12},{k->2,m->11},{k->4,m->4}}
> 45: {{k->1,m->14},{k->2,m->12},{k->4,m->6}}
> 49: {{k->1,m->15},{k->2,m->13},{k->3,m->11},{k->4,m->7}}
> 51: {{k->2,m->14},{k->4,m->8}}
>
> - - - - - - snip - - - - - -
>
> 217: {{k->3,m->46},{k->5,m->39},{k->8,m->24},{k->10,m->7}}
> 219: {{k->2,m->47},{k->10,m->8}}
> 221: {{k->6,m->35},{k->9,m->17}}
> 225: {{k->1,m->48},{k->4,m->44},{k->7,m->31},{k->8,m->25}}
> 231:
> {{k->1,m->50},{k->2,m->48},{k->4,m->46},{k->5,m->42},{k->8,m
> ->27},{k->10,m->11}}
> 235:
> {{k->1,m->51},{k->2,m->49},{k->6,m->38},{k->7,m->33},{k->8,m
> ->28},{k->9,m->21}}
> 237: {{k->2,m->50},{k->7,m->34},{k->8,m->29},{k->10,m->12}}
>
> - - - - - - but then, at 243, something changes - - - - -
>
> 243: {{k->1,m->53},{k->4,m->47},{k->5,m->44},{k->10,m->14}}
> Solve::nsmet: This system cannot be solved with the methods
> available to Solve.>>
>
> 245: Solve[{245==2 k^2+Prime[m],k>0,m>0},{k,m},Integers]
> Solve::nsmet: This system cannot be solved with the methods
> available to Solve.>>
>
> 247: Solve[{247==2 k^2+Prime[m],k>0,m>0},{k,m},Integers]
> Solve::nsmet: This system cannot be solved with the methods
> available to Solve.>>
>
> .... and so on. Strange.
>
> Does anyone know why such a threshold might appear?
>
> Thank you.
>
> Ralph Dratman
>
Hi Ralph,
I guess there are too many possibilities to check. Narrow the ranges
for k and m:
solveInstance[oddComposite_] :=
Solve[{oddComposite == Prime[m] + 2*k^2,
Sqrt[oddComposite - 2] >= k >= 1,
PrimePi[oddComposite - 2] >= m >= 1},
{k, m}, Integers];
_After_ solving the puzzle, have a look at http://oeis.org/A060003 .
Peter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web