sleepwalker7

Functions of Integers on Cartesian Plane

Apr 26th, 2020
364
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import scala.math.{min,max}
  2.  
  3. object Funcij {
  4.  
  5.   def sumin(n: Int): BigInt = {
  6.     val k: BigInt = n
  7.     k * (k+1) * (2*k+1) / 6
  8.   }
  9.   def sumax(n: Int): BigInt = {
  10.     sumsum(n) - sumin(n)
  11.   }
  12.   def sumsum(n: Int): BigInt = {
  13.     val k: BigInt = n
  14.     k*k*(k+1)
  15.   }
  16. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×