16 "output_type": "execute_result"
20 "load 'array-numbers.rb'"
25 "execution_count": 25,
34 "execution_count": 25,
36 "output_type": "execute_result"
41 " # Split a number into a list of digits\n",
43 " self.to_s == self.to_s.reverse\n",
46 " def lychrel_step\n",
47 " self + self.to_s.reverse.to_i\n",
50 " def lychrel?(limit=50)\n",
51 " if lychrel_step.palindrome?\n",
53 " elsif limit == 0\n",
56 " lychrel_step.lychrel?(limit-1)\n",
64 "execution_count": 27,
73 "execution_count": 27,
75 "output_type": "execute_result"
84 "execution_count": 28,
93 "execution_count": 28,
95 "output_type": "execute_result"
104 "execution_count": 29,
113 "execution_count": 29,
115 "output_type": "execute_result"
124 "execution_count": 30,
133 "execution_count": 30,
135 "output_type": "execute_result"
144 "execution_count": 31,
153 "execution_count": 31,
155 "output_type": "execute_result"
159 "349.lychrel_step.lychrel_step.lychrel_step"
164 "execution_count": 32,
173 "execution_count": 32,
175 "output_type": "execute_result"
184 "execution_count": 33,
193 "execution_count": 33,
195 "output_type": "execute_result"
204 "execution_count": 34,
213 "execution_count": 34,
215 "output_type": "execute_result"
224 "execution_count": 35,
233 "execution_count": 35,
235 "output_type": "execute_result"
239 "(10...10**4).select {|n| n.lychrel?}.length"
244 "execution_count": null,
254 "display_name": "Ruby 2.4.0",
259 "file_extension": ".rb",
260 "mimetype": "application/x-ruby",