Skip to content

Instantly share code, notes, and snippets.

@onlyangel
Created September 2, 2011 05:22
Show Gist options
  • Save onlyangel/1187971 to your computer and use it in GitHub Desktop.
Save onlyangel/1187971 to your computer and use it in GitHub Desktop.
sum 1/sqrt(n), n=1 to infinity
public class T1 {
public static void main(String [ ] args){
double acum = 0;
for (int n = 1;n<=100;n++){
acum+=1/Math.sqrt(n);
}
System.out.print(acum);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment