<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Primes on Python Exercises</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/tags/primes/</link><description>Recent content in Primes on Python Exercises</description><generator>Hugo</generator><language>fa-ir</language><lastBuildDate>Sat, 06 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://amirmahdikahdouii.github.io/Python-Exercises/tags/primes/index.xml" rel="self" type="application/rss+xml"/><item><title>اعداد اول دایره‌ای در بازه</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/056-circular-primes-range/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/056-circular-primes-range/</guid><description>&lt;p&gt;&lt;strong&gt;#056&lt;/strong&gt; · &lt;strong&gt;Circular Primes in Range&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/056-circular-primes-range/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="circular-prime-2"&gt;Circular prime-2&lt;/h1&gt;
&lt;p&gt;برنامه ای بنویسید که دو عدد را از ورودی دریافت کند و اعداد circular prime بین این دو عدد را برگرداند.&lt;/p&gt;
&lt;p&gt;عدد circular prime عددی است که با هر جابه جایی ارقامش، باز عددی اول باشد.&lt;/p&gt;
&lt;h2 id="input"&gt;Input:&lt;/h2&gt;
&lt;p&gt;در تنها خط ورودی دو عدد به شما داده میشود که با فاصله از هم جدا شده اند.
تضمین میشود اعداد صحیح و نامنفی هستند و عدد اول از عدد بعدی کوچک تر است.&lt;/p&gt;</description></item><item><title>اعداد اول دایره‌ای زیر یک میلیون</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/017-circular-primes-below-million/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/017-circular-primes-below-million/</guid><description>&lt;p&gt;&lt;strong&gt;#017&lt;/strong&gt; · &lt;strong&gt;Circular Primes Below Million&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/017-circular-primes-below-million/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
The Number 197, is called a circular prime because all rotations of the digits: (197, 971, 719), are Themselves Prime.
There are Thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97
How many circular primes are tehre below one milion? 1,000,000
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>اول بودن با O(√n)</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/060-prime-check-sqrt/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/060-prime-check-sqrt/</guid><description>&lt;p&gt;&lt;strong&gt;#060&lt;/strong&gt; · &lt;strong&gt;Prime Check O Sqrt N&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/060-prime-check-sqrt/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="اول-بودن-اما-متفاوت"&gt;اول بودن، اما متفاوت&lt;/h1&gt;
&lt;p&gt;توی این برنامه، اول بودن عدد رو با توجه به پیچیدگی زمانی به O(√n) به دست میاریم.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;توجه:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;توی سوالات دیگه، زمانی که از 2 تا نصف عدد رو چک میکردیم، پیچیدگی زمانی الگوریتم ما O(n) بود!&lt;/p&gt;</description></item><item><title>اول بودن در مبنای ۲</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/011-binary-prime-check/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/011-binary-prime-check/</guid><description>&lt;p&gt;&lt;strong&gt;#011&lt;/strong&gt; · &lt;strong&gt;Binary Prime Check&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/011-binary-prime-check/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;برنامه ای بنویسید که عددی را در مبنای 10 دریافت کند و مشخص کند معادل آن در مبنای 2، عدد اول است یا خیر.&lt;/p&gt;
&lt;h1 id="ورودی"&gt;ورودی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در تنها خط ورودی عدد طبیعی n به شما داده میشود.
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="خروجی"&gt;خروجی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در تنها خط خروجی اگر عدد اول بود کاراکتر &amp;#34;Y&amp;#34; و اگر عدد اول نبود کاراکتر &amp;#34;N&amp;#34; را چاپ کنید.
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="ورودی-نمونه-1"&gt;ورودی نمونه 1:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
3
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="خروجی-نمونه-1"&gt;خروجی نمونه 1:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
Y
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="ورودی-نمونه-2"&gt;ورودی نمونه 2:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
10
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="خروجی-نمونه-2"&gt;خروجی نمونه 2:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
N
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>بررسی اول دایره‌ای</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/055-circular-prime-check/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/055-circular-prime-check/</guid><description>&lt;p&gt;&lt;strong&gt;#055&lt;/strong&gt; · &lt;strong&gt;Circular Prime Check&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/055-circular-prime-check/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="circular-prime"&gt;Circular prime&lt;/h1&gt;
&lt;p&gt;برنامه ای بنویسید که چک کند عددی circular prime هست یا خیر.&lt;/p&gt;
&lt;p&gt;عدد circular prime عددی است که با هر جابه جایی ارقامش، باز عددی اول باشد.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Test1 Input:&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;197
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Test1 Output:&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;True
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="توضیح-تست-۱"&gt;توضیح تست ۱&lt;/h3&gt;
&lt;p&gt;عدد 197 به اعداد زیر تبدیل میشود که همه آنها عددی اول هستند.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;197
719
971
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>بررسی عدد اول</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/028-prime-number-check/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/028-prime-number-check/</guid><description>&lt;p&gt;&lt;strong&gt;#028&lt;/strong&gt; · &lt;strong&gt;Prime Number Check&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/028-prime-number-check/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
برنامه ای بنویسید که عددی را از وروردی بخواند و مشص کند عدد وارد شده اول هست یا خیر
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>بزرگترین اول پاندجیجیت</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/021-largest-pandigital-prime/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/021-largest-pandigital-prime/</guid><description>&lt;p&gt;&lt;strong&gt;#021&lt;/strong&gt; · &lt;strong&gt;Largest Pandigital Prime&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;hard&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/021-largest-pandigital-prime/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
We shall say that an n-digit number is pandigital, if it makes use of all the
digits 1 to n exactly once! For Example, 2143 is a 4-digits pandigital and is
also prime!
What is the largest n-digits pandigital prime number exists?
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>بیشترین مجموع ارقام اول</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/009-max-prime-digit-sum/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/009-max-prime-digit-sum/</guid><description>&lt;p&gt;&lt;strong&gt;#009&lt;/strong&gt; · &lt;strong&gt;Max Prime Digit Sum&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/009-max-prime-digit-sum/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;برنامه ای بنویسید که n عدد را بخواند و عددی که بزرگترین مجموع ارقام اول را دارد چاپ کند.&lt;/p&gt;
&lt;h1 id="ورودی"&gt;ورودی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در خط اول ورودی تعداد ورودی ها به شما داده میشود.
در خطوط بعدی به شما اعداد داده میشوند.
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="خروجی"&gt;خروجی:&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
در تنها عدد خروجی، عددی که ارقام اول آن بیشترین مجموع را دارد را چاپ کنید.
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="ورودی-نمونه"&gt;ورودی نمونه:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
3
1375
8962
9973
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="خروجی-نمونه"&gt;خروجی نمونه:&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
1375
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>تعداد اعداد اول n رقمی</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/001-count-n-digit-primes/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/001-count-n-digit-primes/</guid><description>&lt;p&gt;&lt;strong&gt;#001&lt;/strong&gt; · &lt;strong&gt;Count N-Digit Primes&lt;/strong&gt; · &lt;code&gt;math&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/001-count-n-digit-primes/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;استاد پارسا از او خواسته تا تعداد اعداد اول n رقمی را پیدا کند.
پارسا حوصله عملیات جبری روی کاغذ را ندارد و از شما کمک خواسته تا برایش این مسئله را حل کنید.&lt;/p&gt;
&lt;h1 id="ورودی"&gt;ورودی:&lt;/h1&gt;
&lt;p&gt;`
ورودی عددی صحیح n ,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0 &amp;lt; n &amp;lt; 6
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;`&lt;/p&gt;
&lt;h1 id="خروجی"&gt;خروجی:&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;خروجی، یک عدد صحیح است که نمایانگر تعداد اعداد اول n رقمی میباشد.&lt;/code&gt;&lt;/p&gt;</description></item></channel></rss>