R/determinejob.R

Defines functions determinejob

determinejob <- function(r,n){
	stopifnot(r <= n*(n-1)/2 + n)
	deduct <- n
	subtractions <- 0
	while(r > 0){
		r <- r - deduct
		subtractions = subtractions + 1
		deduct = deduct - 1
	}
	A <- subtractions
	B <- r + n
	return(c(A,B))
}

Try the ohtadstats package in your browser

Any scripts or data that you put into this service are public.

ohtadstats documentation built on Nov. 15, 2019, 5:11 p.m.