Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For challenges involving sequences, typically of numbers following some pattern.
7
votes
Big numbers: Ultrafactorials
R - 34 30 bytes
x=factorial(0:scan());sum(x^x)
vectorizing is nice
edit: saved 4 bytes thanks to @MickyT
1
vote
In-between fractions
R - 71 bytes
Assumes you have already installed the MASS package
f=function(x,y,z)MASS::fractions(union(seq(x,y,eval(parse(text=z))),y))
> f(1, 2, '1/3')
[1] 1 4/3 5/3 2
> f(2, 5, '1/2')
[1] …
1
vote
Greatest Number in a Range When The Sum of Squares of its Prime Factors are Subtracted
R 109 bytes
y=sapply(x<-2:scan(),FUN=function(x)x-sum(unique(as.numeric(gmp::factorize(x))^2)));c(x[which.max(y)],max(y))
I cheated and used a package, gmp.
1
vote
Print a bunch of uninteresting numbers!
R 34 bytes
y=scan();as.numeric(paste0(y,y))*y
2
votes
Count Up, Replace, Repeat!
R, 60 49 bytes
Pretty straightforward use of unlist and sapply.
y=x=scan();for(i in 1:x)y=unlist(sapply(y,seq));y
Thanks to @MickyT for saving 11 bytes