nextn                  package: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))

