Skip to content

Instantly share code, notes, and snippets.

@ntuaha
Created March 21, 2015 12:32
Show Gist options
  • Save ntuaha/75bed7540d7fe3fefa82 to your computer and use it in GitHub Desktop.
Save ntuaha/75bed7540d7fe3fefa82 to your computer and use it in GitHub Desktop.
R 的問題
#先定義函數
ff = function(y,i){
if (i==1){
return((4*5+1)%%16)
}else{
y[i] = (y[i-1]*5+1)%%16
return(y)
}
}
#迴圈
for ( i in 1:3){
y = ff(y,i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment