mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 06:23:08 +08:00
Format code with prettier (#3375)
This commit is contained in:
@ -4,14 +4,15 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* Java program for printing juggler sequence
|
||||
* Java program for printing juggler sequence
|
||||
* Wikipedia: https://en.wikipedia.org/wiki/Juggler_sequence
|
||||
*
|
||||
*
|
||||
* Author: Akshay Dubey (https://github.com/itsAkshayDubey)
|
||||
*
|
||||
*
|
||||
* */
|
||||
|
||||
public class JugglerSequence {
|
||||
|
||||
/**
|
||||
* This method prints juggler sequence starting with the number in the parameter
|
||||
*
|
||||
@ -34,7 +35,10 @@ public class JugglerSequence {
|
||||
if (n % 2 == 0) {
|
||||
temp = (int) Math.floor(Math.sqrt(n));
|
||||
} else {
|
||||
temp = (int) Math.floor(Math.sqrt(n) * Math.sqrt(n) * Math.sqrt(n));
|
||||
temp =
|
||||
(int) Math.floor(
|
||||
Math.sqrt(n) * Math.sqrt(n) * Math.sqrt(n)
|
||||
);
|
||||
}
|
||||
n = temp;
|
||||
seq.add(n + "");
|
||||
|
Reference in New Issue
Block a user