core_templates1/collatz.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Wed, 02 Nov 2022 13:22:59 +0000
changeset 429 126d0e47ac85
parent 428 cdfa6a293453
child 430 274c865b3878
permissions -rw-r--r--
updated

// Core Part 1 about the 3n+1 conjecture
//============================================

object C1 {

// ADD YOUR CODE BELOW
//======================


//(1) 
def collatz(n: Long) : Long = ???


//(2) 
def collatz_max(bnd: Long) : (Long, Long) = ???

//(3)
def is_pow_of_two(n: Long) : Boolean = ???

def is_hard(n: Long) : Boolean = ???

def last_odd(n: Long) : Long = ???

}



// This template code is subject to copyright 
// owned by King's College London. Do not 
// make this template code public in any shape or 
// form, and do not exchange it with other students 
// under any circumstance.