[seqfan] Fwd: Re: Balanced / Unbalanced numbers

Éric Angelini bk263401 at skynet.be
Sun Dec 9 19:41:52 CET 2018

```Hello Doug,
> Probably makes more sense to figure out
> the digit difference we need to make up
> and build candidates directly.

... Yes, this is the path I wanted to follow too
[but only in a couple of days as I'm busy on
something else (called work!)]

Thank you for the correction on the "2" pyramid!
(and yes, Neil is right -- if you have the choice
between two Balanced, take the smallest one)
Best,
É.

> ---------- Message d'origine ----------
> De : "D. S. McNeil" <dsm054 at gmail.com>
> À :  Sequence Fanatics Discussion list <seqfan at list.seqfan.eu>
> Date : 9 décembre 2018 à 17:58
> Sujet : [seqfan] Re: Balanced / Unbalanced numbers
>
> I think the path for 2 diverges a little from that because of a value being
> off by one in step 13:
>
> step #1: 2 + 112 = 114 false
> step #2: 114 + 112 = 226 false
> step #3: 226 + 211 = 437 false
> step #4: 437 + 431 = 868 false
> step #5: 868 + 871 = 1739 false
> step #6: 1739 + 1744 = 3483 false
> step #7: 3483 + 3489 = 6972 false
> step #8: 6972 + 6963 = 13935 false
> step #9: 13935 + 14003 = 27938 false
> step #10: 27938 + 27968 = 55906 false
> step #11: 55906 + 55820 = 111726 false
> step #12: 111726 + 111728 = 223454 false
> step #13: 223454 + 223450 = 446904 false
> step #14: 446904 + 446905 = 893809 false
> step #15: 893809 + 893813 = 1787622 false
> step #16: 1787622 + 1787621 = 3575243 false
> step #17: 3575243 + 3575488 = 7150731 false
> step #18: 7150731 + 7150681 = 14301412 false
> step #19: 14301412 + 14301403 = 28602815 false
> step #20: 28602815 + 28602909 = 57205724 false
> step #21: 57205724 + 57205818 = 114411542 false
> step #22: 114411542 + 114411543 = 228823085 false
> step #23: 228823085 + 228823199 = 457646284 false
> step #24: 457646284 + 457646291 = 915292575 false
> step #25: 915292575 + 915292488 = 1830585063 false
> step #26: 1830585063 + 1830585101 = 3661170164 false
> step #27: 3661170164 + 3661170165 = 7322340329 false
> step #28: 7322340329 + 7322340326 = 14644680655 false
> step #29: 14644680655 + 14644679920 = 29289360575 false
> step #30: 29289360575 + 29289360580 = 58578721155 false
> step #31: 58578721155 + 58578721162 = 117157442317 false
> step #32: 117157442317 + 117157442282 = 234314884599 true
>
> but we find a balanced number in the end.
>
> I'm going to have to teach my find_nearest_balanced function to be smarter,
> though.  Brute force searching on each side doesn't cut it for 12, where we
> hit 1037708753757778746280242 on the road and the buildup of odd numbers on
> the left finally causes a problem.  Probably makes more sense to figure out
> the digit difference we need to make up and build candidates directly.
>
> E.g. just by looking at the distance we need to cover I know
> that 1037708753757778811488888 is balanced and (relatively) nearby,
> although I didn't check to see if it had the minimal distance, and since I
> was just keyboard mashing it probably doesn't. :-)
>
>
> Doug
>
> --
> Seqfan Mailing list - http://list.seqfan.eu/

```