mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2023-09-16, 05:42   #12
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
San Diego, Calif.

2×3×1,733 Posts
Default

That was a good one!

Meanwhile, In Soviet Russia, 1 is defined as 0^0 by Supreme Leader.

In Soviet Russia, no one knows the truth before Putin blurts a few words on the subject.
Then it becomes the truth and everyone is required by law to repeat it.
Those who don't get 10, 15, 25 years in prison.
Batalov is offline   Reply With Quote
Old 2023-09-16, 05:45   #13
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

2×5,179 Posts
Default

Leading zeros don't count.
LaurV is offline   Reply With Quote
Old 2023-09-16, 10:56   #14
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

23·857 Posts
Default

For those that don't like using 00, here is a solution for a longer version:
Code:
r=range(10)
for a in r:
 for b in r:
  for c in r:
   for d in r:
    for e in r:
     for f in r:
      if a*100000+b*10000+c*1000+d*100+e*10+f==a**b+c**d+e**f:print(a,b,c,d,e,f)
Outputs
Code:
0 0 0 0 0 2
0 1 7 5 3 6
The first answer relies upon 00 being defined, but the second answer doesn't.
retina is online now   Reply With Quote
Old 2023-09-16, 14:39   #15
Dr Sardonicus
 
Dr Sardonicus's Avatar
 
Feb 2017
Nowhere

650910 Posts
Default

Quote:
Originally Posted by retina View Post
For those that don't like using 00, here is a solution for a longer version:
Code:
r=range(10)
for a in r:
 for b in r:
  for c in r:
   for d in r:
    for e in r:
     for f in r:
      if a*100000+b*10000+c*1000+d*100+e*10+f==a**b+c**d+e**f:print(a,b,c,d,e,f)
Outputs
Code:
0 0 0 0 0 2
0 1 7 5 3 6
The first answer relies upon 00 being defined, but the second answer doesn't.
Purportedly n-digit numbers with leading zeroes are phony baloney.

Your additive problem has no solutions with more than 10 digits, because k*9^9 < 10^(2*k - 1) for k > 5.
Dr Sardonicus is offline   Reply With Quote
Old 2023-09-16, 21:59   #16
uau
 
Jan 2017

101011102 Posts
Default

Quote:
Originally Posted by Dr Sardonicus View Post
Purportedly n-digit numbers with leading zeroes are phony baloney.

Your additive problem has no solutions with more than 10 digits, because k*9^9 < 10^(2*k - 1) for k > 5.
I checked that it has no 8 or 10 digit solutions without at least two leading zeroes.
uau is offline   Reply With Quote
Old 2023-09-16, 22:37   #17
uau
 
Jan 2017

2·3·29 Posts
Default

I also checked for 10 digit sums with close misses - closest was 40357946 (that's 8 digits with an error of 1, found as 10 digits with an error of 2, with one more from an extra +0^0).
uau is offline   Reply With Quote
Old 2023-09-16, 23:50   #18
HermannSW
 
HermannSW's Avatar
 
"H. Stamm-Wilbrandt"
Jul 2023
Eberbach/Germany

22·11 Posts
Default

Back to original problem:
Quote:
Originally Posted by HermannSW View Post
Here is the 75 character version, no guarantee that it is shortest possible (thanks, I learned about "spoiler" tag from you):
Code:
? forvec(v=vector(4,x,[0,9]),if(fromdigits(v)==v[1]^v[2]*v[3]^v[4],print(v)))
[2, 5, 9, 2]
?
"fromdigits()" is just too long.
Instead of forvec use for loop.
And convert number with "digits()" and multi assign.
Result is 60 character PARI/GP one-liner:
Code:
$ gp -q
? for(i=1000,9999,[a,b,c,d]=digits(i);if(a^b*c^d==i,print(i)))
2592
?
40 years ago at school where I learned about this puzzle, I lived in German town with dialing code 02592 ...
HermannSW is offline   Reply With Quote
Old 2023-09-17, 03:12   #19
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
San Diego, Calif.

1039810 Posts
Default

Quote:
Originally Posted by HermannSW View Post
"fromdigits()" is just too long.
Instead of forvec use for loop.
And convert number with "digits()" and multi assign.
Premature optimization is the \sqrt {all \ evil}
Batalov is offline   Reply With Quote
Old 2023-09-17, 12:48   #20
HermannSW
 
HermannSW's Avatar
 
"H. Stamm-Wilbrandt"
Jul 2023
Eberbach/Germany

22×11 Posts
Default

While I agree with you in general, I don't see how your statement applies to my previous post.
Only smartphone with me currently, but PariDroid runtime reported is 0ms, see attachment.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20230917-144130~2.png
Views:	28
Size:	37.2 KB
ID:	28986  
HermannSW is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Kaprekar's constants and cycles of the Kaprekar mapping of 9-digit to 12-digit numbe in base 12 sweety439 sweety439 0 2020-02-11 03:12
About Psieve results and ABCD files Retep Riesel Prime Search 8 2013-10-31 11:35
Chance to find an n-digit factor with ECM RedGolpe Factoring 4 2007-03-23 15:24
how do you find number of digits of a 2^n number? Unregistered Math 11 2004-11-30 22:53
10,000,000 digit number Unregistered Software 3 2004-03-03 19:20

All times are UTC. The time now is 10:47.


Sun Sep 24 10:47:43 UTC 2023 up 11 days, 8:30, 0 users, load averages: 1.04, 1.14, 1.00

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.

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