[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/ailvcheng/Java/master/Maths/VampireNumber.java [Back]  [Original]

package Maths; import java.util.ArrayList; import java.util.Collections; /** * n number theory, a vampire number (or true vampire number) is a composite natural number with an * even number of digits, that can be factored into two natural numbers each with half as many * digits as the original number and not both with trailing zeroes, where the two factors contain * precisely all the digits of the original number, in any order, counting multiplicity. The first * vampire number is 1260 = 21 60. * * *

* link: https://en.wikipedia.org/wiki/Vampire_number * * *

*/ public class VampireNumber { public static void main(String[] args) { test(10, 1000); } static void test(int startValue, int stopValue) { int countofRes = 1; StringBuilder res = new StringBuilder(); for (int i = startValue; i


Web Proxy Viewer  |  New URL  |  Original Page