Created
June 23, 2020 15:28
-
-
Save rodrigoSaladoAnaya/ca392f593c0b74374641b8b848ce4bc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(double N = 9; N < 199999; N+=2) { | |
def U = Math.sqrt((N + Math.sqrt(N - 4)) / 4); | |
def L = Math.floor(U - 1) | |
def signature = [] | |
def isOddComNum | |
double i = 0 | |
for(; i <= L && !isOddComNum; i++) { | |
def B = (i * 4) + 6; | |
def Q = (N / B) % 0.5; | |
isOddComNum = Q == 0 | |
signature << (isOddComNum ? '|' : '.') | |
} | |
def index = N.toString().padRight(8) | |
def tree = signature.join() | |
if(isOddComNum) { | |
println "${index} -> ${tree} ${isOddComNum ? '' : 'P'}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment