# # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- ks = seq(1,117) # take a very large range for k xs = ( -3 + sqrt( 1 + 24 * ks ) ) / 2 # Determine which values of k result in an integer value of x: # int_values = xs %% 1 == 0 R = cbind( ks[ int_values ], xs[ int_values ] ) colnames(R) = c("valid ks","integer xs") print(R)