27

J, 3 bytes That was fun to find. &+/ Try it online! How it works 10 (&+/) 3 1 4 1 5 will bind 10 as an argument of + as 10&+, one verb that gets inserted between the elements of the list by /. So we have: 3 (10&+) 1 (10&+) 4 (10&+) 1 (10&+) 5. Now x n&v y means that y gets applied to n&v for x times. With J's right to ...


26

Shakespeare Programming Language, 106 bytes ,!Ajax,!Puck,!Act I:!Scene I:![Enter Ajax and Puck]Ajax:Listen tothy!You is the factorial ofyou!Open heart Try it online! Uses the built-in the factorial of, which isn't described at all in the official docs. Commented ,!Ajax,!Puck,!Act I:!Scene I:![Enter Ajax and Puck] # header Ajax:Listen tothy! ...


23

JavaScript (ES6),  28  23 bytes Saved 3 bytes thanks to @Mukundan314 Expects (A)(n). A=>n=>eval(A.join`*n+`) Try it online! How? We simply join the input array with "*n+", so that [1,2,3] is turned into "1*n+2*n+3" and evaluate the resulting string.


17

Score 1164 883 835 772 601 574 554 506 541^n*743^(n/2)*(-1)^(n/4)*17^(n/8)%2310+...


15

x86-16 / x87 machine code, 13 bytes Binary: 00000000: d9e8 e308 518b f4de 0c59 e2f8 c3 ....Q....Y... Listing: D9 E8 FLD1 ; start with 1 E3 08 JCXZ DONE ; if N = 0, return 1 FACT_LOOP: 51 PUSH CX ; push current N onto stack 8B F4 MOV SI, SP ; SI to top of stack for N ...


15

Jelly, 6 bytes R×:<?/ A monadic Link accepting a positive integer, \$n\$, which yields a positive integer, \$a(n)\$. Try it online! Or see the test-suite. How? R×:<?/ - Link: R - range -> [1..n] / - reduce by (i.e. evaluate f(f(...f(f(f(1,2),3),4),...),n) with this f(a,b): ? - if... < - ...condition: (a) less than (b)? × ...


14

J, 22 bytes %&".e.=/#&,%/&(1".\.]) Try it online! quick explanation for now: take the input as strings %/&(1".\.]) creates a function table %/ whose axes are the integer ". lists formed by the 1-outfixes \. (remove 1 digit at a time) of both args, and whose cells are the quotients of those numbers =/ forms a corresponding function table ...


14

Python 3, 119 ... 110 105 bytes -14 bytes thanks to @xnor Takes as input an array \$ a\$ consisting of the two integers. Outputs the product of the two numbers based on the Wrong Times Table. For the case [1, 2] or [2, 1], it outputs .5. lambda a:b' \0\n  \r2   (0* &#...


14

Python 2, 47 bytes lambda m,r,l:m/reduce(lambda u,x:u/r+x-x/r,l,m) Try it online! Takes timestamps sorted in descending order. The idea is to compute the video duration as a polynomial in the inverse speedup rate 1/r using Horner's method with coefficients given by the sorted timestamps. This avoids needing to explicitly take the differences of consecutive ...


14

Scratch 3.0, 29 27 blocks/234 167 bytes As SB Syntax: define f(n) if<(n)=(1)>then add(1)to[v v else f((n)-(1 set[d v]to(item(length of[v v])of[v v if<(n)>(d)>then add((n)*(d))to[v v else add([floor v] of ((n)/(d)))to[v v] end end when gf clicked delete all of [v v ask()and wait f(answer) Try it on scratch I'm a little unsure of some input/...


13

JavaScript (ES7),  80 74 66  65 bytes (a,b,c)=>(s=a+b+c,(p=a*b*c/s)*p/4*(s/=2)/(s-a)/(s-b)/(s-c)-p)**.5 Try it online! How? This is derived from: The semiperimeter \$s\$ of the triangle: $$s=\frac{a+b+c}{2}$$ The circumradius \$R\$ of the triangle: $$R=\frac{abc}{4\sqrt{s(s-a)(s-b)(s-c)}}$$ The product of the inradius \$r\$ and the circumradius: $$rR=...


13

MATL, 2 bytes :p Try it online! The : generate range from 1 to input inclusive and the p reduces on product


13

Score 424 193 (30*n+(1-(1/(2^(n*30+16)%(n*30+17))))*((1-(1/(2^(n*30+22)%(n*30+23))))*((1-(1/(2^(n*30+28)%(n*30+29))))*((1-(1/(2^(n*30+12)%(n*30+13))))*((1-(1/(2^(n*30+6)%(n*30+7))))*((1-(1/(2^(n*30+40)%(n*30+41))))*((1-(1/(2^(n*30+18)%(n*30+19))))*(882)-22)+34)-6)-16)+6)+6)+17)+(1/(1+(n-475)^2))*10 This code searches the first Fermat pseudoprime of the form ...


13

Shakespeare Programming Language, 221 bytes ,.Ajax,.Puck,. Act I:.Scene I:.[Enter Ajax and Puck] Ajax:You cat. Scene V:. Puck:You is the sum ofYou a cat. Ajax:Open heart.Is I nicer you?If notYou is the quotient betweenyou I. If soYou is the product ofyou I.Let usScene V. Try it online! Outputs the infinite list. Note however that there is no separator ...


12

Python 3, 86 bytes lambda a,b:g(a)&g(b) g=lambda s:{(int(s[:i]+s[i+1:])/int(s),x)for i,x in enumerate(s)} Try it online! -8 bytes thanks to ovs Making use of the fact that the boolean value for a0/b0==a/b is equivalent to a0/a==b0/b. The helper function g generates all ratios a0/a and keeps track of the removed digit. Then it does the same for b0/b. ...


12

05AB1E, 6 bytes ∞b.ΔIÖ Try it online! or verify all test cases (courtesy of @KevinCruijssen) Explanation ∞b - Infinite binary list .Δ - Find the first value such that.. IÖ - It's divisible by the input


12

Haskell, 20 bytes (==0).sum.map((-1)^) Try it online!


12

C (gcc), 21 bytes Uses the assignment trick, works consistently in GCC without optimizations. O(o){o=o?o*O(~-o):1;} Try it online!


11

Python 2, 42 bytes f=lambda k,n=0:n*(max(`n`)<'2')or f(k,n+k) Try it online! Full program, same length: a=b=input() while'1'<max(`b`):b+=a print b Try it online!


11

Jelly, Score 1 * 8 bytes = 8 String zip: +Ẇɼ+ Try it online! Cantor pairing function: +ẆL+ Try it online! We use the fact that the Cantor pairing is equal to $$ {n + m + 1 \choose 2} + m $$ Where the left term just happens to be the number of nonempty contiguous slices of \$m+n\$. This saves two bytes per program over the naive +‘×+H+, and one byte over ...


11

Python 2, 47 43 39 bytes Saved 4 bytes thanks to xnor!!! Saved 4 bytes thanks to Neil!!! r=i=1 while 1:r=r/i or r*i;print r;i+=1 Try it online! Prints \$\{a(n)\mid n \in \mathbb{N}\}\$ as an infinite sequence.


10

Vyxal, jM, 17 bytes Ĥƛ3œı⇿⌊*n5œıₛÔ*+⟇ Try it Online! I refuse to be beaten by Arn. I absolutely will not be beaten by Arn. Vyxal forever lads. Explained Ĥƛ3œıƊº*n5œıũľ*+n∨ Ĥ # Push the number 100 ƛ # Start a lambda map doing the following over the range [1, 100]: (it would usually map over [0,99] but the M flag ...


10

R, 68 bytes function(M,m,n,A=M){while(any(A%*%M%%m!=diag(n)))A[]=rpois(n^2,9) A} Try it online! Strikingly slow. Will most likely time out for all test cases on TIO, but is guaranteed to give an answer eventually. Works by rejection sampling: generates random matrices A, with each value taken from a \$Poisson(9)\$ distribution, until a solution is found. ...


10

Retina, 29 bytes .+ * . $.<'$* ~`.+ .+¶$$.($&_ Try it online! Explanation: .+ * Convert n to unary. . $.<'$* Count down from n in decimal, with trailing *s. ~`.+ .+¶$$.($&_ Wrap the result in a Retina replacement stage and evaluate it. Example: For n=10, the resulting stage is as follows: .+ $.(10*9*8*7*6*5*4*3*2*1*_ This calculates the ...


10

brainfuck, 56 bytes +>,[[>+>+<<-]>[-<<[->+<<+>]<[->+<]>>>]<<[-]>[->+<]>>-]<. Try it online! Takes input and outputs as byte values. Since this interpreter has 8 bit size cells, it can't really do anything larger than 5!. You can use this interpreter to try larger values.


10

Score 2341 This outputs all primes between \$31\$ and \$8017\$ (included). (...


10

R, 43 39 bytes -4 bytes thanks to Giuseppe. for(i in 1:scan())T=T%/%i^(2*(i<T)-1);T Try it online! Outputs the \$n\$th term, 1-indexed. Initializing the sequence with \$a(0)=1\$ also works, as the formula then gives \$a(1)=1\$ as desired. The variable T is coerced to the integer 1, and we apply repeatedly a more compact version of the formula: $$a(n)=\...


9

R, 68 66 bytes for(i in 1:100)write(max(i,paste0("Fizz"[!i%%3],"Buzz"[!i%%5])),1) I must be missing something here because this is way too simple. I know that you really shouldn't use loops in R but like this is a bit smaller than the first R one I saw so yeah. Edited about a day after the original: you can get rid of the curly braces to ...


9

MATL, 10 bytes `@YBUG\}HM Try it online! Or verify all test cases. Explanation ` % Do...while @ % Push iteration index (1-based) YB % Convert to binary string (1 gvies '1', 2 gives '10, etc). U % Convert string to number ('10' gives 10). This is the current % solution candidate G % Push input \ % Modulo. ...


Only top voted, non community-wiki answers of a minimum length are eligible