Scala implicit conversion to add methods to Int
First of all, what Scala version are you using? If you're using 2.10 or newer versions, the language has introduced implicit classes which help you avoid the definition of implicit conversions - as a side note implicit classes are translated to implicit conversions by the compiler so let's say they are some type of syntactic sugar.

As you might now, the implicit modifier cannot be used on top-level definitions - that includes implicit classes as well, so we must wrap them in a class / trait / object. As a best practice it's best to put them in an object (or package object like you did). The other constraints of implicit classes are already explained in the first link, so I won't go through them here.

A final note before we get to the code is that you will often see that implicit classes are used as value classes. Please consult this post if you're curious to see how when you should mix them with value classes.

Enough talk, let's see the code now:

package object arithmetic {
  implicit class RichInt(val value: Int) extends AnyVal {
    def isPrime: Boolean = ???
  }
}

object ArithmeticTest extends App {
  import arithmetic._
  1.isPrime
}


That's it! Hope it helps.