1
I have two 50 number formulas.
One has multiples of 3
and the other multiples of 7
.
Code:
public static void main(String[] args) {
BigInteger start = new BigInteger("1");
BigInteger limit = new BigInteger("50");
BigInteger n1 = new BigInteger("3");
BigInteger n2 = new BigInteger("7");
for (BigInteger a = start; a.compareTo(limit) <= 0; a = a.add(BigInteger.ONE)) {
BigInteger copas3 = a.multiply(n1);
BigInteger copas7 = a.multiply(n2);
System.out.println( copas3 );
System.out.println( copas7 );
}
}
See working on repl: https://repl.it/repls/AngryImpureSequences
I need only the repeating numbers between the two formulas to be printed.
So just:
21
42
63
84
105
126
147
You want only with these codes or we can suggest different applications?
– Sorack
It can be with different applications, but needs to be Biginteger and without Lists...
– William