18 "output_type": "execute_result"
24 " self.reverse == self\n",
44 "output_type": "execute_result"
48 "\"happy\".palindrome?"
66 "output_type": "execute_result"
70 "\"abbacabba\".palindrome?"
88 "output_type": "execute_result"
93 " def to_digits(base=10)\n",
94 " self.to_s(base).split('').map {|d| d.to_i}\n",
101 "execution_count": 6,
112 "execution_count": 6,
114 "output_type": "execute_result"
123 "execution_count": 7,
131 "[0, 1, 3, 5, 7, 9, 33, 99, 313, 585, 717]"
134 "execution_count": 7,
136 "output_type": "execute_result"
140 "(0..10**3).select {|i| i.to_s.palindrome? && i.to_s(2).palindrome?}"
145 "execution_count": 8,
153 "[0, 1, 3, 5, 7, 9, 33, 99, 313, 585, 717, 7447, 9009, 15351, 32223, 39993, 53235, 53835, 73737, 585585]"
156 "execution_count": 8,
158 "output_type": "execute_result"
162 "(0..10**6).select {|i| i.to_s.palindrome? && i.to_s(2).palindrome?}"
167 "execution_count": 9,
178 "execution_count": 9,
180 "output_type": "execute_result"
184 "(0..10**6).select {|i| i.to_s.palindrome? && i.to_s(2).palindrome?}.sum"
189 "execution_count": null,
199 "display_name": "Ruby 2.4.0",
204 "file_extension": ".rb",
205 "mimetype": "application/x-ruby",