Initial commit

This commit is contained in:
2024-07-07 23:13:20 +02:00
commit 8ef9a95b67
73 changed files with 4575 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
/*
* Copyright (C) 2024 UnlegitDqrk - All Rights Reserved
*
* You are unauthorized to remove this copyright.
* You have to give Credits to the Author in your project and link this GitHub site: https://github.com/UnlegitDqrk
* See LICENSE-File if exists
*/
package me.finn.unlegitlibrary.number.molecular;
public class MolecularAdd {
/**
* @param k is the start number
* @param n is the end number
**/
public static int useFormula(int k, int n) {
return ((n - k + 1) * (n + k)) / 2;
}
}

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2024 UnlegitDqrk - All Rights Reserved
*
* You are unauthorized to remove this copyright.
* You have to give Credits to the Author in your project and link this GitHub site: https://github.com/UnlegitDqrk
* See LICENSE-File if exists
*/
package me.finn.unlegitlibrary.number.molecular;
import me.finn.unlegitlibrary.number.MathHelper;
public class MolecularSubtract {
/**
* @param k is the start number
* @param n is the end number
**/
public static int useFormula(int k, int n) {
if (!MathHelper.isNegative(n)) n = -(n);
return ((-n - k + 1) * (-n + k) / 2) + k;
}
}