Back to General discussions forum
The '2' in the problem title is there simply because there is already a "Weighted Sum of Digits" problem on the site. This one is quite different from the previous one and is not intended to be an extension of it.
Thank you! 'Special Digits 2' would also have worked. :)
Well, "weighted" probably is somewhat misleading (perhaps intentionally) in here as weights do not depend on anything rather digit value itself (so it is more like mapping or encoding?) - but it seems all right :)
I'm ashamed to say I still can't find a key, though initially I thought this one is simpler than other Clive's puzzles
(obviously missing the fact that as W
s are summed plainly, without modulo, they make a problem). It is somewhat
relieving though to see that only Mathias was able to crack it yet. Though I'll consider his brief note as a vague hint
and shall try attack this for some more time...
As CodeAbbey includes an educational element, I sometimes feel it would be beneficial to share general ideas how a problem can be approached. Of course without giving the full solution away. I indeed included a small hint earlier - this problem and 'Special Digits' share a number of similarities. Clive, if ok with you, and only then, I would like to add some general observations here.
Apologies for the incorrect use of terminology. As I get older I am increasingly using the wrong words for things. Unfortunately, I rarely spot this myself but have to rely on other people to point it out. As Rodion says, the problem description is of a mapping rather than a weighted sum of digits. There was certainly no intention to mislead and I hope that the problem was still sufficiently clear, even with the wrong terminology.
Mathias has referred to the "Special Digits" problem so I looked this up and found, not surprisingly, that it is one of mine. I forget things very easily these days so had completely forgotten about creating it. Reading the problem description did bring some things back but I couldn't remember my solution. Rather than look at the stored solution, I decided to start again from scratch. It didn't take long to come up with the essential elements of a solution (in my head), presumably because I had solved it previously. I then read through the description of "Weighted Sum of Digits 2" and soon saw the similarities in the method of solution that Mathias has referred to. This possibly explains why he was able to solve it so soon after its publication. Although I agree with the similarities, I think that there is sufficient difference between the two problems for them to be considered as separate problems.
Mathias, I am confident in your judgement of being able to provide some general observations, without revealing the full solution. Please feel free to do this with this problem and for any of the other problems that I have created, or will create in the future.
Hi,
Despite their similarities, the two problems are most definitely different. Below are a number of points on how one might think about approaching the latest problem:
n1
to n2
, could one simplify to ranges from 0
to n
?W(n)
can only take a small number of distinct values. Could one transform the problem to counting how often these values appear in a range?Dear Clive, no need for any excuses! I naturally thought the puzzle name is a part of a puzzle! As about remembering the problems - I suspect it is not the question of memory but of quantity, as you authored that many of them already!
Thanks to Mathias for hints. It is obvious one needs to be on some level of understanding to digest them though :) And honestly, I won't for my life see similarities between these two puzzles!
No 1
of hints is the only bright thought with which I quickly come up with myself (most probably taught by some previous
puzzle by Mathias) - but others still need heavy mind work. Thanks, I'll try!