Wasteful, equidigital and frugal numbers: Difference between revisions
Content added Content deleted
(New post.) |
m (Minor code improvement.) |
||
Line 369: | Line 369: | ||
/** |
/** |
||
* Factorise the numbers from 1 to limit |
* Factorise the numbers from 1 (inclusive) to limit (exclusive) |
||
*/ |
*/ |
||
private static void createFactors(int limit) { |
private static void createFactors(int limit) { |
||
factors = IntStream.rangeClosed(0, limit).boxed() |
factors = IntStream.rangeClosed(0, limit).boxed() |
||
.map( integer -> new HashMap<Integer, Integer>() ).collect(Collectors.toList()); |
.map( integer -> new HashMap<Integer, Integer>() ).collect(Collectors.toList()); |
||
factors.get(1). |
factors.get(1).put(1, 1); |
||
for ( int n = 1; n < limit; n++ ) { |
for ( int n = 1; n < limit; n++ ) { |