<div><br></div>There's a totient function based on knowing the prime factors of n.<div><br></div><div>Line 13 on this page: <a href="http://mathworld.wolfram.com/TotientFunction.html">http://mathworld.wolfram.com/TotientFunction.html</a></div>
<div><br></div><div>The one I use in beginning Python is just </div><div><br></div><div>len([num for num in range(1,n) if gcd(num, n)==1 ] # count strangers to n</div><div><br></div><div>... where gcd is Guido's four liner.</div>
<div><br></div><div>I'm sure the latter is way too slow and brutish for Euler Project esoterica.</div><div><br></div><div>I confess to a knee-jerk reaction against a 3rd and 2nd power being described as cube and square respectively, as much good sense as this customarily makes in Earthling Math.</div>
<div><br></div><div>I've been groomed to have odd biases.</div><div><br></div><div>Kirby</div><div><br><br><div class="gmail_quote">On Sat, Jun 11, 2011 at 11:50 AM, Gregor Lingl <span dir="ltr"><<a href="mailto:gregor.lingl@aon.at">gregor.lingl@aon.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
Am 11.06.2011 19:54, schrieb kirby urner:
<blockquote type="cite"><div class="im">
<div><br>
</div>
I've been looking these over since reading your post. I'd heard
of this project but this was my first time to really check it out.
<div><br>
</div></div>
...
<div class="im"><div><br>
</div>
<div>Thanks for these links. Python should be fast enough to get
within the one minute time frame one would think, at least on
some of them.</div>
</div></blockquote>
It is definitely! I got a solution to problem 341, that needed less
the 15 seconds.<br>
I've no solution to 342 yet. As "your" Euler totient is the central
point of the problem, I thought this is your thing - and you can't
help to solve it ;-)<br>
<br>
Best wishes<br>
Gregor<br>
<blockquote type="cite"><div class="im">
<div><br>
</div>
<div>Kirby</div>
<div><br>
</div>
<div><br>
<div class="gmail_quote">
On Sat, Jun 11, 2011 at 9:26 AM, Gregor Lingl <span dir="ltr"><<a href="mailto:gregor.lingl@aon.at" target="_blank">gregor.lingl@aon.at</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
A very interesting collection of exercises you can find on<br>
<br>
<a href="http://projecteuler.net/" target="_blank">http://projecteuler.net/</a><br>
<br>
Especially the problems below 100 are well suited for
beginners.<br>
<br>
<a href="http://projecteuler.net/index.php?section=problems" target="_blank">http://projecteuler.net/index.php?section=problems</a><br>
<br>
This week's problem, on the contrary, seems to be customized
for Kirby!<br>
<br>
<a href="http://projecteuler.net/index.php?section=problems&id=342" target="_blank">http://projecteuler.net/index.php?section=problems&id=342</a><br>
<br>
Best regards,<br>
Gregor<br>
</blockquote>
</div>
</div>
</div><pre><fieldset></fieldset>
_______________________________________________
Edu-sig mailing list
<div class="im"><a href="mailto:Edu-sig@python.org" target="_blank">Edu-sig@python.org</a>
<a href="http://mail.python.org/mailman/listinfo/edu-sig" target="_blank">http://mail.python.org/mailman/listinfo/edu-sig</a>
</div></pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Edu-sig mailing list<br>
<a href="mailto:Edu-sig@python.org">Edu-sig@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/edu-sig" target="_blank">http://mail.python.org/mailman/listinfo/edu-sig</a><br>
<br></blockquote></div><br></div>