Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions
Content added Content deleted
(→{{header|PL/M}}: Added Polyglot:PL/I and PL/M and PL/I) |
ReeceGoding (talk | contribs) m (→{{header|R}}: Syntax highlighting.) |
||
Line 1,207: | Line 1,207: | ||
=={{header|R}}== |
=={{header|R}}== |
||
<lang |
<lang rsplus>#Need to add 1 to account for skipping n. Not the most efficient way to count divisors, but quite clear. |
||
divisorCount <- function(n) length(Filter(function(x) n %% x == 0, seq_len(n %/% 2))) + 1 |
divisorCount <- function(n) length(Filter(function(x) n %% x == 0, seq_len(n %/% 2))) + 1 |
||
A06954 <- function(terms) |
A06954 <- function(terms) |