Combinations with repetitions/Square digit chain: Difference between revisions
Combinations with repetitions/Square digit chain (view source)
Revision as of 10:46, 16 September 2014
, 9 years ago→{{header|Ruby}}
(Created page with "{{draft task}} Iterated digits squaring introduces RC the Project Euler Task #92. Combinations with repetitions introduce RC to the concept of generating all the combi...") |
|||
Line 23:
end
return res==89?0:res
#An array: N[n]==
N = (G=Array.new(D*81+1){|n| n==0? 1:(i=g.call(n))==89 ? 0:i}).collect{|n| while n>1 do n = G[n] end; n }
|