Files
reflections/src/main/java/me/finn/unlegitlibrary/number/molecular/MolecularAdd.java
2024-07-07 23:13:20 +02:00

21 lines
530 B
Java

/*
* 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;
}
}