g | x | w | all
Bytes Lang Time Link
174Python 2250528T011907ZLucenapo
nanVyxal211125T065505Zlyxal
044Python 3170412T141530ZKSab
nanJavaScript170412T113042ZEmigna
nanJavaScript170412T115214ZEmigna
nanR170410T082803Zplannapu
nanPython 2.7170408T144550Zovs
135C#170407T203129ZSLuck49
02305AB1E170407T165049ZEmigna
01505AB1E170407T163707ZEmigna
02205AB1E170407T161443Zuser4867
115C170406T082427Ztehtmi
012MATL170406T051544Ztehtmi
028Röda170406T041528Ztehtmi
064Python 3.6170405T235728Zuser4867
041NO170405T212124ZEmigna
039JavaScript170405T192744ZGOTO 0
026EXCEL170404T212631ZJör
172C#170405T150521ZSLuck49
171HODOR170405T150136ZEmigna
nanHODOR170405T010036Zwwj
nanRProgN 2170404T230139Znotjagan
008CJam170404T112533ZEmigna
02205AB1E170404T171050ZEmigna
nanR170404T144952Zplannapu
nanR170404T143657Zplannapu
064Haskell170404T141258ZLaikoni
008Fireball170404T110236ZLinnea G
04705AB1E170404T111742ZEmigna
112C#170404T084749ZEmigna
050C170404T083307Zfergusq
nanRuby170404T075252Zxsot
nanPython 3.6170404T051113Zxnor
nanMathematica170404T004950ZNot a tr
nanJavaScript ES7170403T235746ZIlmari K
192Inform 7170403T225829ZIlmari K
060Python 2170403T234028Znotjagan
nanR170403T231507ZSteadybo
nanJavaScript170403T193457Znotjagan
nanR170403T223004ZFlounder
nanC170403T200421ZDave
nan170403T192849ZMr. Xcod
nanHaskell170403T191802Znimi
192Scala170403T190652Zmath jun
nan170403T175932ZMr. Xcod
013OCaml170403T173835ZDada
044Python 2170403T173736Zfəˈnɛtɪk
100C++ gcc170403T171433Zfergusq
015Python170403T161952Zuser4180

Python 2, 174 bytes, cracks penalosa

print str(input()**(5. * .5))or ()/22*2444599.9.HHHWWW_______________aaaaabbbcccccccccddddddeeeeeeeeeeeefffgghhhhiiiiiiikkkkkkkkkllllllllmmnnnooooooooprrrrrrrrrrrt.tttuuuuuu;

Try it online!

Vyxal, cracks emanresuA's answer

5|2/en[(`ĖĖ:

Try it Online!

Easy. I came up with the solution in the shower that's how easy it is.

Python 3, 44 bytes, Kyle Gullion

Those *s were quite misleading. Very clever!

lambda i:i**(lambda o,r:o/r)(*map(ord,'i*'))

Due to the quite limited character set I would be very surprised if there were any other valid solutions beyond trivial renaming or reordering of arguments.

JavaScript, SIGSEGV

x=>x**(25*10**-1)

Try it online!

JavaScript, SIGSEGV

x=>x**(3.5-+!+[]);

Try it online!

R, Flounderer

This is a crack of @Flounderer's 31-byte solution:

`[.`=function(`]`)`]`^`[`(lh,9)

Ok that was a tough one. It creates a function called `[.`. The argument to the function is called `]` which is elevated to power 2.5 by using the 9th element of the built-in time-serie lh ("a regular time series giving the luteinizing hormone in blood samples at 10 mins intervals from a human female, 48 samples." that is used as example in one of R's base packages). lh[9] is here on top of it replaced by its equivalent `[`(lh, 9). De-obfuscated by substituting f for the function name and n for the argument name, the function then becomes f=function(n)n^lh[9].

Usage:

> `[.`=function(`]`)`]`^`[`(lh,9)
> `[.`(4)
[1] 32
> `[.`(6)
[1] 88.18163
> `[.`(9)
[1] 243
> `[.`(25)
[1] 3125

Python 2.7, Koishore Roy

s=e=x=y=input()**0.5
print'%.3f'%(y**(5.0))

C#, 135 bytes, Jan Ivan

This was a lot of fun, I particularly liked the use of using static.

using System;using static System.Math;class P{static void Main(){Console.Write(Pow(long.Parse(Console.ReadLine()),1/Round(PI-E,1)));}}

05AB1E, 23 bytes, user4867444

$DDžHGD¹s/+;}0@rrzz2+\P

Try it online!

Explanation

$                        # push 1 and input
 DD                      # duplicate the input twice
   žHG                   # 65536 times do:
      D                  # duplicate current value
       ¹s/               # divide input by current value
          +              # add result of division to current value
           ;             # divide by 2
            }            # end loop
             0@          # get the bottom value of the stack (the 1)
               rr        # reverse the stack twice (no-op)
                 zz      # calculate 1/(1/1), a no-op
                   2+    # add 2
                     \   # discard top of stack (the 3)
                      P  # product of stack

05AB1E, 15 bytes, user4867444

DMžDFD¹s/+;}01P

Try it online!

Explanation

D                 # duplicate input
 M                # push the largest value on the stack (the input)
  žDF             # 4096 times do:
     D            # current value
         +        # added to
      ¹s/         # input divided by current value
          ;       # divide sum by 2
           }      # end loop
            01    # push 1
              P   # product of the stack

05AB1E, 22 bytes, Emigna

蛹DDLÏ_zTnF©¹®/+;}¹DP

Most probably not what was intended, but works ;)

Everything before T is just byte wasting (but which leaves the stack empty), then it does a 100 Newton iterations, which yields a good enough approximation of the square root, then pushes the input twice and returns the product of the whole stack, thus giving the desired output.

Example runs:

$ echo 0 | ./05AB1E.py -e '蛹DDLÏ_zTnF©¹®/+;}¹DP'
0.0
$ echo 4 | ./05AB1E.py -e '蛹DDLÏ_zTnF©¹®/+;}¹DP'
32.0
$ echo 6 | ./05AB1E.py -e '蛹DDLÏ_zTnF©¹®/+;}¹DP'
88.18163074019441
$ echo 25 | ./05AB1E.py -e '蛹DDLÏ_zTnF©¹®/+;}¹DP'
3125.0
$ echo 7131 | ./05AB1E.py -e '蛹DDLÏ_zTnF©¹®/+;}¹DP'
4294138928.896773

C, 115 bytes, user4867444

New solution that works for 0.

o(double n){double l=1;;for(double o=0.;o<=8*8*2e3&&(long)o+n*((long)2*3>>1);o++)l=(l+n/l)/2;printf("%.3f",n*n*l);}

Old solution that doesn't work for 0:

o(double n){double l=n;;for(double o=1.0;o<=8*8*2e+3&&(long)o*((long)2*3>>1);o++)l=(l+n/l)/2;printf("%.3f",n*n*l);}

Applying Newton's method (for square root) a very large fixed number of times seems to give adequate precision for numbers in the required range. I did some character wasting in the first two for loop clauses.

MATL, 12 bytes, Luis Mendo

10'U&+:'n/^P

Calculate 10/4 = 2.5 with 4 coming from string length. Use this as an exponent. P is a no-op here.

Röda, 28 bytes, fergusq

f(n){push n^0.5,n^2|product}

Python 3.6, 64 bytes, Mr. Xcoder

php38af4r2aoot2srm0itpfpmm0726991i=     (lambda x:x**2.5*1*1/1);

Maybe not what was intended, but works ;)

$ python3
Python 3.6.1 (default, Apr  4 2017, 09:36:47) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> php38af4r2aoot2srm0itpfpmm0726991i=     (lambda x:x**2.5*1*1/1);
>>> php38af4r2aoot2srm0itpfpmm0726991i(6)
88.18163074019441
>>> php38af4r2aoot2srm0itpfpmm0726991i(4)
32.0
>>> php38af4r2aoot2srm0itpfpmm0726991i(25)
3125.0

Not enough rep to comment on the cops' thread's answer yet, sorry... Would appreciate if someone could do it for me, thanks!

NO, 41 bytes, This Guy

NOOOOOO?NOOOOOOOOOOO!nnOOOOO
NOOOOOOOO?no

JavaScript, 39 bytes, SLuck49

x=>(l=Math).cbrt(l.exp(l.log(x)*7.5))

or similarly

x=>(l=Math).exp(l.log(l.cbrt(x))*7.5)

Test:

alert((

x=>(l=Math).cbrt(l.exp(l.log(x)*7.5))

)(prompt()));

EXCEL, 26 Bytes pajonk

=SQRT(A1)*A1^2/1/ISNA(IP2)

A1 as input IP2 contain a second input with a #N/A Error in this case ISNA(IP2) belongs to 1

For an additional () we can do this

=SQRT(A1)*A1^2/ISNA(PI(1/2))

C#, 172 bytes, raznagul

Hardest part was figuring out what to do with all the leftovers.

using System;using S=System.Console;class PMabddellorttuuv{static void Main(){S.Write(Math.Pow(double.Parse(S.ReadLine()),2.5));Func<double> o;int q=1,M=q*2,b,e;q*=(q*M);}}

HODOR, 171 bytes, wwj

Walder
Hodor 
Hodor 
Hodor 
Hodor 
Hodor
Hodor, Hodor Hodor Hodor Hodor, Hodor Hodor,
hodor.
Hodor.
Hodor?!
Hodor, Hodor Hodor Hodor Hodor Hodor Hodor, hodor!,
HODOR!!
HODOR!!!

Explanation

HODOR, 198, This Guy

Walder
Hodor?!
hodor.
Hodor, Hodor Hodor Hodor Hodor Hodor Hodor Hodor, Hodor Hodor,
hodor,
Hodor, Hodor Hodor Hodor Hodor Hodor Hodor, Hodor Hodor,
Hodor, Hodor Hodor Hodor, hodor!,
HODOR!!
HODOR!!!

Explanation:

Start
read input into accumulator
copy accumulator to storage
Do math, option 7(nth root), n=2
swap storage and accumulator
Do math, option 6(nth power), n=2
Do math, option 3(times), storage
output accumulator as a number
end

note: I had to make some modifications to the get interpreter to run on my machine (the one you have posted doesn't seem to accept lowercase h, among some other things)

Also, I don't seem to have enough rep to comment, so if someone could let @This Guy know, I would be grateful

I think this fixed the error, the code now starts with Walder instead of Wylis, which adds the extra byte

RProgN 2, ATaco

]2^\š*

Apparently StackExchange needs extra characters, so here you go.

CJam, 8 bytes, Roman Gräf

My First ever CJam answer.
CnR are great for testing new languages :)

ldYYW#+#

Try it online!

Explanation

ld         % double(input)
       #   %              ^
  Y        %               (2
      +    %                 +
   Y       %                  2
     #     %                   ^
    W      %                    -1)

05AB1E, 22 bytes, P. Knops

n¹t*qA9¥="'?:@->%#[{!.

Try it online!

Explanation

n      # square of input
   *   # times
 ¹t    # square root of input
    q  # end program

The rest of the operations never get executed.
We could have done it without the q as well by having ? after the calculation and escaping the equality sign for example with '=.

R, Flounderer

This is a crack of the 33 bytes solution of @Flounderer

scan()^(floor(pi)-1/2)-sin(7*0e1)

Usage:

> scan()^(floor(pi)-1/2)-sin(7*0e1)
1: 4
2: 
Read 1 item
[1] 32
> scan()^(floor(pi)-1/2)-sin(7*0e1)
1: 6
2: 
Read 1 item
[1] 88.18163
> scan()^(floor(pi)-1/2)-sin(7*0e1)
1: 9
2: 
Read 1 item
[1] 243
> scan()^(floor(pi)-1/2)-sin(7*0e1)
1: 25
2: 
Read 1 item
[1] 3125

R, steadybox

a222=function(s)(s**0.5)*s**2**1

Usage:

> a222=function(s)(s**0.5)*s**2**1
> a222(4)
[1] 32
> a222(6)
[1] 88.18163
> a222(9)
[1] 243
> a222(25)
[1] 3125

Haskell, 64 bytes, @nimi

product.(<$>(($(succ.cos$0))<$>[(flip<$>flip)id$id,recip])).(**)

Try it online! That was a fun one. I first found product.(<$>(($succ(cos$0))<$>[id,recip])).(**) which behaves correctly and than had to fit flip flip <$> () $ id . somewhere into it.

Fireball, 8 bytes, Okx

♥²♥1Z/^*

Explanation:

♥²♥1Z/^*
♥²       Push first input squared.
  ♥      Push first input again.
   1Z/   Push 1/2
      ^  First input to the 1/2th
       * Multiply square and root

Not sure if it works. I have currently no java on my laptop. :(

05AB1E, 47 bytes, Okx

).2555BFHIJJKKKPQRS``„cg…ghi…lsw…x}T…Áöž«‚¹n¹t*

Try it online!

C#, 112 bytes, Jan Ivan

using System;class P{static void Main(){var b=Math.Pow(double.Parse(Console.ReadLine()),2.5);Console.Write(b);}}

C, 50 bytes, Dave

double b(float \ufa2d){return pow(\ufa2d,25e-1);%>

Try it online!

This requires -lm compiler flag, but I don't know how it would be possible to solve this without it.

Ruby, G B

->a{eval''<<97<<42<<42<<50<<46<<53}

Python 3.6, c..

f=lambda x:x**2.5or'1*77*8+8/5/(((aafothipie.xml)))'

Try it online!

Stuffs all the unneeded characters into a string after the or. Since x**2.5 is nonzero and so truthy, the part after the or isn't evaluated. Any syntactically valid expression would be OK here.

Python parses 2.5 and or as separate tokens in 2.5or, though the syntax highlighter for the code doesn't recognize this.

Mathematica, Greg Martin

f[y_]:=With[{x=
    #&@@{#(#)#^(1/(1+1))&@y,#&@@@{1^(1),-1}}
},Print[#,".",IntegerString[Round@#2,10,3]]&@@QuotientRemainder[1000x,1000]]

Thanks for leaving the rounding stuff intact!

Explanation: #(#)#^(1/(1+1))&@y does the main work of multiplying y squared, aka y(y), and y's square root, y^(1/(1+1)). The #&@@@{1^(1),-1} bit is just junk to use up the other letters, and #&@@ picks out the useful bit from the junk.

JavaScript (ES7), Neil

_26_=>_26_**6.25**.5

The hard part, of course, was figuring out what to do with all the extra characters. (And also not posting this solution in the wrong thread, like I accidentally did at first. Oopsie...)

Inform 7, corvus_192

Cool, an Inform7 entry. :) I just had to give this one a try.

I'm pretty sure this is the intended solution:

R is a room.

To f (n - number): say "[n * n * real square root of n]".

Note that this solution only works if compiled with the Glulx back-end, due to the use of the real square root of function.


BTW, the double quotes and square brackets are actually unnecessary; just say n * n * real square root of n would work just as well. The periods at the end of the commands could be omitted, too; or we could keep the first period and get rid of the newlines instead. Other parts of the code we could trim away include the article "a" before "room" and the spaces before the parentheses and after the colon. Fortunately, since we've got a spare pair of brackets, we can always use them to comment out all these extra characters. ;) So this is a valid solution, too:

R is room.To f(n - number):say n * n * real square root of n[
" a . "
]

To test this solution interactively, it's convenient to append something like the following test harness to the code:

Effing is an action applying to one number.
Understand "f [number]" as effing.
Carry out effing: f the number understood.

After compiling and running the program, you can type e.g. f 4. f 6. f 9. f 25 at the > prompt and receive something like the following output:

Welcome
An Interactive Fiction
Release 1 / Serial number 170404 / Inform 7 build 6L38 (I6/v6.33 lib 6/12N) SD

R

>f 4. f 6. f 9. f 25
32.0
88.18164
243.0
3125.0
>

BTW, I just noticed that Inform (or presumably, rather, Glulx) rounds the last decimal place of f 6 wrong: the correct value is much closer to 88.18163 than to 88.18164. Fortunately, I don't think this affects the correctness of the solution(s), especially since the challenge specified "any rounding mechanism of your choice". :)

Python 2, 60 bytes, Anthony Pham

print    (input()**(5.0/(2*5554448893999/5554448893840))-0)

Based on discarding characters through Python 2's float division (the default for / between integers).

R, Flounderer

scan()**mean(1:4.5)

Try it online!

JavaScript, fəˈnɛtɪk

n=>n**("ggggg".length*2**(-"g".length))// ""((((((()))))))***,-...;;=====>Seeeeegggghhhhhhhhhilllnnnnnnorrrsstttttttttttu{}

Gets 5/2 through 5 times 2 to the negative first power, where 5 and 1 were received from the length of strings. Took the easy way out in a sense by commenting out the extraneous characters.

R, Steadybox

y<-function(p)(p^(1/2)*p^2);

seems to be an anagram of funny(p1)-tio(^*^)/pc(2)<p2;

C, Steadybox

float q(float b){return(b-b>0.*4*1/1)-sqrtf(b)*pow(b,2)*-1;}

Not sure what the original did; I had to discard a lot of random operators and numbers, but once the available words were clear it wasn't too hard to piece together the general idea.

05AB1E - P. Knops

t¹n*

Was quite easy :)

Haskell, Leo

x=exp.(2.5*).log

A pointfree function named x. Usage: x 4 -> 32.0

Scala, corvus_192

d=>math.pow(d,5/2d)

Try it here!

Simple lambda expression

Python - SparklePony

import math
f=lambda x:x*x*math.sqrt(x)

OCaml, 13 bytes, shooqie

fun f->f**2.5

Try it online!

Python 2, 44 bytes, Anthony Pham

print int(raw_input())**(0+000000000000.5*5)

Takes input from raw_input, converts to int and raises to power 2.5

C++ (gcc), 100 bytes, Mr. Xcoder

#include<math.h>
#include"iostream"
using namespace std;int main(){float n;cin>>n;cout<<pow(n,2.5);}

Try it online!

Python, 15 bytes, Mr. Xcoder

lambda x:x**2.5

Pretty simple. Just takes x and raises it to the 2.5th power.