Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions
Content added Content deleted
(add FreeBASIC) |
|||
Line 324: | Line 324: | ||
} |
} |
||
let max = 15 |
|||
print("The first \(max) terms of the sequence are:") |
print("The first \(max) terms of the sequence are:") |
||
var (i, next) = (1, 1) |
var (i, next) = (1, 1) |
||
while next <= max { |
while next <= max { |
||
if next == countDivisors(i) { |
if next == countDivisors(i) { |
||
print("\(i) ", terminator |
print("\(i) ", terminator: "") |
||
next += 1 |
next += 1 |
||
} |
} |