mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2022-11-12, 00:48   #1
raresaturn
 
raresaturn's Avatar
 
Jul 2021

1001102 Posts
Question Prime 'anagrams'

Take a prime number and rearrange the digits to get another prime number. This is difficult for small numbers, but gets easier as the primes get larger. Therefore the question becomes: What is that largest prime that has no anagrams? ie. no other primes can be made by reordering it's digits. It might seem trivial for a number like 22222222222222221 to make the last digit even, but is such a number prime in the first place? (I haven't checked this example LOL)

I wrote a little Python script to check these, so far the largest I've found with zero anagrams is 33343 (it's a slow program )

Can anyone find larger ones?
raresaturn is offline   Reply With Quote
Old 2022-11-12, 02:17   #2
axn
 
axn's Avatar
 
Jun 2003

22·32·151 Posts
Default

99949999 appears to be the largest 8-digit one
axn is offline   Reply With Quote
Old 2022-11-12, 02:27   #3
raresaturn
 
raresaturn's Avatar
 
Jul 2021

2×19 Posts
Default

Quote:
Originally Posted by axn View Post
99949999 appears to be the largest 8-digit one
Cool, how did you find that one?
raresaturn is offline   Reply With Quote
Old 2022-11-12, 02:30   #4
axn
 
axn's Avatar
 
Jun 2003

22·32·151 Posts
Default

List of near-repdigit primes/PRPs (https://stdkmd.net/nrr/prime/primesize.txt) might be a good place to look
axn is offline   Reply With Quote
Old 2022-11-12, 02:35   #5
axn
 
axn's Avatar
 
Jun 2003

22·32·151 Posts
Default

Quote:
Originally Posted by raresaturn View Post
Cool, how did you find that one?
Not by looking at all the anagrams for a prime, for sure

I looped thru all primes < 10^8, converted them into a "canonical" form and checked if that has been seen before. Any canonical form seen only once means, it has no anagrams. Of course, you get to know that only after entire range of n-digit primes have been scanned.
axn is offline   Reply With Quote
Old 2022-11-12, 03:01   #6
raresaturn
 
raresaturn's Avatar
 
Jul 2021

2·19 Posts
Default

Quote:
Originally Posted by axn View Post
Not by looking at all the anagrams for a prime, for sure
I de-duped my lists, so having all the same digits doesn't really count (or at least not in the spirit of the task )
EDIT: i think i responded the the wrong msg, no matter

Last fiddled with by raresaturn on 2022-11-12 at 03:02
raresaturn is offline   Reply With Quote
Old 2022-11-12, 04:17   #7
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

2·17·101 Posts
Default

As you pointed out any prime with all even numbers or 5's and just the last digit 1,3,7 or 9 are trivial candidates for this.

Non-trivial ones:
Largest below 106: 999499
Largest below 107: 9999991
Largest below 108: 99949999
Largest below 109: 999499999

There are "only" 350 of them from 11 to 109 including the trivial ones.
Count of them including trivials starting from 11:
101 - 102: 13
102 - 103: 34
103 - 104: 45
104 - 105: 68
105 - 106: 67
106 - 107: 47
107 - 108: 36
108 - 109: 40
ATH is online now   Reply With Quote
Old 2022-11-12, 05:22   #8
raresaturn
 
raresaturn's Avatar
 
Jul 2021

2×19 Posts
Default

Quote:
Originally Posted by ATH View Post
As you pointed out any prime with all even numbers or 5's and just the last digit 1,3,7 or 9 are trivial candidates for this.

Non-trivial ones:
Largest below 106: 999499
Largest below 107: 9999991
Largest below 108: 99949999
Largest below 109: 999499999
That's really interesting...I wonder if we can just keep adding 9's to the end eg: 99949999999999999999999999999 (and will it always be a prime?)

Last fiddled with by raresaturn on 2022-11-12 at 05:27
raresaturn is offline   Reply With Quote
Old 2022-11-12, 10:09   #9
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

240418 Posts
Default

Nope.
LaurV is offline   Reply With Quote
Old 2022-11-12, 11:41   #10
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

17·433 Posts
Default

Quote:
Originally Posted by raresaturn View Post
It might seem trivial for a number like 22222222222222221 to make the last digit even, but is such a number prime in the first place? (I haven't checked this example LOL)
22222 222222 222221 = 3 × 23 × 211 × 239851 × 6 363769 per https://www.alpertron.com.ar/ECM.HTM
Trimming away a 2 at a time, I didn't encounter a prime until 2221.
kriesel is offline   Reply With Quote
Old 2022-11-12, 13:29   #11
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dartmouth NS

2×3×23×61 Posts
Default

Code:
forperm(digits(randomprime(10^9)),x,print(x))
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prime residues of near-prime modulo a prime robert44444uk Math 27 2021-11-21 11:00
Congruent prime numbers that preserves the modulo as the largest prime factor of the sum Hugo1177 Miscellaneous Math 5 2021-02-11 07:40
Primes of the form prime(a)+prime(b)+1=prime(c) and prime(b)-prime(a)-1=prime (c) Hugo1177 Miscellaneous Math 1 2021-01-05 08:09
Anagrams storm5510 Puzzles 61 2009-11-20 04:53
Anagrams using GMPlib Batalov Lounge 16 2008-06-16 23:52

All times are UTC. The time now is 12:05.


Sun Jan 29 12:05:25 UTC 2023 up 164 days, 9:33, 0 users, load averages: 1.06, 0.91, 0.98

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔