Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- int n = 1;
- double sum = 0.0f;
- System.out.println((double)9/10);
- while (n < 10000) {
- int p = ((n*n)+n)/2;
- if (p%2 == 1) {
- sum += 2*(double)1/(Math.pow(3, n));
- }
- n++;
- }
- System.out.println(sum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement