Squared Digit Sum
johndcook.com
johndcook.com
Let f(n) be the sum the squares of digits of n.
For k-digit number: f(n) ≤ 81k.
That is: f(n) ≤ 81 × (1 + ⌊log₁₀n⌋)
It's pretty clear that if n≥1000, f(n) < n. So the n, f(n), f(f(n)), ... sequence will eventually reach a number below 1000.
Mechanical proof for numbers below 1000 is in the article.
And this is what makes the setup not very interesting. Compare with 3x+1 problem, where the sequence can grow, but eventually comes down (there's a simple probabilistic argument for that, but no formal proof).
Now, one can ask question such as:
- for which (number base, power) pairs is that cycle unique?
- for which (number base, power) pairs is that cycle shortest? (For example, 153 = 1³ + 5³ + 3³, so if (base 10, power 3) has only one such cycle, it has length 1. Similarly, 4150 = 4^⁵ + 1^⁵ + 5^⁵ + 0^⁵ could be the unique cycle of length 1 for base 10, power 5.
- what does the function f(base, power) look like?
Service Unavailable
Guru Meditation:
XID: 363037244
Varnish cache server
The part that is hard to really convey is just the fun of it. Being able to run a log dive to grab some data using standard grep/whatever, then to immediately pull it into either R or Python or just Gnuplot to get a visual is quite a nice trick. Top it off with a quick export to pdf/html/markdown to send to someone to confirm it. (Typically a stakeholder.)
Add to this emacs TRAMP capabilities and I just need whatever tool I want on a machine I can ssh to. Don't have a good install of python locally for some reason, just set the :dir attribute of the block to my machine (or docker container. Or a series of jumps through combinations!) that has it, and I'm good.
It does have some growing pains sometimes. I found that the SQL plugin didn't do the passwords as I wanted it to. But, that was a simple breakpoint and hot code fix away. (I, regretably, did not prepare a patch to send upstream...)
Main advice I have, that I don't think I really followed, make time. Literally pick some time to do something you were going to do anyway, but that you aren't in a rush to do. Preferably not on any critical path. It will be slower.
The problem with spacemacs as a beginner is it isn't quite emacs, and it isn't quite vim, and as a beginner you don't know how to translate vim and Emacs guides to spacemacs.