integer algorithms