text:
Ten-pin bowling score - World Bowling edition
World Bowling scoring
Many people have gone to their local bowling center to play a few games of bowling, and many people continue to struggle to calculate their scores.  World Bowling has introduced a simplified scoring system in order to attract more people to the sport. This scoring system is utilized in international games.
The scoring system works like this (from Wikipedia):

The World Bowling scoring system—described as "current frame scoring"[32]—awards pins as follows:

strike: 30 (regardless of ensuing rolls' results)
spare: 10 plus pinfall on first roll of the current frame
open: total pinfall for current frame

If you're not familiar with ten-pin bowling, here's a recap.
There are 10 pins at the end of a bowling lane where the goal is to knock all of them down with a bowling ball. You get 2 rolls of a ball to attempt to knock them all down, preferably knocking them all down with the first roll (known as a strike).  If you do get a strike, then that frame is completed and you do not need to roll the ball a second time.  A strike is worth 30.
If you don't knock down all ten, you get one more roll.  If you knock down all of the remaining pins, that is known as a spare. The score is worth 10 pins + the number of pins knocked down on the first roll.  For example, if I knocked down 7 pins, then managed to knock down the remaining 3, that would be worth 17.
If after your second roll you fail to knock down all ten, that is known as an open frame. The score is worth the total number of pins knocked down for that frame.
There are 10 frames in a game.  If you're familiar with traditional bowling scoring, you don't get an extra roll in the 10th frame with the World Bowling Scoring.  In traditional bowling scoring, it takes 12 consecutive strikes to get a perfect score of 300, whereas World Bowling scoring only requires 10 consecutive strikes.
Challenge
Your challenge is to calculate the score given values from a score sheet.
On a score sheet, a miss is indicated by a dash (-), a strike with an X, and a spare with a slash (/).  If these don't apply, then the pinfall count is simply indicated with a number (1-9). Fouls and splits are also recorded onto score sheets but you do not need to worry about these.
Input
You will be given a string consisting of scores for each frame, and will have a total of ten frames.  Each frame will have up to two values, or as little as 1 value if there was a strike.  Your input may be string parameter to a function, read from a file, or from STDIN.
For example, if I knocked down 1 pin on my first roll, then knocked down 2, the frame would look like "12".  This does not mean 12 (twelve), but means 1 and 2, for a total of 3.
If I missed every pin with both rolls (gutter balls), it would look like this "--" (score of 0).
Each frame will be separated by a space.
Sample input
-- 9- -9 X -/ 8/ 71 15 44 X

To break down this example,

Frame 1 (--) - both rolls missed. scored 0
Frame 2 (9-) - knocked down 9 on the first roll, missed on the second roll. Score 9
Frame 3 (-9) - Missed all on the first, got 9 on the second. Score 9
Frame 4 (X) - Strike, knocked down all ten. Score 30
Frame 5 (-/) - Spare, missed all on the first, knocked down all with 2nd roll. Score 10 + 0 = 10
Frame 6 (8/) - Spare, 8 pins on first roll, knocked down the other 2 with 2nd roll. Score 10+8 = 18
Frame 7 (71) - open frame,7 pins on first roll, 1 pin on second roll. Score 7+1=8
Frames 8,9,10 follow same examples as above.

Output
Output will simply be a value that has the sum of the scores from all 10 frames.  Using the sample input, the output will be 128.  Your output may be a string or a numeric type.  It may be a function return value, or written to STDOUT.
Rules

Assume that the input will always be valid.  For example, an invalid frame would be "/8", "XX", "123", "0", etc.
You do not need to worry about splits or fouls.
Your code may be a full program or a function that takes in a string and returns the score.
Your code must not throw any exceptions.
This is code golf, the answer with the fewest number of bytes wins.
Languages that use includes or imports must include the import statements as part of their code and count towards the byte count.

Test Cases
"-- 9- -9 X -/ 8/ 71 15 44 X" -> 128
"-- -1 2- 12 22 5- 42 61 8- 72" -> 45
"X X X 1/ 2/ 3/ 4/ 5/ -- 9/" -> 174
"X X X X X X X X X X" -> 300
"-- -- -- -- -- -- -- -- -- --" -> 0

I'm disappointed this isn't a code-bowling challenge

Your first spare example says the score would be 13, but I think it is supposed to be 17.

@Jo. Good catch. I've updated the question to fix that error.

@JoKing I was thinking this is a code-bowling challenge composed of 10 subchallenges when I first saw the title.

One of the best documented and written challenges I have seen.

05AB1E, 12 11 bytes
Code
S'/T:'X30:O

Try it online!
Explanation
S             # Split the string into a list of characters
 '/T:         # Replace '/' with 10
     'X30:    # Replace 'X' with 30
          O   # Sum up the array (ignoring non-number elements)

JavaScript, 43 bytes
f=([c,...s])=>c?({'/':10,X:30}[c]|c)+f(s):0

f=([c,...s])=>c?({'/':10,X:30}[c]|c)+f(s):0
Score(<input style="width:200px" oninput="o.value=f(this.value)" />) = <output id=o></output>

How it works
We convert each character to its point:

'X' worth 30 point
'/' worth 10 point
'1' .. '9' worth 1 .. 9 point
other characters worth 0 point

Then sum all points.
Convert
Bitwise OR operator | convert its operand to Int32 before operate. When converting to Int32, value first convert to Number (64bit float number) format, then trunk to Int32 (or converted to 0 if invalid).

ToInt32({'/':10,X:30}[c]) could be read as:

if c == '/': result is 10;
if c == 'X': result is 30;
otherwise: result is ToInt32(undefined) -> ToInt32(NaN) -> 0;

ToInt32(c) could be:

if c == '1' ... '9': result is 1 .. 9;
if c == ' ': Number(c) is 0, result is 0;
otherwise: Number(c) is NaN, result is 0;

Bitwise or here is same as "add", since one of its operand will be 0

Sum

[c,...s] = s let c = s[0], and s = s.slice(1);

if s is empty string, c is undefined;
otherwise, c is first letter of s

undefined is falsy, non-empty string (including space) is truthy

Can you explain your code? looks really good

@LuisfelipeDejesusMunoz Just added some.

Stax, 13 bytes
─*âⁿ┴8òt↨HÉ÷8

Run and debug it
Unpacked, ungolfed, and commented it's thus.
F               for each character in input, execute...
 9R$'/20*+'X+   build the string "123456789////////////////////X"
 I              get the index of the current character in string
 ^+             increment and add to running total
                (index is -1 when no match; space and dash are 0 score)

Run this one

Python 2, 55 bytes
lambda l:sum(map(('123456789/'+'X'*20).rfind,l))+len(l)

Try it online!
Based off the string-index approach of many solutions.

Java 8, 64 59 46 bytes
s->s.map(c->c<46?0:c<48?10:c>87?30:c-48).sum()

-5 bytes thanks to @Neil.
-13 bytes thanks to @OlivierGrégoire.
Explanation:
Try it online.
s->               // Method with an IntStream parameter and integer return-type
  s.map(c->       //  Loop over the characters
          c<46?   //   If the character is a space or '-':
           0      //    Count it as 0
          :c<48?  //   Else-if it's a '/':
           10     //    Count it as 10
          :c>87?  //   Else-if it's an 'X':
           30     //    Count it as 30
          :       //   Else (it's a digit):
           c-48   //    Count it as the value of the digit
       ).sum()    //   And sum everything

("123456789//"+1e6+1e6+"X") seems to save 5 bytes.

That's a clever technique to create some filler string.

46 bytes

F#, 106 103 bytes
let s c=Seq.sumBy(fun x->if x=' '||x='-'then 0 elif x='X'then 30 elif x='/'then 10 else int(string x))c

Try it online!
I think that this puzzle (without the golfing) would be a great question for a "Functional programming for beginners" guide. And I should know!
-3 from Kevin Cruijssen, for spotting that the whitespace between ' and "then" can be deleted. Thanks!
recursive's Stax solution of using string indexes is very very good. If you port it to F# you can get it for 77 bytes:
let s c=Seq.sumBy(fun x->"123456789/???????????????????X".IndexOf(char x)+1)c

Try this online!

I don't know F# very well, but it seems you can drop the spaces after ' for -3 bytes.

Neither do I! But you're right, well spotted! Thanks!

@Ciaran_McCarthy:  I don't mind if you copy my solution if you'd like to include it also.  People here are generally pretty open about this kind of thing.  It's a co-operative effort to find all the smallest code, even if it's formally a competition.

Thanks recursive. I'll include it then, because it's a very nice solution, and it's interesting to see how it looks in different languages.

Jelly, 17 bytes
ḟ⁾ -“X0/⁵”yV€o30S

A monadic link accepting a list of characters and returning an integer
Try it online!
How?
ḟ⁾ -“X0/⁵”yV€o30S - Link: list of characters
 ⁾ -              - literal list of characters [' ','-']
ḟ                 - filter discard
    “X0/⁵”        - literal list of characters ['X','0','/','⁵']
          y       - translate (change 'X's to '0's and '/'s to '⁵'s)
           V€     - evaluate €ach character as Jelly code (the '⁵'s become 10s)
             o30  - logical OR with 30 (change all instances of 0 to 30)
                S - sum

Also at 17:
”/ẋ20ØD;;”XḊiÐ€⁸S

Try that

Perl 5 -pF, 30 27 bytes
-3 bytes thanks to Xcali
#!/usr/bin/perl -pF
$\+=m%/%+3*/X/.0+$_ for@F}{

Try it online!

You can cut two bytes by using /X/ instead of y/X// and one more by using m%/% instead of y%/%%: Try it online!

@Xcali Ah, of course. Classic golf shortsightedness, I was still thinking in terms of y/// from when I did them outside a loop. Thanks

Perl 6, 30 bytes
{TR'-/X '0㉈㉊'.univals.sum}

Try it online!

Retina, 17 bytes
X
///
/
55
\d
*
_

Try it online!
I'm not quite up to date on the latest Retina changes.  I'll be looking more into them when I get a chance and seeing if there's any new tricks for golfing this down.  The code turns all strikes in to three spares, all spares into ten points, then all points to the corresponding number of underscores.  Then it counts the number of underscores.

PHP, 119 109 bytes
-10 bytes thanks to @KevinCruijssen
<?foreach(explode(" ",$argv[1])as$f){[$a,$b]=str_split($f);$n+=$f==X?30:(int)$a+($b=='/'?10:(int)$b);}echo$n;

Try it online!

You can change ($b=='/'?10+(int)$a:((int)$a+(int)$b)) to (int)$a+($b=='/'?10:(int)$b) for -10 bytes.

@KevinCruijssen Thanks, looks good! Although, looking at the other answers, looks like I am going about this the wrong/long way. :)

05AB1E, 14 bytes
þ`I…/aXS¢ƶT*`O

Try it online!
Explanation
þ`              # Push the digits of the input on the stack (removes everyting that isn't a digit)
  I…/aXS        # Push the input and the array "/","a","X" on the stack
        ¢       # Index of each element in the input ...
         ƶT*    # ... multiplied by its index (a could be anything that can't be found in the input), multiplied by 10.
            `O  # Sum the stack, implicit display

Python 2, 67 bytes
-3 bytes thanks to @KevinCruijssen
lambda I,p='-123456789/'+20*'X':sum(p.rfind(i)for i in I if i in p)

Try it online!

You can save 3 bytes by changing '-123456789'+'/'*20+'X':sum(p.index(i) to '-123456789/'+'X'*20:sum(p.rfind(i)

J, 33 bytes
1#.31|('-123456789',20 1#'/X')i.]

Try it online!
Explanation:
] the input
('-123456789',20 1#'/X') appends 20 / and one X to the string -123456789
i. finds the indices of the input in the above string
31| modulo 31 - to get rid of the spaces - they are not found in the string, so i. returns 31 for them
1#. finds the sum of the indices

Since J and Red are two completely different languages, it's better to post two separated answers, even though they might do the same. You can add a link from the Red answer to this J answer, stating it's a port of your J answer.

@Kevin Cruijssen - Ok, thanks - I'll do it. The reason for posting them together is that obviously the Red solution is non-competitive (although much readable :) )

Jelly, 12 bytes
⁾/X,“½œ‘y|0S

Try it online!
How it works
⁾/X,“½œ‘y|0S  Main link. Argument: s (string)

⁾/X,“½œ‘      Literal; yield [['/', 'X'], [10, 30]].
        y     Transliterate; replace '/' with 10, 'X' with 30.
         |0   Bitwise OR with 0. Bitwise operators attempt to cast to int, mapping
              '0', ..., '9' to 0, ..., 9. All other characters map to 0.
           S  Take the sum.

Python 3.6, 54 bytes
lambda s:sum(map(f'123456789/{6**24}X'.find,s),len(s))

Try it online!

Kotlin, 50 bytes
x->x.sumBy{"123456789/_${Math.E}_X".indexOf(it)+1}

Try it online!
Hopefully it's not against the rules to answer your own question but I wanted to join in on the fun.
Math.E produces the value 2.718281828459045. I'm using it to create some filler string to push X to position 30.
indexOf gets the position (0-based) of the character in the string "12345...". If it isn't found, it returns -1. We add 1 to make these 0, and that also makes the 0-based position the value of the string.

Charcoal, 23 bytes
ＩΣＥχΣＥＳ⎇№-/Xλ×χ⌕-//XλＩλ

Try it online! Link is to verbose version of code. Explanation:
  Ｅχ                    Map over 10 frames
      Ｓ                 Input the frame
     Ｅ                  Map over the characters
            λ           Current character
        №-/X            Search the literal string `-/X`
                    λ   Current character
               ⌕-//X    Find position in literal string `-//X`
             ×χ         Multiply by predefined variable 10
                      λ Current character
                     Ｉ  Cast to integer
       ⎇                Ternary
    Σ                   Sum for each frame
 Σ                      Sum over frames
Ｉ                       Cast to string for implicit print

Red, 93 bytes
func[b][s: 0
foreach c trim/all b[s: s - 1 + index? find{-123456789/...................X}c]s]

Try it online!

SNOBOL4 (CSNOBOL4), 169 151 147 bytes
	F =INPUT ' '
R	F '-' =0	:S(R)
T	F 'X' ='_'	:S(T)
S	F LEN(1) . X ARB . Y ' ' REM . F	:F(O)
	X '_' =30
	Y '/' =10
	S =S + X + Y	:(S)
O	OUTPUT =S
END

Try it online!
	F =INPUT ' '					;* read input and append a space
R	F '-' =0	:S(R)				;* replace - with 0
T	F 'X' ='_'	:S(T)				;* replace X with _
S	F LEN(1) . X ARB . Y ' ' REM . F	:F(O)	;* set first character to x, remainder up to ' ' to y, and remainder to F
	X '_' =20					;* replace _ in x with 20
	Y '/' =10					;* replace / in y with 10
	S =S + X + Y	:(S)				;* else X and Y are their values so we can sum them
O	OUTPUT =S					;* output the sum
END

C# (.NET Core), 40 + 18 = 58 bytes
using System.Linq;
s=>s.Sum(c=>c>87?30:c<46?0:c<48?10:c-48)

Try it online!

C# (Visual C# Interactive Compiler), 53 bytes
Write(ReadLine().Sum(c=>c>87?30:c<46?0:c<48?10:c-48))

Try it online!

Clojure, 70 bytes
#(reduce(fn[s i](+ s(case i\- 0\/ 10\X 30\space 0(bigint(str i)))))0%)

Try it online!
When reduceing over a String, each char is actually converted into a char - who would have thought. But this meany, I have to write \space and that hurts more than one can imagine. Also, when creating an actual number from a char, the combination of bigint and str seems to be the only usable combination.
Well, aside from all these struggles: Anonymous function that returns the score as a natural.

Ruby, 38 bytes
->s{s.tr("/X -",":N00").sum-s.size*48}

Try it online!

Husk, 17 bytes
+ṁi¹*10+#'/¹*3#'X

Try it online! This function takes the sum of all digit characters in the string, plus 10 times the number of / characters, plus 30 times the number of X characters.


text:
Two steps forward and one step back
Let's say I'm ten steps away from my destination. I walk there following the old saying, "Two steps forward and one step back". I take two steps forward, one back, until I'm standing exactly on my destination. (This might involve stepping past my destination, and returning to it). How many steps did I walk?
Of course, I might not be 10 steps away. I might be 11 steps away, or 100.
I could measure ten paces, and keep walking back and forth to solve the problem, or... I could write some code!

Write a function to work out how many steps it takes to get N steps away, in the sequence: two steps forward, one step back.
Assume you've started at step 0. Count the "two steps forward" as two steps, not one.
Assume all steps are a uniform length.
It should return the number of steps first taken when you reach that space. (For instance, 10 steps away takes 26 steps, but you'd hit it again at step 30). We're interested in the 26.
Use any language you like.
It should accept any positive integer as input. This represents the target step.
Smallest number of bytes win.

Example:
I want to get 5 steps away:
| | | | | | <- I'm at step 0, not yet on the grid.
| |X| | | | <- I take two steps forward, I'm on step 2: the count is 2
|X| | | | | <- I take one step back, I'm on step 1: the count is 3
| | |X| | | <- I take two steps forward, I'm on step 3: the count is 5
| |X| | | | <- I take one step back, I'm on step 2 again: the count is 6
| | | |X| | <- I take two steps forward, I'm on step 4: the count is 8
| | |X| | | <- I take one step back, I'm on step 3 again: the count is 9
| | | | |X| <- I take two steps forward, I'm on step 5: the count is 11

In this case, the result of the function would be 11.
Example results:
1      =>  3
5      =>  11
9      =>  23
10     =>  26
11     =>  29
100    =>  296
1000   =>  2996
10000  =>  29996
100000 =>  299996

Have fun, golfers!

Hmm ... this feels very familiar.

Related

@Rod Hooray! I got away with it! ;)

Yep, that looks like the one I was thinking of, @Rod.

@Shaggy Rod changed his comment a little. The earlier one noted that the snails/wells question is asking for the number of iterations, but this is asking for the distance covered.

Oasis, 5 4 bytes
1 byte saved thanks to @Adnan
3+23

Not to be confused with 23+3
Try it online!
How?
      implicitly push a(n-1)
3     push 3
 +    sum and implicitly print
  2   a(2) = 2
   3  a(1) = 3

You can leave out the b.

I think you meant to multiply with 3, not add it.

@EriktheOutgolfer The program computes a(n) as a(n-1)+3.

Python 2, 18 bytes
lambda n:3*n-1%n*4

Try it online.
I picked this trick up from xnor just a few days ago…!

Python 2, 20 bytes
lambda n:n*3-4*(n>1)

Try it online!

Python 2, 17 bytes
lambda n:n-3%~n*2

Try it online!
I found the expression by brute-force search. It effectively computes n+2*abs(n-2).

Polyglot: Java 8 / JavaScript / C# .NET, 16 14 12 bytes
n->3*n-1%n*4

Try it online (Java 8).
n=>3*n-1%n*4

Try it online (JavaScript).
Try it online (C# .NET).
Port of @Lynn's Python 2 answer, so make sure to upvote his/her answer.

Old answer:
Polyglot: Java 8 / JavaScript / C# .NET, 16 14 bytes
n->n<2?3:n*3-4

Try it online (Java 8).
n=>n<2?3:n*3-4

Try it online (JavaScript).
Try it online (C# .NET).
Explanation:
n->       // Method with integer as both parameter and return-type
  n<2?    //  If the input is 1:
   3      //   Return 3
  :       //  Else:
   n*3-4  //   Return the input multiplied by 3, and subtract 4

JavaScript polyglot, if you use a fat arrow.

@Shaggy Added, as well as C# .NET :) Although n=>(--n*3||4)-1 is also possible in JavaScript (also 14 bytes).

05AB1E, 8 7 bytes
3*s≠i4-

Try it online!
-1 byte thanks to Emigna !

3*s≠i4- saves a byte

R, 20 bytes
N=scan();3*N-4*(N>1)

Try it online!
Didn't notice the pattern until after I had implemented my less elegant solution.

Congrats on 10k BTW!

@LuisMendo thanks! I think my one-year anniversary on the site was a couple days ago, so it's been a good week for me, PPCG-wise.

@Giuseppe I know the feeling: 20k last week, as well as 2nd year anniversary. :)

Oasis, 5 bytes
¹y4-3

Explanation:
    3  defines f(1) = 3
¹y4-   defines f(n) as:
¹      push input
 y     triple
  4-   subtract four

Try it online!

Haskell, 15 bytes
f 1=3
f n=3*n-4

Try it online!

Standard ML, 16 bytes
fn 1=>3|n=>3*n-4

Try it online!

Dodos, 27 bytes
	dot D
D

	d d
	d d
d
	dip

Try it online!

Jelly, 6 bytes
++_>¡4

Try it online!

APL (Dyalog), 9 bytes
3∘×-4×1∘<

Try it online!

Prolog (SWI), 21 bytes
1*3.
X*Y:-Y is 3*X-4.

Try it online!

MATL, 7 bytes
Uses the 3*n-4*(n>1) formula. Multiply input by 3 (3*), push input again (G) and decrement it (q). If the result is not zero (?) then subtract 4 from the result (4-).
3*Gq?4-

Try it online!

6 bytes porting Dennis' Jelly answer 2-|EG+

Jelly, 4 bytes
ạ2Ḥ+

Try it online!
How it works
ạ2Ḥ+  Main link. Argument: n

ạ2    Absolute difference with 2; yield |n-2|.
  Ḥ   Unhalve/double; yield 2|n-2|.
   +  Add; yield 2|n-2|+n.

><>, 10 9 bytes
Saved 1 byte thanks to Jo King
3*:3)4*-n

Try it online!

9 bytes

@JoKing: Don't kow how I missed that. Thanks!

C (gcc), 20 bytes
f(n){n=3*n-4*!!~-n;}

Try it online!

Alternative with the same byte-count: f(n){n=n<2?3:n*3-4;}

Another alternative with the same byte count: f(n){n=n*3-4*(n>1);}

MachineCode on x86_64, 34 32 24 bytes
8d47fe9931d029d08d0447c3

Requires the i flag for integer output; input is taken via manually appending to the code.
Try it online!

I went through these 4 different C functions to find the 24-byte MachineCode program:

n+2*abs(n-2) = 8d47fe9931d029d08d0447c3 (24 bytes)
3*n-4*!!~-n = 8d047f31d2ffcf0f95c2c1e20229d0c3 (32 bytes)
n*3-4*(n>1) = 31d283ff028d047f0f9dc2c1e20229d0c3 (34 bytes)
n<2?3:n*3-4 = 83ff01b8030000007e068d047f83e804c3 (34 bytes)

so what exactly is this language?

@qwr Check out the README in the repository for a simple description.

65816 machine code, 22 bytes
I could have made this 65C02 machine code easily for 3 bytes less, but didn't, since the register size on the 65C02 is 8-bit instead of 16-bit. It would work, but it's boring because you can only use really low numbers ;-)
xxd dump:
00000000: 7aa9 0000 aa89 0100 d004 8888 e824 c8e8  z............$..
00000010: 1ac0 0000 d0ef                           ......

disassembly / code explanation:
; target is on the stack
  ply              7A                  ; pull target from stack
  lda #$0000       A9 00 00            ; set loop counter to 0
  tax              AA                  ; set step counter to 0
loop:
  bit #$0001       89 01 00            ; sets Z if loop counter is even
  bne odd          D0 04               ; if Z is not set, jump to 'odd'
  dey              88                  ; decrement target twice
  dey              88
  inx              E8                  ; increment step counter
  .byte $24        24                  ; BIT $xx opcode, effectively skips the next byte
odd:
  iny              C8                  ; increment target

  inx              E8                  ; increment step counter
  inc a            1A                  ; increment loop counter

  cpy #$0000       C0 00 00            ; sets zero flag, can be optimized maybe?
  bne loop         D0 EF               ; if Y is non-zero, loop

; result is in register X

Testing it out on a 65816-compatible emulator:

4, 54 bytes
3.6010160303604047002020003100000180010202046000095024

Try it online!
If you question the input method, please visit first the numerical input and output may be given as a character code meta post.

Why was this downvoted?

Because the answer appears to be one quarter, which isn't a valid result. As far as I can tell, it doesn't solve the problem.

@AJFaraday it uses byte input and output, which is valid by meta consensus. see the explanation inside the input section

Any resources on how to interpret the result? Or the input?

@AJFaraday the char code of the result is the answer. I've edited the question to include the relevant meta post. 4 has only char input.

Japt, 7 bytes
A port of Lynn's Python solution.
*3É%U*4

Try it

Alternative
This was a fun alternative to the closed formula solutions that is, unfortunately, a byte longer:
_+3}gN³²

Try it

TI-Basic, 8 bytes
3Ans-4(Ans>1

05AB1E, 4 bytes
Uses the abs-method from Dennis' Jelly answer
2α·+

Try it online!
Explanation
2α      # abs(input, 2)
  ·     # multiply by 2
   +    # add input

MATLAB/Octave, 15 bytes
@(n)3*n-4*(n>1)

Try it online!
Kind of surprised there isn't already a MATLAB answer. Same algorithm of 3*n-4 if greater than 1, or 3*n otherwise.

Brain-Flak, 38 bytes
({<([()()]{})>()(){(<((){})>)()}{}}{})

Try it online!
The first answer I see to calculate the answer by stepping back and forth.
({ while not at 0
  <([()()]{})>()() take two steps forward, counting 2 steps
  {(<((){})>)()}{} take one step back, if not at 0, and add 1 step
}{}) remove the 0 and push step sum

Python 3, 48 bytes
def a(x):
    if x!=1:
        return((3*x)-4)
    return(3)

Try It Online!

Nice work. You might want to put some code in the “Footer” section, too. That way you can test your function without padding out your golf entry...

@AJFaraday The footer of my post or of my code?

On Try It Online; you can add a footer which runs with your code but doesn’t count towards the byte length. Then the output will show your code at work.

25 bytes

@JoKing Do you know of a good guide to lambda functions in Python? I really don't understand how the syntax works.

The variables directly after the lambda are equivalent to def e.g. a=lambda x,y is the same as def a(x,y). Imagine there's also a return directly after the :, and other than that it's basically the same. def a(x,y): return x+y is the same as a=lambda x,y: x+y

How do the brackets work? Are they if statement equivalents? If not, can you do ifs and loops in a lambda function?

It's a list of two elements, where the conditional returns True/False which is equivalent to 1/0, deciding which element is returned. A less golfier, but more readable construction is to use an inline if e.g. Try it online!. If you want to check out more python golfing tips, check out this question

SHELL , 28 Bytes
F(){ bc<<<$1*3-$(($1>1))*4;}

Tests :
F 1
3

F 2
2

F 3
5

F 4
8

F5
11

F 11
29

F 100
296

F 100000
299996

Explanation :
The formula is :
if n == 1  ==> F(1) = 3
else F(n) = 3*n - 4

following the sequence of 3 steps  "Two steps forward and one step back", we will have the arithmetic series :
 +2  2 => 2  ( or 6 )
 -1  1 => 3
 -----------
 +2  3 => 5  ( or 9 )
 -1  2 => 6
 -----------
 +2  4 => 8  ( or 12 )
 -1  3 => 9
 -----------
 +2  5 => 11 ( or 15 )
 -1  4 => 12
 -----------
 +2  6 => 14 ( or 18 )
 -1  5 => 15
 -----------
 +2  7 => 17 ( or 21 )
 -1  6 => 18

At the minimum, or first coincidence :
 1 => 3
 2 => 2
 3 => 5
 4 => 8
 5 => 11
 6 => 14

in one formula :
F(n) = 3*n - 4(n>1)     with n>1 is 1 or 0 (if n==1)

please describe which shell this is

tested on Cygwin ( CYGWIN_NT-10.0 2.3.1(0.291/5/3) 2015-11-14 12:44 x86_64 Cygwin)

can you write it in bc directly?

I'm not familiar with bc, but since the argument of the function ($1) is used several times and some shell-specific stuff (arithmetic expansion, $((…))) is done, probably not.

F(){bc<<<$1*3-$(($1>1))*4} works in zsh though and removes 2 bytes

J, 9 bytes
3&*-4*1&<

Try it online!

W d, 7 bytes
♦óÖ╣░Θ$

Explanation
3*1a<4*-

Evaluates (a*3)-4*(a>1).
Another possible alternative
3*1am4*-

Evaluates (a*3)-4*(1%a).

Ruby, 14 bytes
->n{3*n-1%n*4}

Try it online!
Uses the 1%1==0 trick as seen in other answers here.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Levi-Civita symbol
The three-dimensional Levi-Civita symbol is a function f taking triples of numbers (i,j,k) each in {1,2,3}, to {-1,0,1}, defined as:

f(i,j,k) = 0 when i,j,k are not distinct, i.e. i=j or j=k or k=i
f(i,j,k) = 1 when (i,j,k) is a cyclic shift of (1,2,3), that is one of (1,2,3), (2,3,1), (3,1,2).
f(i,j,k) = -1 when (i,j,k) is a cyclic shift of (3,2,1), that is one of (3,2,1), (2,1,3), (1,3,2).

The result is the sign of a permutation of (1,2,3), with non-permutations giving 0. Alternatively, if we associate the values 1,2,3 with orthogonal unit basis vectors e_1, e_2, e_3, then f(i,j,k) is the determinant of the 3x3 matrix with columns e_i, e_j, e_k.
Input
Three numbers each from {1,2,3} in order. Or, you may choose to use zero-indexed {0,1,2}.
Output
Their Levi-Civita function value from {-1,0,1}. This is code golf.
Test cases
There are 27 possible inputs.
(1, 1, 1) => 0
(1, 1, 2) => 0
(1, 1, 3) => 0
(1, 2, 1) => 0
(1, 2, 2) => 0
(1, 2, 3) => 1
(1, 3, 1) => 0
(1, 3, 2) => -1
(1, 3, 3) => 0
(2, 1, 1) => 0
(2, 1, 2) => 0
(2, 1, 3) => -1
(2, 2, 1) => 0
(2, 2, 2) => 0
(2, 2, 3) => 0
(2, 3, 1) => 1
(2, 3, 2) => 0
(2, 3, 3) => 0
(3, 1, 1) => 0
(3, 1, 2) => 1
(3, 1, 3) => 0
(3, 2, 1) => -1
(3, 2, 2) => 0
(3, 2, 3) => 0
(3, 3, 1) => 0
(3, 3, 2) => 0
(3, 3, 3) => 0

Related.

Jelly, 5 bytes
ṁ4IṠS

Try it online!
Algorithm
Let's consider the differences j-i, k-j, i-k.

If (i, j, k) is a rotation of (1, 2, 3), the differences are a rotation of (1, 1, -2). Taking the sum of the signs, we get 1 + 1 + (-1) = 1.
If (i, j, k) is a rotation of (3, 2, 1), the differences are a rotation of (-1, -1, 2). Taking the sum of the signs, we get (-1) + (-1) + 1 = -1.
For (i, i, j) (or a rotation), where i and j may be equal, the differences are (0, j-i, i-j). The signs of j-i and i-j are opposite, so the sum of the signs is 0 + 0 = 0.

Code
ṁ4IṠS  Main link. Argument: [i, j, k]

ṁ4     Mold 4; yield [i, j, k, i].
  I    Increments; yield [j-i, k-j, i-k].
   Ṡ   Take the signs, replacing 2 and -2 with 1 and -1 (resp.).
    S  Take the sum.

Beautiful--surely this was xnor's intended algorithm.

Python 2, 32 bytes
lambda i,j,k:(i-j)*(j-k)*(k-i)/2

Try it online!
Algorithm
Let's consider the differences i-j, j-k, k-i.

If (i, j, k) is a rotation of (1, 2, 3), the differences are a rotation of (-1, -1, 2). Taking the product, we get (-1) × (-1) × 2 = 2.
If (i, j, k) is a rotation of (3, 2, 1), the differences are a rotation of (1, 1, -2). Taking the product, we get 1 × 1 × (-2) = -2.
For (i, i, j) (or a rotation), where i and j may be equal, the differences are (0, i-j, j-i). Taking the product, we get 0 × (i-j) × (j-i) = 0.

Thus, dividing the product of the differences by 2 yields the desired result.

x86, 15 bytes
Takes arguments in %al, %dl, %bl, returns in %al. Straightforward implementation using Dennis's formula.
 6: 88 c1                   mov    %al,%cl
 8: 28 d0                   sub    %dl,%al
 a: 28 da                   sub    %bl,%dl
 c: 28 cb                   sub    %cl,%bl
 e: f6 e3                   mul    %bl
10: f6 e2                   mul    %dl
12: d0 f8                   sar    %al
14: c3                      retq

Aside: I think I understand why %eax is the "accumulator" now...

I think you meant sar not shr.

@Jester good catch. fixed

Wolfram Language (Mathematica), 9 bytes
Signature

Try it online!

Wolfram Language (Mathematica), 18 bytes
Saved 2 bytes thanks to Martin Ender.
Det@{#^0,#,#^2}/2&

Try it online!

builtins are no fun

The Vandermonde determinant is nice.  There's also Det@IdentityMatrix[3][[#]]& (longer, but fewer tokens).

#^1 is just # ;)

Octave, 20 bytes
@(v)det(eye(3)(:,v))

Pretty direct implementation of the determinant formula. Permutes the columns of the identity matrix then takes the determinant.

Haskell, 26 bytes
(x#y)z=(x-y)*(y-z)*(z-x)/2

Try it online!
Nasty IEEE floats...

APL (Dyalog), 11 9 bytes
2 bytes saved thanks to @ngn
+/×2-/4⍴⎕

Try it online!

as a complete program it's 9 bytes: +/×2-/4⍴⎕

JavaScript (ES6), 38 bytes
Overcomplicated but fun:
(a,b,c,k=(a+b*7+c*13)%18)=>k-12?+!k:-1

Try it online!

JavaScript (ES6), 28 bytes
Using the standard formula:
(a,b,c)=>(a-b)*(b-c)*(c-a)/2

Try it online!

05AB1E, 7 5 bytes
1 byte saved thanks to @Emigna
ĆR¥P;

Try it online!

Ć instead of 4∍ saves a byte.

Ruby, 28 bytes
->a,b,c{(a-b)*(b-c)*(c-a)/2}

Try it online!

CJam (16 bytes)
1q~{)1$f-@+:*\}h

Online demo. Note that this is based on a previous answer of mine which uses the Levi-Civita symbol to calculate the Jacobi symbol.

Ruby, 56 bytes
->t{t.uniq!? 0:(0..2).any?{|r|t.sort==t.rotate(r)}?1:-1}

Try it online!
Once we rule out cases where the values of the triplet are not unique, t.sort is equivalent to (and shorter than) [1,2,3] or [*1..3]
->t{
  t.uniq! ? 0                     # If applying uniq modifies the input, return 0
          : (0..2).any?{|r|       # Check r from 0 to 2:
              t.sort==t.rotate(r) #   If rotating the input r times gives [1,2,3],
            } ? 1                 #     return 1;
              :-1                 #     else return -1
}

Husk, 7 bytes
ṁ±Ẋ-S:←

Try it online!
Explanation
Straight port of Dennis's Jelly answer. S:← copies the head of the list to the end, Ẋ- takes adjacent differences, and ṁ± takes the sign of each element and sums the result.

Jelly, 8 bytes
⁼QȧIḂÐfḢ

Try it online!
Seems too ungolfed. :(

SHELL, 44 Bytes
 F(){ bc<<<\($2-$1\)*\($3-$1\)*\($3-$2\)/2;}

tests :
 F 1 2 3
 1

 F 1 1 2
 0

 F  2 3 1
 1

 F 3 1 2
 1

 F 3 2 1
 -1

 F 2 1 3
 -1

 F 1 3 2
 -1

 F 1 3 1
 0

Explanation :
 The formula is : ((j - i)*(k - i)*(k - j))/2

BC, 42 Bytes
 define f(i,j,k){return(j-i)*(k-i)*(k-j)/2}

tests:
 f(3,2,1)
 -1
 f(1,2,3)
 1
 f(1,2,1)
 0

Is it possible just to claim the language as bc to avoid the extraneous call/function declaration?

In which shell does this work?

Japt, 7 bytes
änUÌ xg

Try it

Explanation
            :Implicit input of array U
ä           :Get each consecutive pair of elements
 n          :Reduce by subtracting the first from the last
  UÌ        :But, before doing that, prepend the last element in U
     g      :Get the signs
    x       :Reduce by addition

Alternative
Takes input as individual integers.
NänW ×z

Try it

Add++, 13 bytes
L,@dV@GÑ_@€?s

Try it online!

Stax, 8 bytes
äN§lüy²Å

Run and debug it
Translates to -(b-a)(c-b)(a-c)/2.

J, 12 bytes
1#.2*@-/\4$]

Try it online!
Direct translation of Uriel's APL solution into J.
Explanation:
4$] Extends the list with its first item
2  /\ do the following for all the overlapping pairs in the list:
*@- find the sign of their difference
1#. add up

I'll leave this Vandermonde-determinant-based solution here as a comment in case anyone can figure out how to golf it down: (-/ .*)@:(^&(i.3)"0)%2:

Java 8, 28 bytes
(i,j,k)->(i-j)*(j-k)*(k-i)/2

Port of @Dennis' Python 2 answer.
Try it online.

Python, 33 bytes
lambda i,j,k:(i^j!=k or-~j-i)%3-1

Try it online!
I tried for a while to beat the product-of-differences approach, but the best I got was 1 byte longer.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Work out root(x, n)
Given integers 0<x<10106 and 0<n<106, work out x(1/n) under 15 seconds(TIO or your computer), 1GB memory. You can assume the result is integer smaller than 50000.
Shortest code in bytes in each language win.
Sample:
x     n     result
121   2     11
123   1     123
1024  10    2

A larger sample can be seen here

I'm trying to find a dupe but surprisingly it looks like none exist

I think you should remove the time limit

@dylnan without the time-limit, the question would be pretty boring. (Not saying that it is particularly interesting to begin with)

You really need to start posting your challenges in the Sandbox first. This is your fourth in two days, only one of which currently has a positive score. You can choose not to, it's entirely optional, but if you do not, be warned that you may become question-banned if you continue posting challenges without refining them first.

In addition to caird coinheringaahing's suggestion, PPCG is indeed a site dedicated to programming challenges, but we want this site to have good challenges. It seems like many of your questions are of low quality (don't get me wrong; the challenges themselves are valid. The way they're presented, however, is insufficient). The Sandbox will help you refine your post, as well as provide some insights that may even improve your challenge. Although it is not a requirement, I strongly recommend that you start using the Sandbox.

@JungHwanMin That'd be the different definition of quality

@l4m2 Perhaps, we have different notions of "quality." I hope you understand that we are not making these suggestions for no reason (we care about your challenges; otherwise, we wouldn't even comment). Also, what I (and some other PPCG users) don't understand is your refusal to use the Sandbox. One does not lose anything by first posting to the Sandbox to refine a challenge, other than the fact that there might be a 2-3 day waiting time to make sure the challenge is ready to be posted.

It is not that you have not used Sandbox before. In fact you have used it quite recently. So it makes it even more difficult to understand why you refuse to use it for some challenges.

@JungHwanMin Also some "low quality" is to bypass unclear vote spammer, for it's sometimes hard to prove a high quality one be clear

Thus that's what you pushed in a wrong way

@l4m2 I don't quite understand what you are intending to say. If you intend to argue that all of the downvotes you have received are from "unclear vote spammers" who are trying to bypass the site rules, I am afraid this site might not be fit for you. I did indeed downvote this challenge, but for a good reason: it is low quality. By "low quality," I mean that, while the challenge contains all necessary information, it does not show signs of careful consideration, such as nice organization, reasonable rules, and clear explanations.

@JungHwanMin "unclear vote spammers" is not for downvoters, but for close voters. Actually there're downvote spammer, but the percent is not that high XD

Since "low quality" may have no clear border while "clear" have a clearer one

@l4m2 Let us not get off-topic and return to our main suggestion/question. Regardless of how we think of "quality" differently, it is pretty clear that this post is not well-constructed (in PPCG standards), as shown by the downvotes. Please do utilize the Sandbox! Please! (To note, this question has no close votes. Moreover, close votes are available only to users with more than a certain amount of reputation points, so it would be a misnomer to call them "spammers;" they care about PPCG enough to distinguish what posts to close and what not to)

Pari/GP, 12 bytes
x->n->x^n^-1

Try it online!
All test cases, including the sample test case (1234^123456) and case x=10^10^6-1 & n=10^6-1, finish in under 50ms.

JavaScript (Node.js), 59 bytes
n=>x=>10**((x.length+Math.log10('.'+x.slice(0,99)))/n)+.5|0

Try it online!

The formula with log (in your comment) seems to provide incorrect results. I think it should be log10.

If bit more time, n=>x=>10**((x.length+Math.log10('.'+x))/n)+.5|0 works


text:
Permutations such that no k+2 points fall on any polynomial of degree k
Description
Let a permutation of the integers {1, 2, ..., n} be called minimally interpolable if no set of k+2 points (together with their indices) fall on a polynomial of degree k.
That is,

No two points fall on a horizontal line (0-degree polynomial)
No three points fall on a line (1-degree polynomial)
No four points fall on a parabola (2-degree polynomial)
Et cetera.

Challenge
Write a program that computes OEIS sequence A301802(n), the number of minimally interpolable permutations of {1, 2, ..., n} for n as a large as possible.

Scoring
I will time your code on my computer (2.3 GHz Intel Core i5, 8 GB RAM) with increasing inputs. Your score will be the greatest input that takes less than 1 minute to output the correct value.

Example
For example, the permutation [1, 2, 4, 3] is minimally interpolable because
the terms together with their indices
[(1, 1), (2, 2), (3, 4), (4, 3)]
have the property that
  (0) No two points have the same y-value.
  (1) No three points lie on a line.
  (2) No four points lie on a parabola.

In the illustration, you can see that the horizontal lines (red) have at most one point on them, the lines (blue) have at most two points on them, and the parabolas (green) have three points on them.

Data
Here are the minimally interpolable permutations for n=3, n=4, and n=5:
n = 3: [1,3,2],[2,1,3],[2,3,1],[3,1,2]
n = 4: [1,2,4,3],[1,3,2,4],[1,3,4,2],[1,4,2,3],[2,1,3,4],[2,1,4,3],[2,3,1,4],[2,4,1,3],[2,4,3,1],[3,1,2,4],[3,1,4,2],[3,2,4,1],[3,4,1,2],[3,4,2,1],[4,1,3,2],[4,2,1,3],[4,2,3,1],[4,3,1,2]
n = 5: [1,2,5,3,4],[1,3,2,5,4],[1,3,4,2,5],[1,4,2,3,5],[1,4,3,5,2],[1,4,5,2,3],[1,4,5,3,2],[1,5,3,2,4],[2,1,4,3,5],[2,3,1,4,5],[2,3,5,1,4],[2,3,5,4,1],[2,4,1,5,3],[2,4,3,1,5],[2,4,5,1,3],[2,5,1,3,4],[2,5,1,4,3],[2,5,3,4,1],[2,5,4,1,3],[3,1,4,5,2],[3,1,5,2,4],[3,1,5,4,2],[3,2,5,1,4],[3,2,5,4,1],[3,4,1,2,5],[3,4,1,5,2],[3,5,1,2,4],[3,5,1,4,2],[3,5,2,1,4],[4,1,2,5,3],[4,1,3,2,5],[4,1,5,2,3],[4,1,5,3,2],[4,2,1,5,3],[4,2,3,5,1],[4,2,5,1,3],[4,3,1,2,5],[4,3,1,5,2],[4,3,5,2,1],[4,5,2,3,1],[5,1,3,4,2],[5,2,1,3,4],[5,2,1,4,3],[5,2,3,1,4],[5,2,4,3,1],[5,3,2,4,1],[5,3,4,1,2],[5,4,1,3,2]

If my program is correct, the first few values of a(n), the number of minimally interpolable permutations of {1, 2, ..., n}:
a(1) = 1
a(2) = 2
a(3) = 4
a(4) = 18
a(5) = 48
a(6) = 216
a(7) = 584
a(8) = 2870

Nice sequence number! | Although you specified [tag:fastest-code], you didn't specify which machine is it fastest on. What is exactly the winning criteria?

To add to user202729's comment, I suggest some tags that you can use to determine the winning criteria: [tag:fastest-code] requires that submissions be tested on the same machine to compare the runtime (usually the OP of the challenge does this). [tag:fastest-algorithm] would ask answerers to come up with code with the lowest time complexity as possible. [tag:code-golf] would ask users to come up with code with the shortest source code (or equivalent) as possible. Other than that, this is indeed a nice challenge.

Your example text uses zero-indexing though the image uses one-indexing.

Since all points are defined by permuations of the first natural numbers, is it not impossible for any two points to occupy the same height?

@JonathanFrech, indeed, it should be 1-indexed because these are permutations. And you're correct! Because we're dealing with permutations, the 0-degree polynomial condition comes for free.

I confirm those eight terms. You could add the term a(0) = 1. For reference, how long does your program take to calculate a(8)? I'm at 11 seconds, and 144 seconds for a(9) = 10408. Now to start optimising...

My implementation takes 2.63 seconds to compute a(7) and 29.9 seconds to compute a(8).

C#
using System;
using System.Diagnostics;
using BigInteger = System.Int32;

namespace Sandbox
{
    class PPCG160382
    {
        public static void Main(params string[] args)
        {
            if (args.Length != 0)
            {
                foreach (var arg in args) Console.WriteLine(CountValidPerms(int.Parse(arg)));
            }
            else
            {
                int[] smallValues = new int[] { 1, 1, 2, 4, 18, 48 };
                for (int n = 0; n < smallValues.Length; n++)
                {
                    var observed = CountValidPerms(n);
                    var expected = smallValues[n];
                    Console.WriteLine(observed == expected ? $"{n}: Ok" : $"{n}: expected {expected}, observed {observed}, error {observed - expected}");
                }
                for (int n = smallValues.Length; n < 13; n++)
                {
                    Stopwatch sw = new Stopwatch();
                    sw.Start();
                    Console.WriteLine($"{n}: {CountValidPerms(n)} in {sw.ElapsedMilliseconds}ms");
                }
            }
        }

        private static long CountValidPerms(int n)
        {
            // We work on the basis of exclusion by extrapolation.
            var unused = (1 << n) - 1;
            var excluded = new int[n];
            int[] perm = new int[n];

            // Symmetry exclusion: perm[0] < (n+1) / 2
            if (n > 1) excluded[0] = (1 << n) - (1 << ((n + 1) / 2));

            long count = 0;
            CountValidPerms(ref count, perm, 0, unused, excluded);
            return count;
        }

        private static void CountValidPerms(ref long count, int[] perm, int off, int unused, int[] excluded)
        {
            int n = perm.Length;
            if (off == n)
            {
                count += CountSymmetries(perm);
                return;
            }

            // Quick-aborts
            var completelyExcluded = excluded[off];
            for (int i = off + 1; i < n; i++)
            {
                if ((unused & ~excluded[i]) == 0) return;
                completelyExcluded &= excluded[i];
            }
            if ((unused & completelyExcluded) != 0) return;

            // Consider each unused non-excluded value as a candidate for perm[off]
            var candidates = unused & ~excluded[off];
            for (int val = 0; candidates > 0; val++, candidates >>= 1)
            {
                if ((candidates & 1) == 0) continue;

                perm[off] = val;

                var nextUnused = unused & ~(1 << val);

                var nextExcluded = (int[])excluded.Clone();
                // For each (non-trivial) subset of smaller indices, combine with off and extrapolate to off+1 ... excluded.Length-1
                if (off < n - 1 && off > 0)
                {
                    var points = new Point[off + 1];
                    var denoms = new BigInteger[off + 1];
                    points[0] = new Point { X = off, Y = perm[off] };
                    denoms[0] = 1;
                    ExtendExclusions(perm, off, 0, points, 1, denoms, nextExcluded);
                }

                // Symmetry exclusion: perm[0] < perm[-1] < n - 1 - perm[0]
                if (off == 0 && n > 1)
                {
                    nextExcluded[n - 1] |= (1 << n) - (2 << (n - 1 - val));
                    nextExcluded[n - 1] |= (2 << val) - 1;
                }

                CountValidPerms(ref count, perm, off + 1, nextUnused, nextExcluded);
            }
        }

        private static void ExtendExclusions(int[] perm, int off, int idx, Point[] points, int numPoints, BigInteger[] denoms, int[] excluded)
        {
            if (idx == off) return;

            // Subsets without
            ExtendExclusions(perm, off, idx + 1, points, numPoints, denoms, excluded);

            // Just add this to the subset
            points[numPoints] = new Point { X = idx, Y = perm[idx] };
            denoms = (BigInteger[])denoms.Clone();
            // Update invariant: denoms[s] = prod_{t != s} points[s].X - points[t].X
            denoms[numPoints] = 1;
            for (int s = 0; s < numPoints; s++)
            {
                denoms[s] *= points[s].X - points[numPoints].X;
                denoms[numPoints] *= points[numPoints].X - points[s].X;
            }
            numPoints++;

            for (int target = off + 1; target < excluded.Length; target++)
            {
                BigInteger prod = 1;
                for (int t = 0; t < numPoints; t++) prod *= target - points[t].X;

                Rational sum = new Rational(0, 1);
                for (int s = 0; s < numPoints; s++) sum += new Rational(prod / (target - points[s].X) * points[s].Y, denoms[s]);

                if (sum.Denom == 1 && sum.Num >= 0 && sum.Num < excluded.Length) excluded[target] |= 1 << (int)sum.Num;
            }

            // Subsets with
            ExtendExclusions(perm, off, idx + 1, points, numPoints, denoms, excluded);
        }

        private static int CountSymmetries(int[] perm)
        {
            if (perm.Length < 2) return 1;

            int cmp = 0;
            for (int i = 0, j = perm.Length - 1; i <= j; i++, j--)
            {
                cmp = perm.Length - 1 - perm[i] - perm[j];
                if (cmp != 0) break;
            }

            return cmp > 0 ? 4 : cmp == 0 ? 2 : 0;
        }

        public struct Point
        {
            public int X;
            public int Y;
        }

        public struct Rational
        {
            public Rational(BigInteger num, BigInteger denom)
            {
                if (denom == 0) throw new ArgumentOutOfRangeException(nameof(denom));

                if (denom < 0) { num = -num; denom = -denom; }

                var g = _Gcd(num, denom);
                Num = num / g;
                Denom = denom / g;
            }

            private static BigInteger _Gcd(BigInteger a, BigInteger b)
            {
                if (a < 0) a = -a;
                if (b < 0) b = -b;
                while (a != 0)
                {
                    var tmp = b % a;
                    b = a;
                    a = tmp;
                }
                return b;
            }

            public BigInteger Num;
            public BigInteger Denom;

            public static Rational operator +(Rational a, Rational b) => new Rational(a.Num * b.Denom + a.Denom * b.Num, a.Denom * b.Denom);
        }
    }
}

Takes values of n as command-line arguments, or if run without arguments times itself up to n=10. Compiling as "Release" in VS 2017 and running on an Intel Core i7-6700 I calculate n=9 in 1.2 seconds, and n=10 in 13.6 seconds. n=11 is just over 2 minutes.
FWIW:
n    a(n)
9    10408
10   45244
11   160248
12   762554

Rust
\$\color{red}{\text{I was trying to rewrite @Peter Taylor's C# answer in Rust. But the Rust code here has some mistakes.}}\$
Any help would be appreciated.
src/main.rs
use std::time::Instant;
use num_bigint::BigInt;
use num_traits::Zero;
use num_traits::One;
use num_traits::Signed;
use num_traits::ToPrimitive;

#[derive(Clone, Copy)]
struct Point {
    x: i32,
    y: i32,
}

#[derive(Clone)]
struct Rational {
    num: BigInt,
    denom: BigInt,
}

impl Rational {
    fn new(num: BigInt, denom: BigInt) -> Self {
        let g = gcd(num.clone(), denom.clone());
        Rational { num: num / g.clone(), denom: denom / g }
    }
}

impl std::ops::Add for Rational {
    type Output = Rational;

    fn add(self, other: Rational) -> Rational {
        let self_denom_clone = self.denom.clone();
        Rational::new(self.num.clone() * other.denom.clone() + self_denom_clone * other.num.clone(),
            self.denom * other.denom.clone())
    }

}

fn main() {
    let args: Vec<String> = std::env::args().collect();
    if args.len() > 1 {
        for arg in &args[1..] {
            let n = arg.parse::<i32>().unwrap();
            println!("{}", count_valid_perms(n));
        }
    } else {
        let small_values = vec![1, 1, 2, 4, 18, 48];
        for n in 0..small_values.len() {
            let observed = count_valid_perms(n as i32);
            let expected = small_values[n];
            if observed == expected {
                println!("{}: Ok", n);
            } else {
                println!("{}: expected {}, observed {}, error {}", n, expected, observed, observed - expected);
            }
        }
        for n in small_values.len()..13 {
            let start = Instant::now();
            println!("{}: {} in {}ms", n, count_valid_perms(n as i32), start.elapsed().as_millis());
        }
    }
}

fn gcd(a: BigInt, b: BigInt) -> BigInt {
    let mut a = a;
    let mut b = b;
    while !a.is_zero() {
        let tmp = b.clone() % a.clone();
        b = a;
        a = tmp;
    }
    b.abs()
}

fn count_valid_perms(n: i32) -> i64 {
    let unused = (1 << n) - 1;
    let mut excluded = vec![0; n as usize];
    let mut perm = vec![0; n as usize];
    if n > 1 { excluded[0] = (1 << n) - (1 << ((n + 1) / 2)); }
    let mut count: i64 = 0;
    count_valid_perms_recursive(&mut count, &mut perm, 0, unused, &mut excluded);
    count
}

// fn count_valid_perms_recursive(count: &mut i64, perm: &mut Vec<i32>, off: i32, mut unused: i32, excluded: &mut Vec<i32>) {
fn count_valid_perms_recursive(count: &mut i64, perm: &mut Vec<i32>, off: i32, unused: i32, excluded: &mut Vec<i32>) {

    let n = perm.len();
    if off == n as i32 {
        *count += count_symmetries(perm);
        return;
    }
    let mut completely_excluded = excluded[off as usize];
    for i in (off + 1)..n as i32 {
        if (unused & !excluded[i as usize]) == 0 { return; }
        completely_excluded &= excluded[i as usize];
    }
    if (unused & completely_excluded) != 0 { return; }
    let mut candidates = unused & !excluded[off as usize];
    for val in 0.. {
        if candidates > 0 {
            candidates >>= 1;
            if (candidates & 1) == 0 { continue; }
            perm[off as usize] = val;
            let next_unused = unused & !(1 << val);
            let mut next_excluded = excluded.clone();
            if off < n as i32 - 1 && off > 0 {
                let mut points = vec![Point { x: 0, y: 0 }; (off + 1) as usize];
                let mut denoms = vec![BigInt::one(); (off + 1) as usize];
                points[0] = Point { x: off, y: perm[off as usize] };
                extend_exclusions(perm, off, 0, &mut points, 1, &mut denoms, &mut next_excluded);
            }
            if off == 0 && n > 1 {
                next_excluded[n - 1] |= (1 << n) - (2 << (n - 1 - (val as usize)));
                next_excluded[n - 1] |= (2 << val) - 1;
            }
            count_valid_perms_recursive(count, perm, off + 1, next_unused, &mut next_excluded);
        } else {
            break;
        }
    }
}

fn extend_exclusions(perm: &mut Vec<i32>, off: i32, idx: i32, points: &mut Vec<Point>, num_points: usize, denoms: &mut Vec<BigInt>, excluded: &mut Vec<i32>) {
    if idx == off { return; }
    extend_exclusions(perm, off, idx + 1, points, num_points, denoms, excluded);
    points[num_points] = Point { x: idx, y: perm[idx as usize] };
    let denoms_clone = denoms.clone();
    denoms[num_points] = BigInt::one();
    for s in 0..num_points {
        denoms[s] *= BigInt::from(points[s].x - points[num_points].x);
        denoms[num_points] *= BigInt::from(points[num_points].x - points[s].x);
    }
    let num_points = num_points + 1;
    for target in ((off + 1) as usize)..excluded.len() {
        let mut prod = BigInt::one();
        for t in 0..num_points {
            prod *= BigInt::from(target as i32 - points[t].x);
        }
        let mut sum = Rational { num: BigInt::zero(), denom: BigInt::one() };
        for s in 0..num_points {
            let prod_s = prod.clone() / BigInt::from(target as i32 - points[s].x) * BigInt::from(points[s].y);
            sum = sum + Rational::new(prod_s, denoms_clone[s].clone());
        }
        if sum.denom == BigInt::one() && sum.num >= BigInt::zero() && sum.num.to_usize().unwrap() < excluded.len() {
            excluded[target as usize] |= 1 << sum.num.to_usize().unwrap();
        }
    }
    extend_exclusions(perm, off, idx + 1, points, num_points, denoms, excluded);
}

fn count_symmetries(perm: &Vec<i32>) -> i64 {
    if perm.len() < 2 { return 1; }
    let mut cmp = 0;
    let (mut i, mut j) = (0, perm.len() - 1);
    while i <= j {
        cmp = perm.len() as i32 - 1 - perm[i] - perm[j];
        if cmp != 0 { break; }
        i += 1; j -= 1;
    }
    match cmp {
        cmp if cmp > 0 => 4,
        cmp if cmp == 0 => 2,
        _ => 0,
    }
}

Cargo.toml
[package]
name = "rust_hello"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
num-bigint = "0.4.2"
num-traits = "0.2.14"

Build and running
# win10 environment

$ cargo build
$ target\debug\rust_hello.exe
0: Ok
1: expected 1, observed 0, error -1
2: expected 2, observed 0, error -2
3: expected 4, observed 8, error 4
4: expected 18, observed 36, error 18
5: expected 48, observed 124, error 76
6: 1008 in 100ms
7: 5024 in 1864ms
8: 64224 in 57079ms
```

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Ticking Quine-Bomb!
Challenge:
Create a program or function that takes an integer input, which outputs a new program/function as specified below.
Input:
Integer n: Time in seconds before the Time Bomb explodes.
Output:
The original program which had the time in seconds n as input, will output a new program/function that does the following:

Has n seconds passed since the previous program was run? Print BOOM!
Else: Print a program/function which, when run itself, resets the timer back to n seconds (and acts the same as the first outputted program/function).

NOTE: It is not exactly the same as the first outputted program/function (in most languages at least), because the starting time has changed (see clarification example below).
Pseudo-code Example:
Let's say the original program is ABC and the input is 60 seconds:
ABC & 60 outputs DEF(60).

If DEF(60) is run within 60 seconds, it will output DEF_G(60), which acts exactly the same as DEF(60), but with a new starting time.
If DEF(60) is run after 60 seconds, it will output BOOM!.

Clarification example what I mean with 'starting time':

Base program with input 60 seconds is run at 12:00:00. It outputs the first output program with a starting time of 12:00:00.
This first output program with starting time of 12:00:00 is run at 12:00:45. It outputs a second output program with a starting time of 12:00:45.
This third output program with a starting time of 12:00:45 is run at 12:01:25. It outputs a fourth output program with a starting time of 12:01:25.
This fourth output program with a starting time of 12:01:25 is run at 12:05:00. It will output BOOM!.

Note how the first output would print BOOM! after 12:01:00, but the output program has progressed so even though it's 12:01:25 at step 3, it will still output the next program instead of BOOM! (because the output-of-output programs has starting times beyond that first output program).
Challenge Rules:

Default quine rules apply.
At least n seconds should have passed. So if the input is 60 and starting time was 12:00:00, at 12:01:00 it will still output the v2 program, but at 12:01:01 it will output BOOM!.
The output programs will not take any input (except for an empty unused parameter if it's shorter). The starting time should be given to the next programs as 'hard-coded' value (which is why the output of an output program isn't exactly the same as the previous (in most languages).
Only the size of your main program/function is counted in terms of bytes.
You can output the program/function either as string (or comparable reasonable format, like byte/character array/list), as function if your language supports this, or other reasonable formats (please ask if you aren't sure).

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.

What does "output a program" mean? output source code as string? or returning a function?

@tsh Added a rule to allow both string and function.

JavaScript, 51 bytes
f=(t,o=setTimeout(_=>o=0,t*1e3))=>_=>o?f(t):'BOOM!'

Test in browser
old version
f=(t,o=0)=>{setTimeout(()=>o=1,t*1000);return ()=>o?'BOOM!':f(t)}

Test in browser

Looks like it isn't working as expected.

You may delete the post, and undelete it once fixed, to avoid any down votes.

You can golf the space at return()=>. And although I almost never program in JavaScript, I checked your test-script and even modified it by adding a test for the function of function output: Test it here with fourth function-of-function test. Everything seems to work, and it's surprisingly short I might add, so +1 from me. PS: In the rules it stated it should output a string instead of a function. But I'll change the rules a bit to allow both. Could you perhaps modify the script so it also outputs the functions to log during the test?

f=(t,o=setTimeout(_=>o=0,t*1e3))=>_=>o?f(t):'BOOM!' should work

Are you a wizard?!
Never thought of using logic as parameter default value

I've accepted your answer for now being the shortest. If a shorter one is posted later on, it is of course changed. :)

JavaScript, 53 bytes
f=(d,t=1/0,n=Date.now()/1e3)=>n>t?'BOOM!':_=>f(d,d+n)

g=
f=(d,t=1/0,n=Date.now()/1e3)=>n>t?'BOOM!':_=>f(d,d+n)

// please notice that `delay` may take longer time than experted time on a slow / busy machine
// which may lead an incorrect result
delay=n=>new Promise(r=>setTimeout(r,n*1e3));

assertFine=s=>console.log(s!=='BOOM!'?s:'FAIL');
assertBoom=s=>console.log(s==='BOOM!'?s:'FAIL');

(async function () {
  console.log('start test');
  let p1 = g(3);
  assertFine(p1); // should not boom
  await delay(2);
  let p2 = p1();
  assertFine(p2); // should not boom
  await delay(2);
  let b1 = p1();
  assertBoom(b1); // should boom
  let p3 = p2();
  assertFine(p3); // should not boom
  await delay(2);
  let b2 = p2();
  assertBoom(b2); // should boom
}());

Old answer (returning should be a string)
JavaScript, 78 bytes
(f=(o,t,d)=>(x=d,n=Date.now()/1e3)=>o&&n>t?'BOOM!':`(f=${f})(${[1,n+x,x]})`)()

g=
(f=(o,t,d)=>(x=d,n=Date.now()/1e3)=>o&&n>t?'BOOM!':`(f=${f})(${[1,n+x,x]})`)()

// please notice that `delay` may take longer time than experted time on a slow / busy machine
// which may lead an incorrect result
delay=n=>new Promise(r=>setTimeout(r,n*1e3));

assertFine=s=>console.log(s!=='BOOM!'?s:'FAIL');
assertBoom=s=>console.log(s==='BOOM!'?s:'FAIL');

(async function () {
  console.log('start test');
  let p1 = g(3);
  assertFine(p1); // should not boom
  await delay(2);
  let p2 = eval(p1)();
  assertFine(p2); // should not boom
  await delay(2);
  let b1 = eval(p1)();
  assertBoom(b1); // should boom
  let p3 = eval(p2)();
  assertFine(p3); // should not boom
  await delay(2);
  let b2 = eval(p2)();
  assertBoom(b2); // should boom
}());

Nice answer, and surprisingly readable. I did some testing and everything seems to work just fine. +1 from me.

Perl 5 + -p, 88 bytes
$_="\$s=$_;\$t=$^T;".'$_=q{say$^T-$t<$s?qq{\$t=$^T;\$s=$s;\$_=q{$_};eval}:"BOOM!"};eval'

Output programs must be run with -M5.010 for say, but not -p.
Try it online!

Java 8, 234 bytes
n->"v->{long t=System.nanoTime();t/=1e9;String s=\"v->{long t=System.nanoTime();t/=1e9;String s=%c%s%1$c;return t-%d>"+n+"?%1$cBOOM!%1$c:s.format(s,34,s,t);}\";return t-"+(System.nanoTime()/1e9)+">"+n+"?\"BOOM!\":s.format(s,34,s,t);}"

Sorry to post my own challenge right away. It is mainly meant as further clarification of the challenge, and I was doubting whether to add it to the question itself or post it as an answer (and decided to post it as an answer to not clutter the challenge post).
And although I would like to say it's also something to (try and) beat, that isn't even worth mentioning because, well.. Java (almost) always gets beaten. ;p
Try it online.
Example output:
v->{long t=System.nanoTime();t/=1e9;String s="v->{long t=System.nanoTime();t/=1e9;String s=%c%s%1$c;return t-%d>60?%1$cBOOM!%1$c:s.format(s,34,s,t);}";return t-70492.687613232>60?"BOOM!":s.format(s,34,s,t);}

Try the outputted lambda-function here.
Example output:
v->{long t=System.nanoTime();t/=1e9;String s="v->{long t=System.nanoTime();t/=1e9;String s=%c%s%1$c;return t-%d>60?%1$cBOOM!%1$c:s.format(s,34,s,t);}";return t-70548>60?"BOOM!":s.format(s,34,s,t);}

Explanation:
The main function takes an integer input and returns a String. It basically returns a function which is a quine, with the integer input and starting time (in seconds as timestamp) as hard-coded values.
Main function:
n->        // Method with integer parameter and String return-type
  "v->{long t=System.nanoTime();t/=1e9;String s=\"v->{long t=System.nanoTime();t/=1e9;String s=%c%s%1$c;return t-%d>"
          //  First part of the output-function
  +n      //  With the integer input placed as hard-coded value
  +"?%1$cBOOM!%1$c:s.format(s,34,s,t);}\";return t-"
          //  The second part of the output-function
  +(System.nanoTime()/1e9)
          //  With the current time in seconds as hard-coded starting time
  +">"+n  //  And the integer input again (for the output of the output function)
  +"?\"BOOM!\":s.format(s,34,s,t);}"
          //  The final part of the output-function

n=60 was used in the examples below:
First output program:
v->{                   // Method with empty unused parameter and String return-type
  long t=System.nanoTime();t/=1e9;
                       //  New starting time in seconds
  String s="v->{long t=System.nanoTime();t/=1e9;String s=%c%s%1$c;return t-%d>60?%1$cBOOM!%1$c:s.format(s,34,s,t);}";
                       //  Unformatted (quine) result-function
  return t-            //  If the difference between the new starting time
    70492.687613232    //  and hard-coded starting time from the main function
    >60?               //  is larger than the hard-coded integer from the main function
     "BOOM!"           //   Return "BOOM!"
    :                  //  Else:
     s.format(s,34,s,  //   Return the formatted (quine) result-function,
              t);}     //   with this new starting time as new hardcoded value

Second output program:
The same as the first output program, except that 70492.687613232 is replaced with 70548.

05AB1E, 50 bytes
"‘ÒÞ!""žažb‚žcª60β"D.VsI’"34ç ìD«ÿÿ©ÿDU-›iX®:ëÿ’D«

Can definitely be golfed a bit more, but it's quite tricky to output a semi-quine which outputs a quine-program with modified values.
Try it online or try a 20-second example run.
Explanation:
"‘ÒÞ!"                     # Push the string "‘ÒÞ!"
"žažb‚žcª60β"              # Push the string "žažb‚žcª60β"
 D                         # Duplicate it
  .V                       # Execute it as 05AB1E code:
                           #  ža          : Push the current hours
                           #    žb        : Push the current minutes
                           #      ‚       : Pair them together
                           #       žcª    : Append the current seconds
                           #          60β : Convert from this integer list to base-60
s                          # Swap the seconds-integer and duplicated "žažb‚žcª60β"-string
I                          # Push the input
’"34ç ìD«ÿÿ©ÿDU-›iX®:ëÿ’  "# Push the string '"34ç ìD«ÿÿ©ÿDU-›iX®:ëÿ',
                           # where the `ÿ` are automatically replaced with the stack-values
 D«                        # Duplicate it, and append them together
                           # (after which the string is output implicitly as result)

Example resulting program:
"34ç ìD«30žažb‚žcª60β©35555DU-›iX®:ë‘ÒÞ!"34ç ìD«30žažb‚žcª60β©35555DU-›iX®:ë‘ÒÞ!

Which is based on the default quine: "34çìD«"34çìD«.
"34ç ìD«30žažb‚žcª60β©35555DU-›iX®:ë‘ÒÞ!"
                           # Push this string
 34ç                       # Push 34, converted to a character: '"'
    ì                      # Prepend it in front of the string
     D«                    # Duplicate this string, and append them together
                           # (we now have the quine-string at the top of the stack)
  žažb‚žcª60β              # Get the current time in seconds similar as above
             ©             # Store it in variable `®` (without popping)
              35555        # Push the time this program was generated
                   DU      # Store a copy in variable `X`
                     -     # Subtract the two times
30                    ›i   # If the original input-integer is larger than this:
  X®:                      #  Replace integer `X` with `®` in the generated quine-string
                       ë   # Else:
  ‘ÒÞ!                     #  Push dictionary string "BOOM!"
                           # (and output the top of the stack implicitly as result)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why ‘ÒÞ! is "BOOM!".
NOTE: The reason the space is there between çì is because otherwise it's interpret as a dictionary-string (triumph) due to the ’...’.


text:
Digits in their lanes
Input:
A list of integers
Output:
Put each digit (and the minus sign) in its own lane, in the order -0123456789, ignoring any duplicated digits.
Example:
Input: [1,729,4728510,-3832,748129321,89842,-938744,0,11111]
Output:
-0123456789  <- Added as clarification only, it's not part of the output

  1
   2    7 9
 012 45 78
-  23    8
  1234  789
   2 4   89
-   34  789
 0
  1

Challenge rules:

Any duplicated digits in the number are ignored.
I/O can be in any reasonable format. Input can be as a list/array of strings or character-array. Output can be as a list of strings, characters, character-matrix, etc.
Trailing spaces are optional.
Any amount of leading or trailing new-lines are optional (but not in between lines).
Input will always contain at least one integer
You'll have to support an integer range of at least -2,147,483,648 though 2,147,483,647 (32-bit).
The input-list will never contain -0, 00 (or more than two zeroes), or integers with leading zeroes (i.e. 012).
If you language uses a different symbol for negative numbers (like an upper ¯), you are also allowed to use that instead, as long as it's consistent.
You are allowed to have a space delimiter between digits (so a line without 5 or 8 can be - 0 1 2 3 4   6 7   9 instead of -01234 67 9), as long as it's consistent (and therefore there should also be a space between - and 0).

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.

Test cases:
Input: [1,729,4728510,-3832,748129321,89842,-938744,0,11111]
Output:
  1
   2    7 9
 012 45 78
-  23    8
  1234  789
   2 4   89
-   34  789
 0
  1

Input: [4,534,4,4,53,26,71,835044,-3559534,-1027849356,-9,-99,-3459,-3459,-94593,-10234567859]
Output:
      4
     345
      4
      4
     3 5
    2   6
   1     7
  0  345  8
 -   345   9
 -0123456789
 -         9
 -         9
 -   345   9
 -   345   9
 -   345   9
 -0123456789

Input: [112,379,-3,409817,239087123,-96,0,895127308,-97140,923,-748]
Output:
  12
   3    7 9
-  3
 01 4   789
 0123   789
-      6  9
 0
  123 5 789
-01  4  7 9
   23     9
-    4  78

Input: [-15,-14,-13,-12,-11,10,-9,-8,-7,-5,-4,-3,-1,0,9,100,101,102,1103,104,105,106,116,-12345690]
Output:
- 1   5
- 1  4
- 1 3
- 12
- 1
-01
-         9
-        8
-       7
-     5
-    4
-   3
- 1
 0
          9
 01
 01
 012
 01 3
 01  4
 01   5
 01    6
  1    6
-0123456  9

Input: [99,88,77,66,55,44,33,22,11,10,0,0,0,-941]
Output:
          9
         8
        7
       6
      5
     4
    3
   2
  1
 01
 0
 0
 0
- 1  4    9

Would spaces between the digits be permitted in the output?

Can we use upper minus ¯ instead of -?

The missing digits would still be replaced with spaces so, in your example, there would be 3 spaces between 4 & 6 and 7 & 9: "-0 1 2 3 4  <space> 6 7 <space> 9" (Multiple spaces get collapsed in comments, for some reason)

I was hoping to sneak that one past you! :D Well-spotted!

can I take the inputs as separate inputs and a count of the amount of them?

@dzaima Sure, why not.

Words in their lanes? - Another decent challenge spin-off idea. Even letters in their lanes would be cool.

May we place negative signs on the far right? Especially relevant if using a Unicode symbol which comes after 9.

@Adám Sorry but no, the - (or any other character representing -) must be on the left.

related

@streetster Ah, I remember that challenge. It's indeed pretty similar. Btw, why did you link to your answer instead of the challenge itself? ;)

Oops, was browsing through my answers to find the challenge, wasn't paying enough attention to the actual url!

@Adám Well, the minus goes to the left, doesn't it? :P

Stax, 8 bytes
║V≡u╝─é╢

Run and debug it
It takes one number per line on standard input.  It works by finding the target index of each character and assigning it into that index of the result.  If the index is out of bounds, the array is expanded with zeroes until it fits.  During output, 0 becomes a space.  The rest are character codes.
Unpacked, ungolfed, and commented, this is what it looks like.
m       for each line of input, execute the rest of the program and print the result
 zs     put an empty array under the line of input
 F      for each character code in the line of input, run the rest of the program
  Vd    "0123456789"
  I^    get the index of the character in this string and increment
  _&    assign this character to that index in the original string

Run this one

How is one meant to input a list of length one? (If it is just the value or the value and a new line it does not work.)

Oh yes, good point.  An alternate form of input that also works for single values is ["7"].  This format can also handle multiple values such as ["34", "43"].

05AB1E, 13 bytes
Code:
v'-žh«DyмSð:,

Uses the 05AB1E encoding. Try it online!
Explanation:
v               # For each element in the input..
 '-žh«          #   Push -0123456789
      D         #   Duplicate this string
       yм       #   String subtraction with the current element
                    e.g. "-0123456789" "456" м  →  "-0123789"
         Sð:    #   Replace all remaining elements with spaces
                    e.g. "-0123456789" "-0123789" Sð:  →  "     456   "
            ,   #   Pop and print with a newline

Nice! Going the replace-route was shorter than the insert-route I see :)

@Emigna The insert-route is also a very interesting approach. In fact, I think you can save 4 bytes with vðTúyvyÐd+ǝ}, ;).

Brilliant! I didn't know ǝ would function like that on -0. But now that I tihnk of it, that's actually a number and not a string as I first read it as :P

Ooooof... I was at 23bytes. The 05AB1E (pun on the humanity).

Haskell, 51 bytes
-1 byte thanks to Laikoni.
f l=[[last$' ':[n|n`elem`i]|n<-"-0123456789"]|i<-l]

Try it online!
This challenge is digitist. D:

"-0123456789" is a byte shorter than '-':['0'..'9'].

APL (Dyalog), 32 12 bytes
28 bytes saved thanks to @Adám and @ngn
⊃¨⎕∘.∩'¯',⎕d

Try it online!

Same idea, 15: {' '@(~∊∘⍵)'¯',⎕D}¨. Can obviously also take - with trivial change.

{⊃¨⍵∘.∩'¯',⎕d}

or even ⊃¨⎕∘.∩'¯',⎕d

JavaScript, 59 58 bytes
Input & output as an array of strings.
a=>a.map(x=>`-0123456789`.replace(eval(`/[^${x}]/g`),` `))

Try it

o.innerText=(g=s=>(f=
a=>a.map(x=>`-0123456789`.replace(eval(`/[^${x}]/g`),` `))
)(s.split`,`).join`\n`)(i.value="1,729,4728510,-3832,748129321,89842,-938744,0,11111");oninput=_=>o.innerText=g(i.value)
input{width:100%;}
<input id=i>

Original
Takes input as an array of strings and outputs an array of character arrays
a=>a.map(x=>[...`-0123456789`].map(y=>-~x.search(y)?y:` `))

o.innerText=(g=s=>(f=
a=>a.map(x=>[...`-0123456789`].map(y=>-~x.search(y)?y:` `))
)(s.split`,`).map(x=>x.join``).join`\n`)(i.value="1,729,4728510,-3832,748129321,89842,-938744,0,11111");oninput=_=>o.innerText=g(i.value)
input{width:100%;}
<input id=i>

such an elegant solution, i really like it.

05AB1E, 17 13 bytes
Saved 4 bytes thanks to Adnan
vðTúyvyÐd+ǝ},

Try it online!
Explanation
v               # loop over elements y in input
 ðTú            # push a space prepended by 10 spaces
    yv          # for each element y in the outer y
      y         # push y
       Ðd+      # push y+isdigit(y)
          ǝ     # insert y at this position in the space-string
           }    # end inner loop
            ,   # print

Ruby, 42 bytes
Anonymous lambda processing the array of numbers:
->a{a.map{|n|"-0123456789".tr"^#{n}",?\s}}

Try it online!
Alternatively, a completely Perl-like full program is much shorter. I'd say -pl switches look quite funny in this context:
Ruby -pl, 29 bytes
$_="-0123456789".tr"^#$_"," "

Try it online!
Finally, the following is possible if it is acceptable for the output strings to be quoted:
Ruby -n, 27 bytes
p"-0123456789".tr ?^+$_,?\s

Try it online!

JavaScript (Node.js), 60 bytes

Thank to @Andrew Taylor for reducing the join (8 chars)
Thank to @Yair Rand for X.match (8 chars)

a=>a.map(X=>"-0123456789".replace(/./g,x=>X.match(x)?x:" "))

Try it online!

Oh, that join trick is lovely — but the question reads like an array of strings is OK output so maybe you can shave 8 bytes by removing it?

Pretty sure you can save another by replacing (X+"").includes(x) with RegExp(x).test(X)

(X+"").match(x) would be even shorter. The question also allows input to be an array of strings, so it could even be X.match(x) .

Jelly, 12 bytes
ØD”-;¹⁶e?€Ʋ€

Try it online!
-2 thanks to Jonathan Allan reading a rule I didn't.
Note that the I/O format used in the TIO link is not the actual one, which is input as a list of string representations and output as a list of lines.

J, 32 27 bytes
-5 bytes thanks to FrownyFrog!
10|.":(10<."."0@[)}11$' '"0

Try it online!
Original solution:
J, 32 bytes
(('_0123456789'i.[)}11$' '"0)@":

Explanation:
@": convert to characters and
}11$' '"0 change the content of an array of 11 spaces to these characters
'_0123456789'i.[ at the places, indicated by the indices of the characters in this list
Try it online!

10|.":(10<."."0@[)}11$' '"0

@FrownyFrog Nice solution, thanks!

Google Sheets, 124 bytes
=Transpose(ArrayFormula(If(IsError(Find(Mid("-0123456789",Row($1:$11),1),Split(A1,",")))," ",Mid("-0123456789",Row($1:$11),1

Input is a comma-separated list in cell A1. Output is in the range B1:L? where ? is however many entries were input. (You can put the formula wherever you want, I just chose B1 for convenience.) Note that Sheets will automatically add four closing parentheses to the end of the formula, saving us those four bytes.

Another test case and another test case
Explanation:

Mid("-0123456789",Row($1:$11),1) picks out each of the 11 characters in turn.
Find(Mid(~),Split(A1,",")) looks for those characters in each of the input elements. This either returns a numeric value or, if it's not found, an error.
If(IsError(Find(~)," ",Mid(~)) will return a space if the character wasn't found or the character if it was. (I wish there was a way to avoid duplicating the Mid(~) portion but I don't know of one.)
ArrayFormula(If(~)) is what makes the multi-cell references in Mid(~) and Find(~) work. It's also what makes a formula in one cell return values in multiple cells.
Transpose(ArrayFormula(~)) transpose the returned array because it starts off sideways.

Haskell, 47 bytes
map(\s->do d<-"-0123456789";max" "[d|elem d s])

Try it online!
Uses max to insert a space where no element exist, since a space is smaller than any digit or minus sign.
If an ungodly number of trailing spaces is OK, two bytes can be saved:
45 bytes
map(\s->do d<-'-':['0'..];max" "[d|elem d s])

Try it online!

Japt, 16 bytes
Input & output as an array of strings.
£Ao ¬i- ®iS gXøZ

Try it

Explanation
£                    :Map over each element X
 Ao                  :  Range [0,10)
    ¬                :  Join to a string
     i-              :  Prepend "-"
        ®            :  Map over each character Z
         iS          :    Prepend a space
            g        :    Get the character at index
             XøZ     :      X contains Z? (true=1, false=0)

Python 3, 77 64 bytes
-12 bytes thanks to @Rod
lambda x:[[[" ",z][z in str(y)]for z in"-0123456789"]for y in x]

Try it online!
My first proper attempt at golfing in Python. Advice welcome!
Returns a 2D array of characters.

You can use '-0123456789' instead range(10) and drop the first block and swap str(z) with z, you can also switch to python2 and use \y`insteadstr(y) (``is +- equivalent torepr`)

Superfluous space in in "-.

MATL, 13 bytes
"45KY2ht@gm*c

Input is a cell array of strings. Try it online! Or verify all test cases.
Explanation
         % Implicit input: cell array of strings, for example {'1','729',...,'11111'}
"        % For each cell
  45     %   Push 45 (ASCII code of '-')
  KY2    %   Push predefined literal '0123456789'
  h      %   Concatenate horizontally: gives '-0123456789'
  t      %   Duplicate
  @      %   Push current cell, for example {'729'}
  g      %   Convert cell to matrix. This effectively gives the cell's contents, '729'
  m      %   Ismember: gives an array of zeros and ones indicating membership of each
         %   char from '-0123456789' in '729'. The result in the example is
         %   [0 0 0 1 0 0 0 0 1 0 1]
  *      %   Multiply, element-wise. Chars are implicity converted to ASCII
         %   Gives the array [0 0 0 50 0 0 0 0 55 0 57]
  c      %   Convert ASCII codes to chars. 0 is displayed as space. Gives the string
         %   '   2    7 9'
         % Implicit end
         % Implicilly display each string on a different line

Perl 5 -pl, 33 bytes
$_=eval"'-0123456789'=~y/$_/ /cr"

Try it online!
Takes input as line separated.

Perl 5 -n, 30 bytes
Wouldn't work if - could appear anywhere else than in the first position
#!/usr/bin/perl -n
say"-0123456789"=~s/[^$_]/ /gr

Try it online!

Wouldn't work if - could appear anywhere else than in the first position if that can be true then you are not answering this challenge, since they wouldn't be integers anymore. :P

Red, 94 bytes
func[b][foreach a b[s: copy"           "foreach c a[s/(index? find"-0123456789"c): c]print s]]

Takes input as a block of strings
Try it online!

CJam, 20 bytes
qS%{'-10,+s_@-SerN}/

Try it online!
Accepts input as space separated list of integers. Pretty much the same approach as @adnans answer.

C (gcc), 95 94 bytes
c,d;f(l,n)char**l;{for(;n--;l++)for(c=0;c<12;)putchar(strchr(*l,d=c++?c+46:45)?d:d^58?32:10);}

Try it online!
Input in the form of a list of strings. Output to STDOUT.

You can golf a byte by removing the c++, and changing d=c?c+47: to d=c++?c+46:.

Perl 6, 35 bytes
{.map:{map {m/$^a/||' '},'-',|^10}}

Try it online!
Output is a character matrix containing either regex matches or space characters.

If 'input can be in any reasonable format' could be stdin, then presumably -pe would let you dispense with the initial .map, braces and swap $^a for $_

@PhilH -p and -n somehow seem buggy, at least on TIO. For some reason $_ isn't passed to blocks. See example 1, example 2.

R, 96 75 bytes
for(i in scan())cat(paste(gsub(paste0("[^",i,"]")," ","-0123456789"),"\n"))

Try it online!
Thanks to Kevin Cruijssen for suggesting this regex approach!
Takes input from stdin as whitespace separated integers, and prints the ascii-art to stdout.

I don't know R too well, so I'm sure it can be golfed further, but this different approach is 12 bytes shorter: function(N)for(i in N)cat(paste(gsub(paste("[^","]",sep=i)," ","-0123456789"),"\n")). (Input as string-array instead of integer-array.) Try it online.

@KevinCruijssen ah, nice, yeah, I can golf that down as well.

Java 8, 53 bytes
a->a.map(i->"-0123456789".replaceAll("[^"+i+"]"," "))

My own challenge is easier than I thought it would be when I made it..
Input and output both as a java.util.stream.Stream<String>.
Explanation:
Try it online.
a->                              // Method with String-Stream as both input and return-type
  a.map(i->                      //  For every String in the input:
    "-0123456789"                //   Replace it with "-0123456789",
    .replaceAll("[^"+i+"]"," ")) //   with every character not in `i` replaced with a space

C (gcc), 159 bytes
f(A,l,j,k,b)long*A,k;{char*s,S[99];for(j=~0;++j<l;puts(""))for(sprintf(S,"%ld",k=A[j]),putchar(k<0?45:32),k=47;++k<58;putchar(b?32:k))for(b=s=S;*s;b*=*s++-k);}

Try it online!

SOGL V0.12, 14 13 bytes
{ø,{²²⁴WI1ž}P

Try it Here!
Explanation:
{ø,{²²⁴WI1ž}P

{            repeat input times
 ø,            push an empty string and the next input above that
   {       }   for each character in the input
    ²²           push "0123456789"
      ⁴          copy the character on top
       W         and get it's index in that string (1-indexed, 0 for the non-existent "-")
        I        increment that (SOGL is 1-indexed, so this is required)
         1ž      at coordinates (index; 1) in the string pushed earlier, insert that original copy of the character
            P  print the current line

SNOBOL4 (CSNOBOL4), 85 bytes
I	X =INPUT	:F(END)
	S ='-0123456789'
R	S NOTANY(X ' ') =' '	:S(R)
	OUTPUT =S	:(I)
END

Try it online!
I	X =INPUT	:F(END)		;* read input, if none, goto end
	S ='-0123456789'		;* set the string
R	S NOTANY(X ' ') =' '	:S(R)	;* replace characters of S not in X + space with space
	OUTPUT =S	:(I)		;* print S, goto I
END

Pyth, 14 bytes
VQm*d}dNs+\-UT

Takes input as list of strings and outputs a list of strings for each line.
Try it here
Explanation
VQm*d}dNs+\-UT
VQ                For each string in the input...
  m     s+\-UT    ... and each character in "-0123456789"...
     }dN          ... check if the character is in the string...
   *d             ... and get that character or an empty string.

Retina, 26 bytes
%"-0123456789"~`.+
[^$&]¶

Try it online! Note: Trailing space. Explanation: % executes its child stage ~ once for each line of input. ~ first executes its child stage, which wraps the line in [^ and ]<CR><SP>, producing a program that replaces characters not in the line with spaces. The "-0123456789" specifies that the input to that program is the given string ($ substitutions are allowed but I don't need them).

K4, 30 27 bytes
Solution:
{?[a in$x;a:"-",.Q.n;" "]}'

Example:
q)k){?[a in$x;a:"-",.Q.n;" "]}'1 729 4728510 -3832 748129321 89842 -938744 0 11111
"  1        "
"   2    7 9"
" 012 45 78 "
"-  23    8 "
"  1234  789"
"   2 4   89"
"-   34  789"
" 0         "
"  1        "

Explanation:
Return "-0123..." or " " based on the input. Interpreted right-to-left. No competition for the APL answer :(
{?[a in$x;a:"-",.Q.n;" "]}' / the solution
{                        }' / lambda for each
 ?[      ;          ;   ]   / if[cond;true;false]
                .Q.n        / string "0123456789"
            "-",            / join with "-"
          a:                / save as a
       $x                   / convert input to string
   a in                     / return boolean list where each a in x
                     " "    / whitespace (return when false)

ShellUtils, 85 bytes
There must be a better way of escaping the {} rather than using a double echo and piping through bash
xargs -i echo echo \\-0123456789 \|tr \$\(echo .0123456789- \|tr -d -- {} \) \' \'|sh

This takes the strings, one per line, from stdlin
The inner tr takes -0123456789 and removes what's not in the input line. The {} represents this.
The second tr takes that output, and converts -0123456789 by replacing the input characters with spaces.

APL+WIN, 33 bytes
Prompts for screen input as a string
n←11⍴' '⋄n['-0123456789'⍳s]←s←⎕⋄n

Haskell, 49 bytes
map$(<$>"-0123456789").(%)
i%n|elem n i=n|1<3=' '

The first line defines an anonymous function which takes a list of strings and returns a list of strings. Try it online!

Javascript 95 bytes
(a,t='-0123456789')=>a.map(a=>a+'').map(_=>[...t].map(b=>_.search(b)>=0?b:' ').join``).join`\n`

f=(a,t='-0123456789')=>a.map(a=>a+'').map(_=>[...t].map(b=>_.search(b)>=0?b:' ').join``).join`\n`

console.log(f([1,729,4728510,-3832,748129321,89842,-938744,0,11111]))

console.log(f([4,534,4,4,53,26,71,835044,-3559534,-1027849356,-9,-99,-3459,-3459,-94593,-10234567859]))

a=>a.map(a=>a+'').map(=>[...'-0123456789'].map(b=>.search(b)+1?b:' ').join``).join  outer join just use enter instead of \n. you dont need t just put the string there. this is a 87 solution