Advertisement
Guest User

Untitled

a guest
Apr 12th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.79 KB | None | 0 0
  1.     val numbers = "6115474323187442593994192765077136604594227569369995119642897363911" ::
  2.       "41774826691975630983016072275706158078222198625919684996083241678647" ::
  3.       "23262724271539017664484329348522604574406365009485643262463975389378" ::
  4.       "75181502983587100875750273342513358169507719898299937812210557091283" ::
  5.       "40161721859962384442076305712505276772652554160422798381248497227354" ::
  6.       "17438322675247922542716388553477136604590427955829035227042655016331" ::
  7.       "8452236650877776543143235681467503740696008207887220848499417306160" :: Nil
  8.  
  9.     val bigints = numbers.map(s => new BigInteger(s));
  10.  
  11.     val indices = (190000 to 196000 by 1).filter(index =>
  12.       bigints.exists(n => n.divideAndRemainder(
  13.         new BigInteger(index.toString))(1).intValue() == 0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement