Re: [QUIZ] Happy Numbers #93 How happy can you get?



"Rick DeNatale" <rick.denatale@xxxxxxxxx> writes:

On 9/6/06, Daniel Martin <martin@xxxxxxxxxxxx> wrote:
I strongly doubt that this method is the most
efficient way to get to a 9-step number; as a trivial adjustment, the
number

("1" * 24 + "9" * 975).to_i

is also a 9-step number.

I think you lost me on that step.

Sorry; I didn't show all my work.

irb(main):037:0> 78999.divmod(81)
=> [975, 24]
irb(main):038:0> 81 * 975 + 24
=> 78999

However, if 78999 is the smallest 8-step
happy number, the smallest 9-step happy number must have at least
(78999/81.0).ceil digits. Small wonder that you didn't find one...

Efficient or not, it would seem that generating large happy numbers by
construction beats the hell out of trying to find them.

Probably. I'm reasonably certain that it can be shown that the
smallest 9-step number feeds into the smallest 8-step number, but I'm
not certain about that. I'm also a bit unclear on how to generate
them by construction in an efficient manner to make sure I get them
all. (consider that adding a 0 anywhere in a n-step happy number makes
another n-step happy number; this adds wrinkles I don't want to think
about)

However, if I had hit on the idea of generating happy numbers by
construction earlier in the quiz, I might have spent Saturday working
that out. Oh well.

Incidentally, I'm pretty sure now that the smallest 9-step number is:

("3788" + "9" * 973).to_i

with 977 digits. Note that:

irb(main):020:0> ("3788" + "9"*973).split(//).inject(0){|s,x|s+(x.to_i**2)}
=> 78999

--
s=%q( Daniel Martin -- martin@xxxxxxxxxxxx
puts "s=%q(#{s})",s.map{|i|i}[1] )
puts "s=%q(#{s})",s.map{|i|i}[1]

.



Relevant Pages

  • Re: A simple question about integers
    ... (This is a standard construction, ... > sequence of digits we even cannnot define a greater/smaller ... considered as infinite decimal expansions (or expansions ...
    (sci.math)
  • Re: November 25 is Infinite Clause day!!
    ... infinite length are computable the conclusion of Cantor's proof relies ... on the existence of a new sequence of digits which is clearly non ... your construction can never be realised. ... places in the sequence are all covered. ...
    (sci.math)
  • Re: Ultimate debunking of Cantors Theory
    ... as a result of the construction. ... the Cantor construction fails in base 2. ... if one pairs off digits starting from the binary ... 1's while every list entry is a finite sequence of 1's. ...
    (sci.math)
  • Re: Cantor
    ... > I think I'm getting sidetracked by giving poor examples. ... In my example below, SSSS0 differs in ... the purpose of the construction is not to produce ... sequence of digits represents a natural number. ...
    (sci.math)
  • Re: Neyland to Fishguard. Why?
    ... panels charting and explaining its construction and regular use. ... none of these panels explained why Neyland lost its importance ...
    (uk.railway)