

nextn {base}                                 R Documentation

_H_i_g_h_l_y _C_o_m_p_o_s_i_t_e _N_u_m_b_e_r_s

_D_e_s_c_r_i_p_t_i_o_n_:

     `nextn' returns the smallest integer, greater than or
     equal to `n', which can be obtained as a product of
     powers of the values contained in `factors'.  `nextn'
     is intended to be used to find a suitable length to
     zero-pad the argument of `fft' to so that the transform
     is computed quickly.  The default value for `factors'
     ensures this.

_U_s_a_g_e_:

     nextn(n, factors=c(2,3,5))

_A_r_g_u_m_e_n_t_s_:

       n: an integer.

 factors: a vector of positive integer factors.

_S_e_e _A_l_s_o_:

     `convolve', `fft'.

_E_x_a_m_p_l_e_s_:

     nextn(1001) # 1024
     table(sapply(599:630, nextn))

