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 |
Challenges related to elementary arithmetic.
1
vote
Print multiplication tables by input
Fourier, 15 bytes
I~N11(i*Noi^~i)
Output for input 20:
020406080100120140160180200
Since unseparated output is allowed.
Try it online!
1
vote
What do you get when you multiply 6 by 9? (42)
Noether, 24 bytes
{I~a6=I~b9=&}{42P}{ab*P}
Try it here!
Explanation:
{ } - If
I - Push user input
~a - Store top item of stack in …
5
votes
Use xkcd's formula to approximate the world population
Python 3, 134 bytes
Works well but seems a bit long
from datetime import*
y=str(date.today().year)
z=int(y[2:])
m=str(60+(z-int((int(y)-2005)/4)))
print("%s.%s"%(m[0],m[1]),310+(z-10)*3)
2
votes
Compute the Digit Difference Sum of a Number
Python 3, 125 bytes
I used to like the shortness of regex until I tried to use it for this challenge...re.findall('\d\d',s,overlapped=True) is not on ;)
s=input()
p=int
x=p(s)
while p(s)>9:g=str(s); …
3
votes
Subtract the next numbers
Fourier, 34 bytes
I~No~OI~P>0{1}{@P+N(N^~NO-N~ON)Oo}
Try it online!
0
votes
Reciprocal of a number (1/x)
Fourier (Non-Competing), 79 bytes
1~RI~X<0{1}{0-1~R45a}X*R~XL*2+2/2~UX{1}{0~U}10P10/X~DL+U~p10Pp~TD/To*T~A46aD-Ao
Try it online!
This is non-competing for two reasons:
Firstly, it does not fulfi …
0
votes
Raise integer x to power x, without exponentiation built-ins
Fourier, 19 bytes
1~YI~X(Y*X~Yi^~i)Yo
Try it on FourIDE!
Multiplies Y by the input X number of times and then outputs Y.
FYI, the standard way to do this would be
I~XPXo
Where P is the power f …
1
vote
Wait, but what's e^N?
BBC BASIC - 44 bytes (with tokenisation) - 15 = 29
Put this after the END statement. Arguments are the same as
a+bi = (a,b)
Code
DEFFNf(a,b)e=EXPa:=STR$(e*COSb)+"+"+STR$(e*SINb)+"i"
Usage
imag …
0
votes
Calculate Standard Deviation
Python, 57 bytes
lambda l:(sum((x-sum(l)/len(l))**2for x in l)/len(l))**.5
Takes input as a list
Thanks @xnor
4
votes
Two Symbol Math
Python 3, 267 bytes
Thanks to @ConorO'Brien
import re
q=re.sub
g=lambda m:'--'+m.group()[1:]
h=lambda m:'/(1/'+m.group()[1:]+')'
i=lambda m:'0/'+m.group()[:-2]
print(q(r'\*[^\(\)]+',h,q(r'[^\(\)]\*0 …
3
votes
Calculate power series result
Noether, 17 bytes
I~xI(ax!i^+~ai)aP
Try it online!
Explanation
I~x - Store the input in the variable x
I( ) - Loop until the top of the stack equals the input n
a …
1
vote
Find the Factorial!
Fourier, 18 bytes
1~NI(i^~iN*i~Ni)No
Try it online!
21
votes
34
answers
3k
views
Calculate Standard Deviation
Challenge
Given a list of numbers, calculate the population standard deviation of the list.
Use the following equation to calculate population standard deviation:
Input
The input will a list of …
1
vote
1, 2, Fizz, 4, Buzz
Frink, 131 bytes
This is still to be golfed, but because the docs are bare bones, it will be golfed through experimentation
for x=1 to 100
{
if x%15==0
{
println["FizzBuzz"]
} else
{
if x%3==0
{
pri …
0
votes
1, 2, Fizz, 4, Buzz
Fourier, 81 bytes
|`Fizz`|F|`Buzz`|B1~i100(i~X%15{0}{1~XFB}X%5{0}{1~XB}X%3{0}{1~XF}X{i}{Xo}10ai^~i)
Try it on FourIDE
Who knew such a simple task would yield such a mammoth of a program!
Pseudoco …