text:
Say Hello to the Pioneers of Computer Science
Choose your favorite famous computer scientist or computer science pioneer who was born in 1942 or earlier (as 1943 marks the start of the creation of the 'first' computer). They should have a Wikipedia page or other site that lists their birth year and tells how their accomplishments relate to computer science. You may choose the same as someone else but choosing someone new is encouraged.
Take a name they are commonly known by. This will most likely be their first and last name but it might include abbreviations or middle names if that is more common. For example, for Tony Hoare both Tony Hoare and C. A. R. Hoare would be acceptable.
All the characters in the name must be printable ASCII. If the name contains characters that aren't printable ASCII it's fine if you choose something approximate. e.g. Kurt Godel instead of Kurt Gödel.
Take the set of unique characters in the name (e.g. C. ARHoare) and shift them up the printable ASCII scale by the birth year of your scientist, looping around from ~ to space. (Basically add the birth year modulo 95.) This will give you a (most likely) new set of printable ASCII characters.
For example, C. A. R. Hoare was born in 1934, so shifting every character in C. ARHoare by 1934 (34 mod 95) characters gives ePBctj2$5(.
This Stack Snippet will do all the shifting for you:

function go() {var name = document.getElementById("name").value;var year = parseInt(document.getElementById("year").value);var unique = {};for (var i = 0; i < name.length; i++) { unique[name.charAt(i)] = true; } var result = ''; for (var char in unique) { result += String.fromCharCode((char.charCodeAt(0) - 32 + year) % 95 + 32); } document.getElementById("result").value = result; }
Name: <input type="text" id="name" value="C. A. R. Hoare">

Birth Year: <input type="text" id="year" value="1934">

<button type="button" onclick="go()">Ok</button>

Result: <input type="text" id="result" readonly>

Challenge
Using this set and only this set (no tabs, no newlines) of shifted printable ASCII characters, write a program that prints Hello, [name]! to stdout or closest alternative, where [name] is the same exact name you chose above and shifted to get your program characters. You may use multiple characters from the set or not use some at all. For example, the theoretical program PetBee($25 prints Hello, C. A. R. Hoare!.
Scoring
Your score is your code size in bytes times the number of unique characters in the name you choose. The lowest sore wins.

Were I to pick, for example, Muḥammad ibn Mūsā al-Khwārizmī, and use a reasonable ASCII-fication of their name, for instance Muhammad ibn Musa al-Khwarizmi, would that be acceptable?

Rear Admiral Grace Murray Hopper, United States Navy, (Retired), Doctor of Philosophy. Born 1906. Would that be OK?

@ymbirtt Yes, that's perfectly fine.

@BillWoodger I think that's a bit of a stretch. I'd be OK with Rear Admiral Grace Murray Hopper though. Remember that your code size is multiplied by the number of unique characters in the name so a longer name is not necessarily better.

@Calvin'sHobbies Thanks, I was looking for something long to see if Grace Hopper would actually work with COBOL :-) it doesn't :-( With COBOL in golfing, it doesn't really matter what you multiply it by, it's long (in golf terms) anyway.

@Quincunx Your ḥ is not an h (it has a little dot underneath).

@Calvin'sHobbies Oh oops. Thought that was grit on my screen.

What about C. A. R. Hoare's brother, C. D. R. Hoare?

@DavidConrad - +1 for the Lisp joke. :-)

So, nearly all "mainstream" languages are forbidden, right? Damn...

Can you clarify the rules on using the shortened version of the name?

Insomnia, 103 99 98 * 8 = 784
George Boole, 1815
All 5 programs below have the same length (98) and same output.
oyoooyLyyyyoyLqoyyoyoLL*yyoLqy|oLq*yLyoyyoLqoq*yLyyLoyooLyyy*qL|yqoLq**LoooyoLqy|qLLo*qyLq*oq|L|oL
oyoooyLyyyyoyLqoyyoyoLLy*yyoLq*oqL*LqyyyoyLyooyyoLyyLoyooLyyyL*q|qoL|q*LoooyoLqyq*LLo*qyLq*o|qL|oL
oyoooyLyyyyoyLqoyyoyoLL*yyoLqy|oLq*yLyoyyoLqoq*yLyyLoyooLyyyL*qq|oL|yq*LoooyoLqyq*LLo*qyLq*o|qL|oL
oyoooyLyyyyoyLqoyyoyoLLy*yyoLq*oqL*LqyyyoyLyooyyoLyyLoyooLyyyL*q|qoL|q*LoooyoLqyq*LL|qyyLy*qq*L|oL
oyoooyLyyyyoyLqoyyoyoLL*yyoLq|oLq*yLyoyyoLyq|oLq|yq*LqooLoyyoyLyLoyyoyLoooyoLo|q|LLq|yyLooooyoLqyL

Prints Hello, George Boole!
Insomnia, 103 * 6 = 618 (probably optimal and unique)
If G Boole (George Boole, 1815) is acceptable...
ooyoyoLoyyoyoyyLyoyoooLLoyooyyLoyyyoLooyoyoooooLyoyyoLoyoyyyoLooyyyooLoyoyooooLLyyooyoyoLyoyoooLoyooooL

Prints Hello, G Boole!

Insomnia, 94 92 89 85 83 * 10 = 830
Kurt Godel, 1906.
kukuzkzjzkuxkujx{rxjkjxzjukukzj{ukukzjkrxujzujk{rxujjku{jxuukujrxzjuxjk{urxjxukzj{j

Prints Hello, Kurt Godel!
I wrote a program to search for the solution. My second version of the program should be closer to optimal than my first version.
As per @Martin Büttner's nitpick (100 92 88 85 characters, same set of characters):
kukuzkzjzkuxkujx{rxjkjxzjukukzj{ukukzjkrxujzujk{rxujju{jxuukujrxuxjzxjk{urxjxjxukzj{j

Prints Hello, Kurt Goedel!
Interpreter

You can include it in your answer itself and hide it by default.

Nitpick: the correct transliteration of Gödel using only the Latin alphabet is Goedel. ;)

@Optimizer: I have another answer also using Insomnia, so I put it on the other thread.

I know, but it will occupy just as much space as the link to the interpreter and you can keep including the snippet in any answer you like. That is the purpose of snippets! :)

CJam, 230 117 115 114 113 110 107 106 bytes * 13 = 1378
23)3*c11(2#)c111(((c3*))))22 2*c32c23 3*c3))$(113))c1$)))2$)2$(32c3)))$(3)$))1($)1($)3))$)1($)1$(12$(((33c

Test it here.
I chose Edsger Dijkstra, born 1930, which gives me c#2&$1>b()* 3 (whom I really just chose because he was the first one I found whose name yielded useful characters for CJam; I've checked a dozen names since and none looked as promising).
The code basically just builds the ASCII codes using 1, 2, 3, *, # (exponentiation) and (, ) (decrement, increment) and converts them to a character with c. To save some characters I can sometimes copy an earlier character with $ (0$ copies the top stack element, 1$ copies the second-to-top stack element and so on).
Here is the breakdown of the code into characters (this is also runnable):
23)3*c    "(23+1)*3 -> 72 -> H";
11(2#)c   "(11-1)^2+1 -> 101 -> e";
111(((c   "111-3 -> 108 -> l";
3*)       "Turn l into string lll and split off the third l.";
)))       "l+3 -> o";
22 2*c    "22*2 -> 44 -> ,";
32c       "32 -> Space";
23 3*c    "23*3 -> 69 -> E";
3))$(     "e-1 -> d";
113))c    "113+2 -> 115 -> s";
1$)))     "d+3 -> g";
2$)       "d+1 -> e";
2$(       "s+1 -> r";
32c       "32 -> Space";
3)))$(    "E-1 -> D";
3)$))     "g+2 -> i";
1($)      "i+1 -> j";
1($)      "j+1 -> k";
3))$)     "r+1 -> s";
1($)      "s+1 -> t";
1$(       "s-1 -> r";
12$(((    "d-3 -> a";
33c       "33 -> !";

Marbelous, 83 bytes * 10 = 830
I've chosen R Kowalski, 1941 which allows me to use: {It9A+6=53
++63
A66333696A5A696A6A69
A5633A..+3+6+3+9++
A56A+I
AA+6
=3
3653666665
+I+I+6+6+A++

This one is a bit more complex than the old answer (below) since many marbles go through multiple devices, all in all most marble just have a few things added to them before being printed though. Because I didn't have subtraction or low numerals, the lower ascii codes had to be formed by adding by merging two high value marbles, since this results in addition modulo. (I've used =3 as a deflector since it pushes every marble not equal to 3 to the right and looks like a cute cat)
output:
Hello, R Kowalski!
old answer:
Marbelous, 113 * 17 = 1921
Marbelous does okay here, since ever marble that falls off the board gets printed, because of its 2D nature though, it needs a few numerals + some arithmetic to not let the borad get too huge.
I've chosen Philip D. Estridge, 1937 who yields u./26EiSj9:8*-+ as the available character set. The characters actually used are .+-245689E
22
6865
4965686866282252686968696E2244666E65686422456E6E6E6964
--..+4+4+9+4-2-2....+4..+2-2..+9..-4+4..-2..+5+6+4

The board is pretty simple, the first 3 rows are literals, ever group of two is a hexadecimal value, the fourth row are arithmetic operations to form the ascii codes that could not be written explicitly because of the limited character sets.
output:
Hello, Philip Donald Estridge!
You can try it out here!
I'll now look for a possible better candidate, since it looks like marbelous might actually be competitive here.

Not sure whether shortening the name considered acceptable.

@n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ I'm using the initial rather than the full first name, seems justified.

I can do G Boole with 105 characters * 6 - I think there should be a limit on how much the name can be shortened.

Your program doesn't seem to work without new line. The question explicitly disallow the use of new line character Using this set and only this set (no tabs, no newlines) of shifted printable ASCII characters

Brainfuck,1846*12 = 22152
Just to have a language other than CJam. Requires original spec Brainfuck with byte datatype, that overflows at 256.
Only uses 2 characters: + to increment the current cell, and . to output the current cell.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++.+++++++..+++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++.+++++++++++++++++.++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.

Output
Hello, John McCarthy!

Credit goes to Coredump for revealing the following in his answer:
 "John McCarthy" 1927
 ("John McCarthy" "e+*;h~^|.0$5" 12)

The output appears to be missing an exclamation mark!

@githubphagocyte Thanks, it's fixed now!

I'am glad it helped.

"Hello, Niklaus Emil Wirth!" (Befunge-98, 222×14=3108)
From Wikipedia:

Niklaus Emil Wirth (15 February 1934 – 1 January 2024) was a Swiss computer scientist.
He designed several programming languages, including Pascal, and pioneered several classic topics in software engineering.
In 1984, he won the Turing Award, generally recognized as the highest distinction in computer science, “for developing a sequence of innovative computer languages”.

With a shift of 34, Niklaus Emil Wirth (18 characters, 14 unique) ends up as p,./$86Bg0,/By,57+.
Code (try it out here):
88888888+++++++50p50g8+,50g88885+++++00pg,g7+,g7+,g55++,888866+++++,8888+++,50g68++,g886++5/+,g6+,g7+,50g88755+++++,g88++,g77++,8888+++,50g5+,g8+,g886++5/+,g7+,8888+++,50g887+++,g886++5/+,g85++,g87++,g88+5/+,g5/85++,50g00p

Breakdown:
88888888+++++++ # Put eight '8's on the stack and add them together (ASCII 64 = `@`)
50p             # Save this value in row 0, column 5 (where the 6th '8' was)
50g8+,          # Fetch the value we just saved, add 8 and print it (ASCII 72 = `H`)
50g88885+++++   # Fetch it again and add 37 (4×8+5) (ASCII 101 = `e`)
00p             # Save this value in row 0, column 0 (the very first character)
g,              # Fetch & print this value (stack is empty, so coordinates will be zero)
g7+,g7+,        # Fetch it again, add 7 (ASCII 108 = `l`) and print. Repeat.
g55++,          # Print `o`
888866+++++,    # Print `,` (4×8+2×6=44)
8888+++,50g68++,g886++5/+,g6+,g7+,50g88755+++++,g  # Continue in a similar fashion,
88++,g77++,8888+++,50g5+,g8+,g886++5/+,g7+,8888++  # using integer division (`/`) in
+,50g887+++,g886++5/+,g85++,g87++,g88+5/+,g5/85++, # a few places
50g00p          # Fetch the `@` character and put it in cell (0,0)

The last line places a HALT character (@) at the beginning of the line. When the control wraps around back to this point, the program will stop. This shouldn't actually be necessary, because the @ character at (5,0) is still there and nothing should be output before it is reached. However, the only online Befunge interpreter that will run this monstrosity won't work properly without it.
It is actually possible to make a working solution with just Niklaus Wirth (12 unique chars, p,./$86By,57+), but the code is much, much longer.
(Tagged as Befunge-98 because Befunge-93 is limited to a width of 80 characters.)

CJam, 323 bytes * 10 = 3230
5((e5(((e2(((e2(((e2((e2c525e2e2(e2(((e2(e2((e2(((c525e5(e5(((e2(e2c2(($Be2(e2(((e2(e2e2((e2(e2e2(c2e2e2((e2e2(e2(((e2(e2c2(($((((((((((((B((((($(((((2e2(e2(e2e2((e2(((e2(e2e2((c2$2$((c2$2$525e2(((e2((e2((e2((e2e2(((e2((c2$2$22((((((($22(((((((((($22(((((($((((255((e2((e2(e2((e2(((e2((c22(((($Be2e2(e2(e2((e2(((e2(((e2(((c

Output:
Hello, C. A. R. Hoare!

CJam, 662 bytes * 10 = 6620 8700
Not to win but just because it looks possible. It used only 2e(c.
2e2e2((e2e2(((e2(((e2(((e2((e2c2e2e2(((e2e2(e2(((e2(e2((e2(((c2e2e2e2((e2((e2e2(((e2(e2c2e2e2e2((e2((e2e2(((e2(e2c2e2(e2(((e2(e2e2((e2(e2e2(c2e2((e2e2((e2e2(e2(((e2(e2c2e2((e2e2((e2(((e2(((e2((e2e2c2e2((e2(((e2e2(((e2((e2(e2(((e2(c2e2(e2(e2e2((e2(((e2(e2e2((c2e2((e2e2((e2(((e2(((e2((e2e2c2e2((e2(((e2e2(((e2((e2(e2(((e2(((c2e2(e2(e2e2((e2(((e2(e2e2((c2e2((e2e2((e2(((e2(((e2((e2e2c2e2(((e2(((e2((e2((e2((e2e2(((e2((c2e2(e2(e2e2((e2(((e2(e2e2((c2e2((e2e2((e2(((e2(((e2((e2e2c2e2e2((e2e2(((e2(((e2(((e2((e2c2e2(e2(((e2(e2e2((e2(e2e2(c2e2(((e2e2(e2(((e2(e2(((e2(((e2(((c2e2e2e2(((e2((e2(e2((e2(((e2((c2e2e2(((e2e2(e2(((e2(e2((e2(((c2e2(e2e2(e2(e2((e2(((e2(((e2(((c

Output:
Hello, C. A. R. Hoare!

Generator
q{i
[7209 3113 41 41 41 9 1 0]
{
1$3^)4%@1$+@*4/\'(*\
}%W2tW%"e2"*
'c}%

The trivial answer 222(((((((((((c (generated by q{i222_@-'(*'c}%) has 3420 bytes.

Wow I didn't know you could use e_ outside number literals.

Have you checked how low you can get by using repetitions of 2? Or by using the other (useful) characters B, 5 and $? (E.g. you can get second to fourth space and the second and third period with 2$, as well as the A with 2$((.)

@MartinBüttner Tried to golf down a bit by hand. But it seemed too complicated. Maybe I'll write a program to do that later. But this will not win anyway.

CJam, 16 * 307 288 = 4912 4608
B(7*2+cB(B(*2(+cB(B*((cB(B*((cBB*7-(((c5 8*5(+c8 2*2*cBB*2/5+cBB*7-cBB*5-cBB*Bm5-(cBB*4-cBB*7-c8 2*2*cB7*(((cBB*7-(((cBB*Bm5-(cBB*B-c8 2*2*c8B*2+8-cBB*7-(((c7 2+B*(cBB*8 2*-cBB*B-c8 2*2*cB(7*2(+cBB*7-(((cBB*7-cB(B(*2(+cB(B*((cB(B*((c8 2*2*cB7*cBB*8 2*-cB(B*((cBB*B-cB(B(*2(+cBB*7-c5(8*1+c

Displays:
Hello, Arthur John Robin Gorell Milner!

This is my first answer using CJam, so surely this can better golfed (any hint is welcome).

Here is some utility code I used.
Since I computed the character set for some other names, this may be useful for someone who better knows CJam (or maybe for another language).

Find the character set, along with the number of unique characters

(defun character-set (name year)
  (let* ((uniques (remove-duplicates name))
         (size (length uniques))
         (buffer (make-array size
                             :element-type 'character
                             :fill-pointer 0)))
    (loop for c across uniques
          do (vector-push
              (code-char
               (+ #x20 (mod (- (+ (char-code c) year) #x20) 95)))
              buffer)
          finally (return (values buffer size)))))

Define a list of well-known figures

(defparameter *masters*
  '("Grace Murray Hopper" 1906
    "Augusta Ada King, Countess of Lovelace" 1815
    "Augusta Ada Byron" 1815
    "Ada Lovelace" 1815
    "John von Neumann" 1903
    "Neumann Janos Lajos" 1903
    "Charles Babbage" 1791
    "John McCarthy" 1927
    "Wilhelm Ackermann" 1896
    "George Boole" 1815
    "Kurt Godel" 1906
    "Andrei Nikolaievitch Kolmogorov" 1903
    "Bertrand Arthur William Russell, 3rd Earl Russell" 1872
    "Arthur John Robin Gorell Milner" 1934))

Compute the allowed printable character sets, sort by size of set

(sort (loop for (n y) on *masters* by #'cddr
            collect (cons n (multiple-value-list (character-set n y))))
      #'< :key #'caddr)

=>
(("George Boole" "Q|q*Lyvo" 8)
 ("Ada Lovelace" "Kn*Vy!vkmo" 10)
 ("Kurt Godel" "Q{xz&Mujkr" 10)
 ("John von Neumann" "Mkyr#Qhxpdq" 11)
 ("Charles Babbage" "5Zd^eq4TSYW" 11)
 ("Grace Murray Hopper" "MiS{g &Nuvkx" 12)
 ("Neumann Janos Lajos" "QhxpMq#Odmrv" 12)
 ("John McCarthy" "e+*;h~^|.0$5" 12)
 ("Augusta Ada Byron" "q }~Knk*L$|yx" 13)
 ("Wilhelm Ackermann" "Sedh{=_gani]j" 13)
 ("Arthur John Robin Gorell Milner" "c78l+t%i2Bo,/1(5" 16)
 ("Andrei Nikolaievitch Kolmogorov" "DqgQndhlwfk#Nopjury" 19)
 ("Augusta Ada King, Countess of Lovelace" "KnUsq6M x~}p*Vy!vkmo" 20)
 ("Bertrand Arthur William Russell, 3rd Earl Russell" "&R%XL;MQovH)EVc6YWIP" 20))

Brainf_ck - 723 * 12 = 8676
I did a crawl from Wikipedia's List of computer scientists and collected the birthyears and longest names of all the people listed there. I wrote a program to run over all these and find any I could possibly do in a common language. Sadly, I was unable to find any names that could support echo;, alert(), console.log() (I can hope), print, or main.
I mainly wanted to share my raw crawl data in case anyone wanted to similarly search for other languages (note: may be inaccurate and incomplete): Crawl Data.
EDIT: New crawl paste with about 40 new names from List of computing people and List of pioneers in computer science.
EDIT: Manually cleaned up the list.
I did find that Jean David Ichbiah (1940), chief designer of Ada, provides +-. (the shortest of three people to do so). I generated this BF code for him.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++.+++++++..+++.-------------------------------------------------------------------.------------.++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++.----.+++++++++++++.------------------------------------------------------------------------------.++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++.+++++++++++++++++++++.-------------.-----.--------------------------------------------------------------------.+++++++++++++++++++++++++++++++++++++++++.++++++++++++++++++++++++++.+++++.------.+++++++.--------.+++++++.-----------------------------------------------------------------------.

Alexander Keewatin Dewdney provided the most usable BF characters (+.<>), but came in slightly above my answer. No one I found provided .[].

Some of that crawl data is definitely wrong. I met Sir Maurice Wilkes: he was old, but not 900 years old.

I took a manual pass through and fixed some of those, and also found a lot of dates that the bot didn't pick up on at all. Didn't bring up any new results for me, though.

Ruby 1.8 - 250 × 18 = 4500
p''<<24+48<<2+99<<9+99<<9+99<<22+89<<44<<4+28<<24/4+59<<22+88<<2+95<<22+94<<22+89<<9+99<<24/4+99<<24/4+99<<4+28<<24/4+59<<9+99<<2+99<<22+98<<2+99<<2+99<<24+94<<24/4+99<<99<<5+99<<4+28<<84/4+54<<2+95<<22+92<<2+95<<22+94<<84/4+94<<22+95<<98<<2+95<<4+29

Characters available:
'()+./24589:;<>Efp

Output:
"Hello, Anatolii Alexeevich Karatsuba!"

Anatolii Karatsuba, born 1937, is most well known for his contributions to the field of analytic number theory (a field I personally enjoy), including the Karatsuba Algorithm, a method for fast multiplication of arbitrary precision operands.
This is the first and only name I tried.

GolfScript (125 * 14 = 1750)
9)99.9-&^99)).9^..)))..)~99-&.99&.99)^999)9/.(((-9-..9(/-.((9^99((.9-9-^.).9-^).)).~--999~9/.9^.((.9^99(.(.9.~-^.))..9-^))](-

Online demo
Douglas Engelbart (1925 - 2013) is perhaps most famous for the "Mother of All Demos". His name and year of birth give characters !&(),-./9]^z{~, of which this solution uses &()-./9]^~
The basic structure of the code is build list of numbers](- which puts a lot of numbers in an array with the empty string that starts on the stack, then pulls out that string and uses it with the type promotion of - to turn the array of numbers into a string.
Since there's no access to elements below the top of the stack I wrote a C# program to find short snippets that take a given integer on the top of the stack and add the next integer required. This created one small problem, when the snippet for 69 (E) ended with - and the snippet for 110 (n) started with 9: it cost one char to use a longer snippet for 110.

CaneCode, 458 410 * 16 = 7328 6560
11111111111111111111111111111111111111111111111111111111111111111111111184111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111118111111188111841111111111111111111111111111111111111111111182222222222228331184222222222222228118111111118483322222841811111111822222828483322284111182222222222222811111111111111822222222222222811111111182222228222222281111111111118418

Corresponding BF:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++..+++.>++++++++++++++++++++++++++++++++++++++++++++.------------.<<++.>--------------.++.++++++++.>.<<-----.>+.++++++++.-----.-.>.<<---.>++++.-------------.++++++++++++++.--------------.+++++++++.------.-------.++++++++++++.>+.

Outputs:
Hello, Jack Elton Bresenham!

CaneCode is just a direct symbol substitution of Brainfuck, where 12348 correspond to +-><. respectively. I spent about 2 hours trying to look for a short name which gave +-. for normal Brainfuck, with no success.
Jack Elton Bresenham, inventor of Bresenham's line algorithm and born 1937, gives the following characters:
o')1Ej2:54g8+9.3

Unfortunately, while 5 ([) is available, the lack of 6 (]) means that the code still had to increment up the 100-ish area (for lowercase chars) the slow way.

><> (Fish), 163 * 15 = 2445
47*5+:56+7*+:42)+:4+55*66*:++66+6*o:4+::o7+:oo25*+o56+:4*o42*4*o6*7+o:7+7+7+o:o:25*7++o42*:4*o45+*o:45++o:o:6+:5+o6+o:o:25*7++o24*4*o25*7*4+o:o:2+o:27*+o42)+ooooo;

Outputs:
Hello, Ivar Hjalmar Jacobson!

Ivar Hjalmar Jacobson, born 1939, was found thanks to BMac's crawl data. He provides the chars
)*+24567:;>Gopq

><>, like Befunge, is a 2D stack-based language. The useful ><> commands are:

*+24567 for arithmetic (note that 47 pushes a 4 and a 7 on the stack, not 47)
) for greater than (useful for getting 1)
: for duplicating the top of the stack
o for output
; for program termination

p is also good for reflection, but I was unable to think of a good use for it. > is another ><> command, directing program flow rightwards, but since the program already executes in that direction it was not needed.

authors: Bob Jarvis - Слава Україні

authors: n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳

authors: عبدالرحمن الناصر


text:
Find i^n, given n
The Challenge
In as few characters as possible, find the value of \$i^n\$, given \$n\$, a positive integer greater than 0. This should be outputted as a String.
For those that don't know, \$i\$ is defined such that \$i^2=-1\$. So:

\$i^1=i\$
\$i^2=-1\$
\$i^3=-i\$
\$i^4=1\$

This then repeats..
Rules

If your language supports complex numbers, don't use any functions or arithmetic that could work this out.
Floating point inaccuracies are fine for answers that would return decimals anyway, but integer inputs should give exact results

Bonus Points
-5 if you can work the value out where n is also negative
-15 if you can work out the value for any real number (this bonus includes the -5 from the above bonus)
Good luck!

In what format do we return exactly? Through function output or stdout?

@proudhaskeller The tag wiki lists defaults for that. Unless specified otherwise, functions and programs are fine, input via function argument, STDIN or command-line argument and output via STDOUT or function return value. Functions do not have to be named.

@MartinBüttner but if i choose function output, how should the output should be formatted/stored without native complex numbers in my language?

If you support any real number you can output in any valid complex form. So just 1 would be valid and so would 1+0i.

Well I think that floating point inaccuracies are fine for answers that would return decimals anyway, but integer inputs should give exact results. (This is my first question posed so if you disagree let me know!)

Okay, I shall do!

Do we require the use of floating point integers?

@BetaDecay What are floating point integers? o.O

@MartinBüttner Haha wrong word :/ Floating point number then

Common Lisp, (26 characters - 15 = 11): (lambda(n)(expt #C(0 1)n)). Unfortunately, this is against the rules :-(

I feel so stupid. I only just realized that python has a built in complex type.

i is not defined as the square root of -1. Rather, it is defined such that i^2 = -1, which is not the same, since one can choose plus or minus the root of -1.

@user1997744 True, I'll edit it now although I doubt it'll make any difference..

mod 4 and a lookup. This doesn't seem very interesting.

@user1997744 in all fairness, it is possible to define square root that way as well, making it unique by taking a branch cut.

Ruby, score -2
(13 bytes, -15 bonus)
->n{[1,90*n]}

Features include: no rounding errors! (if you pass the input as a Rational)

posted by the author, Kezz101

If you support any real number you can output in any valid complex form.

Negatives scores make my adrenaline rush forth. Thus the rules get abused are made use of to achieve this noble goal.
Creates an anonymous function and outputs an array with 2 entries representing a complex number in polar form (angular unit: degrees).

"Ruby, -2 bytes".....

So, does downloading this 1,000,000,000,000 times give me 2TB of free hard drive space? Sounds like a good deal to me.

^ My browser broke down before I succeeded to do that. Maybe try a "zip bomb" with the file inside? (Extracting it saves space.)

CJam, 12 characters - 5 = 7
1'iW"-i"]li=

Test it here.
Supports negative inputs.
1              "Push 1.";
 'i            "Push the character i.";
   W           "Push -1.";
    "-i"       "Push the string -i.";
        ]      "Wrap all four in an array.";
         li    "Read STDIN and convert to integer.";
           =   "Access array. The index is automatically taken module the array length.";

The result is printed automatically at the end of the program.
Mathematica, 22 20 19 characters - 15 = 4
Sin[t=π#/2]i+Cos@t&

This is an anonymous function, which you can use like
Sin[t=π#/2]i+Cos@t&[15]

(Or assign it to f say, and then do f[15].)
Supports reals and gives exact results for integer input.
Note that the i is not Mathematica's complex i (which is I). It's just an undefined variable.
Also, despite the order of the expression, Mathematica will reorder the output into R+Ci form.

You don't need the 4%. It can be done automatically.

@user23013 nifty :)

Shouldn't the two answers be separate?

@Quincunx Maybe... originally they were both in CJam, which is why I put them in the same answer. But the second one wasn't valid, so I ported it to Mathematica, but left it where it was. If people insist I can split them up.

And you can save a character in using it with f@15 instead of f[15].

@raxacoricofallapatorius I'm not counting that. The byte count is only for the function definition, not for using it.

@MartinBüttner: Yep, I know. Just pointing out that using it is brief too.

You can also change Pi to π to save a char

@miles Oh right, I somehow thought scoring is in bytes, but the question mentions characters, yay! :)

Python 2 - (24-5)=19
lambda n:'1i--'[n%4::-2]

Most credit belongs to @user2357112, I just golfed his answer from the comments on this answer a bit more.
Explanation: Starts at the index n%4 in the string '1i--'. Then iterates backwards in steps of two over each letter in the string. So, for example, n=6 would start at index 2, the first -, then skip the i and take the 1, to return -1.
@xnor pointed out a same-length solution:
lambda n:'--i1'[~n%4::2]

Pyth - (14-5)=9
I can only seem to get 14, no matter how I try to reverse/slice/etc. :'(
%_2<"1i--"h%Q4

Which is essentially the same as the above python answer, but in 2 steps, because pyth doesn't support the full indexing options of python. Try it online.
I'm going to go have a talk with isaacg about Pyth indexing ;)

Doesn't the python lambda need to be assigned to a variable? At the vary least, to call it you'd need to surround it with parentheses, adding two bytes so it could be called (lambda...)(n).

@mbomb007 According to meta this is acceptable. The code here creates a function that performs the task a required. Anonymous lambdas are used relatively frequently in python for functions like map and sorted.

TI-BASIC (NSpire) - 5 (20 characters-15)
cos(nπ/2)+sin(nπ/2)i

If you want to recieve a complex return value, replace the i at the end with (complex i).

@MartinBüttner TI-Basic seems to use some kind of 'Expression' type, and the built-in methods return exact results for these.

I see, all good then. ;)

What about the rule "If your language supports complex numbers, don't use any functions or arithmetic that could work this out." +i is arithmetic

@edc65 The + is actually a complex operation. However, if you don't like that, replace the  with a normal i. If the variable i is not defined, you'll get the complex number, just with i instead of . I'm just calculating the real and imaginary parts separately.

@Shujal In that case, I think you should use i anyway. The complex i isn't even the character the question asks for, and it'll save you two bytes, so you'd at least tie with me ;).

Scoring is in characters, so that's 20 characters/score 5 for you.

Marbelous, 43 bytes
Not really a winner, but Marbelous is fun. :)
}0
^0
=0&2
&1
}0
^1\/
=0&02D3169
\/\/&0&1&2

This is a program which reads the input as a single integer from the first command-line argument. Note that the input is taken modulo 256, but this doesn't affect validity of the result for inputs greater than 255, because 256 is divisible by 4.
Explanation
Marbelous is a 2D programming language, which simulates "marbles" (byte values) falling through a bunch of devices. The board is made up of 2-character wide cells (the devices), which can process the marbles. Everything that falls off the bottom of a board is printed to STDOUT.
Let's go through the devices in use:

}0 is where the first command-line argument goes. I've used two instances of this device, so I get two copies of the input value (at the same time).
^n checks for the nth bit of the input marble (where n=0 is the least significant bit), and produces 1 or 0 depending on the bit.
=0 checks for equality with 0. If the input marble is equal, it just drops straight through, if it isn't it is pushed to the right.
\/ is a trash can, so it just swallows the input marble and never produces anything.
2D is the ASCII code of -, 31 is the ASCII code of 1 and 69 is the ASCII code of i.
The &n are synchronisers. Synchronisers stall a marble until all synchronisers with the same n hold a marble, at which point they'll all let their stored marble fall through.

So in effect, what I do is to hold the three relevant characters in three synchronisers, and release those depending on how the least significant bits are set in the input.
For more information, see the spec draft.

I really like this one! Marbelous sounds fab I'll need to check it out sometime soon :)

@Kezz101 We've got a spec draft over here

Oh nice! It looks really interesting

Don't forget that you can give inputs to the main board on the command line, so this board could be used as-is.

@Sparr Yes, but supplying small bytes via command line argument is annoying.

@MartinBüttner I'm pretty sure that command line "1" is marble 0x01

@Sparr Oh okay, I thought command-line arguments were read like STDIN, byte-for-byte.

@MartinBüttner You can ditch the last row, saving 3 bytes, you'll be printing zero width characters, but I doubt that that's a problem.

@overactor Hm, I don't know... outputting additional characters (even if they're unprintable) still seems to violate the output format for me. Might be worth a meta question though.

I feel like you could stack things differently and save a line here. Will the two processing chains (below the two duped inputs) fit side by side in any way?

@Sparr maybe with cylindrical boards?

I think you need another / under the first &0 to avoid dropping a 0x01 to stdout before a "-"

here's my test harness, if it's useful: for i in 1 2 3 4; do marbelous.py powersofi.mbl $i | hexdump -C ; done

@Sparr ah, you're right. I think I've fixed it without using extra characters.

@MartinBüttner now the matble in the upper &2 synchronizer is falling through and triggering the &0, causing you to print -i in stead of i for input%4 == 1.

@overactor oh right, I should probably terminate the board instead. Will test later.

JavaScript (ES6) 29-5 = 24
Supports negative power.
f=n=>(n&2?'-':'')+(n&1?'i':1)

ES5 :
function f(n){return (n&2?'-':'')+(n&1?'i':1)}

Yep, shorter (f=n=>[1,'i',-1,'-i'][n%4]). But it's less sexy and it won't support negative powers. It depends on the bonus I guess.

Nop, 29 bytes. Negative are supported with this code.

Does JS have a bitwise & operator? If so you can do &3for a true modulus-4 operation. Edit: looks like it does as &2 is used in your answer...

APL (Dyalog), 8 chars - 15 bonus = score -7
The built-in (and thus prohibited) function is 0J1*⊢, but this uses @blutorange's method.
¯12○.5×○

The challenge author, Kezz101, wrote:

If you support any real number you can output in any valid complex form.

This returns a complex number in the form aJb which is the normal way for APL to display complex numbers.
Try it online!
Explanation
¯12○ find the unit vector which has the angle in radians of
.5× one half times
○ the argument multiplied by  (the circle constant)

Python 28 bytes - 5 = 23
Supports -ve inputs.
Assuming lambda functions are acceptable (Thanks FryAmTheEggman!):
lambda n:n%4/2*'-'+'1i'[n%2]

otherwise 31 bytes - 5 = 26
print[1,"i",-1,"-i"][input()%4]

:) Also, if you are allowed to use anonymous lambdas (I think the meta consensus was yes...) lambda n:[1,"i",-1,"-i"][n%4] is shorter

@FryAmTheEggman I'm a python noob.  How do I call such a thing?

You can't call it exactly. You have to store it somewhere you can access. So you could do foo=..., or you could do map(<your lambda>,range(10)) to get a list of values of i^n from 0-9.

Basically you are making a function pointer, if that is more clear :P

You're supposed to output a string.

@user2357112 I assume the print version is fine.  Are you saying I should quote the 1 and -1 in the lambda version?

@DigitalTrauma: Yes, although you may be able to do better with string slicing tricks. For example, lambda n:'--1i'[n%4-2::2].

@user2357112 - thats cool, though I feel guilty taking that as my best answer as I still don't fully understand what you did, and certainly wouldn't have come up with it myself.  If you make your own answer with this I'll upvote for sure.  Meanwhile I added my best effort which returns strings (and a leading space unfortunately)

To translate user2357112's post: Take every other character from '--1i' starting at index n%4-2. When python gets a negative index, it will start that many positions left from the end of the array, and then go up to 0. This way, 0 and 1 don't ever hit the - signs, while 3 and 4 do.

lambda n:n%4/2*'-'+'1i'[n%2] Removes the space and is shorter :)

@user2357112 Very clever! Another char off: '--i1'[~n%4::2].

Pari/GP, 14 bytes - 5 = 9
As a ring, \$\mathbb{C}\$ is isomorphic to \$\mathbb{R}[x]/(x^2+1)\$.
n->i^n%(i^2+1)

The i here is just a symbol, not the imaginary unit (which is I in Pari/GP).
Try it online!

(Emacs) Lisp – 34
Just for fun, in (Emacs) Lisp:
(lambda(n)(elt[1 i -1 -i](% n 4)))

If you want to use it, use a defun or use funcall:
(funcall
 (lambda (n) (elt [1 i -1 -i] (% n 4)))
 4) => 1

(mapcar
 (lambda(n)(elt[1 i -1 -i](% n 4)))
 [0 1 2 3 4 5 6 7 8])
 => (1 i -1 -i 1 i -1 -i 1)

R, 29 - 5 = 24 bytes
c(1,"i",-1,"-i")[scan()%%4+1]

Try it online!
Same as most methods above, takes a modulo of 4, and increases that by 1, because R's arrays are 1-indexed. Works for negative integers as well.
I was worried about mixed outputs here, but Giuseppe pointed out that R coerces numeric types to string types when they are mixed.

29 - 5 = 24 bytes

@Giuseppe Totally blanked on that. My concern with that is that the output is technically mixed, half string, half numeric.

nope, R automatically coerces numeric types to character when they're mixed! Hadley's book explains this pretty well -- just Ctrl + F to "Coercion" and you'll see it, but the whole book is worth a read (for non-golfing purposes mostly, but sometimes you pick up a trick or two, heheh)

PowerShell, 28 bytes -5 = 23
('i',-1,'-i',1)["$args"%4-1]

Try it online!
Port of all the cyclic indexing

Pure bash, 29 bytes - 5 = 24
Supports -ve inputs.
a=(1 i -1 -i)
echo ${a[$1%4]}

Befunge-98, 41-5 = 36 35-5 = 30 32-5 = 27
&4%:01-`!4*+:2%'8*'1+\2/d*' +,,@

Supports negative integers. Not going to win any awards with this solution, but whatever.
It just accepts a number as input, does some trickery on the modulus (which, frustratingly, doesn't work like usual modulus for negative numbers in the interpreter I used to test it) to make negatives work, and then does some silly conditionals to decide what each character should be.
I'm sure this can be golfed down plenty further. For now, here's another solution that doesn't accept negatives, but makes up for the loss of the bonus by being shorter:
Befunge-98, 32 26 23
&4%:2%'8*'1+\2/d*' +,,@

Edit - Now takes advantage of the fact that "-" is 13 (0xd) characters away from " ".
Edit 2 - Now, again, takes advantage of the fact that "i" is 56 (0x38, or '8) characters away from "1".

MATLAB, 33 bytes - 5 = 28
x={'i','-1','-i','1'};x(mod(n,4))

Even though it's a few bytes more (37-5=32), I actually like this approach better:
x='1i -';x((mod([n/2,n],2)>=1)+[3,1])

i^3 is -i, rather than i, guess it just adds 1 char. -- Sidenote for other readers: without the first rule of the challenge, the Matlab solution would only be 3 characters long.

Yes, that was a typo. Fixed! Thanks for noticing... At least the second (a bit more interesting) approach is correct =)

Java 8 Score: 72
In Java, the worst golfing language ever!
Golfed:
java.util.function.Function s=n->{new String[]{"i","-1","-i","1"}[n%4]};

Expanded:
class Complex{

    java.util.function.Function s = n -> {new String[]{"i","-1","-i","1"}[n%4]};

}

Note: I'm not used to Java 8. I also do not have the runtime for it yet. Please tell me if there are any syntax errors. This is also my first golf.
Edit: Removed import.
Edit: Removed class declaration.
Another answer with score = 87 - 15 = 72
java.util.function.Function s=n->{Math.cos(n*Math.PI/2)+"+"+Math.sin(n*Math.PI/2)+"i"};

Expanded:
class Complex{

    java.util.function.Function s = n -> {Math.cos(n * Math.PI/2) + " + " + Math.sin(n * Math.PI/2) + "i"};

}

You can save some with "import java.util.*"

@Anubian Noob Class Function is in package java.util.function not java.util (or am I wrong?).

But if you do java.util.* the .* means import everything under the package. Just like you're currently importing all classes in the fuction package.

@ Anubian Noob import only imports the classes in that package. It does not import any of the classes from packages in that package. For example, class Function is in package java.util.function but not in package java.util.

Oh my bad, sorry about that.

I soooo have to update my Java skills :/

I don't think the challenge requires a class declaration.

C 77
main(){int n;scanf("%d",&n);char c[]={n%4>1?'-':' ',~n%2?'1':'i',0};puts(c);}

Improved thanks to Ruslan
C 74-5=69
Oh and of course the most obvious approach
main(){unsigned n,*c[]={"1","i","-1","-i"};scanf("%d",&n);puts(c[n%4]);}

You can remove parentheses around n%2 and use ~ instead of ! because negating n first, then %ing with 2 will give the same result, at least for n<(1<<32)-1. And C doesn't require to explicitly define return type for function, so you can remove int  at the beginning. And also use 0 instead of '\0'. Thus -9 chars.

Java: 151 131-5=126
Golfed:
class A{public static void main(String[]a){int n=Integer.parseInt(a[0]);System.out.print(n%4==0?"1":n%4==1?"i":n%4==2?"-1":"-i");}}

Ungolfed:
class A {
    public static void main(String[] a) {
        int n = Integer.parseInt(a[0]);
        System.out.print(n % 4 == 0 ? "1" : n % 4 == 1 ? "i" : n % 4 == 2 ? "-1" : "-i");
    }
}

As a function: 72-5=67
Golfed:
void f(int n){System.out.print(n%4==0?"1":n%4==1?"i":n%4==2?"-1":"-i");}

Ungolfed:
public void f(int n) {
    System.out.print(n % 4 == 0 ? "1" : n % 4 == 1 ? "i" : n % 4 == 2 ? "-1" : "-i");
}

Yes, yet another Java reply - and golfed even worse than ever. But you work with what you can...
EDIT: added function version.
EDIT 2: so, after a bit of trial and error, here's a version that tries to do it by the book, without exploring the cycle loophole. So…
Java with value calculation: 146-15=131
Golfed:
class B{public static void main(String[]a){float n=Float.parseFloat(a[0]);System.out.print(Math.cos((n*Math.PI)/2)+Math.sin((n*Math.PI)/2)+"i");}}

Ungolfed:
class B {
    public static void main(String[] a) {
        float n = Float.parseFloat(a[0]);
        System.out.print(Math.cos((n * Math.PI) / 2) + Math.sin((n * Math.PI) / 2) + "i");
    }
}

(at least, I think I can claim the top bonus, correct me otherwise)

you could reduced your code, if you pass it to main as argument.

@user902383 I could always make a function, indeed. Probably will post both versions, too.

actually i was thinking about parsing it, so you will have int n = Integer.parseInt(a[0])

@user902383 Daaaaamn, didn't even remember that. thumbs up

OCaml 47
let m n=List.nth["1";"i";"-1";"-i"](n mod 4);;

Not an award winning solution, but this is my first time code-golfing, so I'm not exactly sure of what I'm doing.
I tried to use pattern matching, but that got me over 58.

05AB1E, score 5 (10 bytes - 5 bonus)
1'i®„-i)Iè

Try it online or verify some more test cases.
Explanation:
1           # Push 1
 'i        '# Push character "i"
   ®        # Push -1
    „-i     # Push string "-i"
       )    # Wrap everything on the stack into a list: [1,"i",-1,"-i"]
        Iè  # Use the input to (modular 0-based) index into it
            # (and output the result implicitly)

I think you've got it the wrong way round: $i^0 = 1$, not $i$. Fix it like this.

@TheThonnu Wait, you're completely right.. I must have accidently swapped your and my own test suite when I checked with the four provided test cases in the challenge description earlier today.. So sorry, my bad. Weird how no one noticed my mistake back in 2019 (including myself).. :/ Thanks for the fix. And how it also works for $i^0$ I guess, even though it's a bonus instead of necessity. :)

Scala, 7 bytes - 15 = -8
Port of @blutorange's devious Ruby answer. Go upvote that!
1->_*90

Try it online!
Takes a BigDecimal as input, outputs (Int,BigDecimal), but honestly, you could make it work for any type with a * method.
Crazier solution, 3 bytes - 15 = -12
90*

Try it online!
First component is assumed to be 1, so it only returns the second.
Boring solution, 30 27 bytes
" 1 i-1-i"drop _%4*2 take 2

Try it online!

Arn, 13 bytes - 5 = 8
◄š<f5®…┘┤ï\Î±

Try it!
Explained
Unpacked: [1"i"n_1"-i"]?%4
  [        Begin sequence
    1      Literal one
    "i"    String
    n_     Negate
      1
    "-i"
  ]        End sequence
?          Indexed by
    _      Variable initialized to STDIN; implied
  %        Modulo
    4      Literal four

Husk, (14 11 bytes - 5) = 6
Edit: -3 bytes thanks to Razetime
!C2¨¹-1-i 1

Try it online!

you can remove the %4⁰.

Husk, (30 bytes - 15) = 15
m₁m*1.57Ṡe-1
Σz*İ_m§/Π`^⁰↑99İ1

Try it online!
(The header in TIO rounds the rational number output into a fraction with maximum 3-digit numerator & demominator, for readability)
Calculations with real numbers are a bit ticky in Husk, since it doesn't have any trigonometric functions.  So here I implement -sin(x) as Σz*İ_m§/Π`^⁰↑99İ1 (99 iterations of the Taylor series), and use 1.57 as a very rough approximation for pi/2.
To make matters even more difficult, Husk natively outputs rational numbers as fractions, rather than decimals.  So there aren't any 'floating point' inaccuracies (but there are, of course, inaccuracies!).  The byte-count to round-away the (non-floating-point) inaccuracies for integer inputs is currently not included in the score.  Add +10 bytes to include it.

Ruby 32-5=27
puts(%w[1 i -1 -i][gets.to_i%4])

Works for negative powers!

You can trivially golf this more with puts %w[1 i -1 i][gets.to_i % 4].

Perl, 26 - 5 = 21
say qw(1 i -1 -i)[pop()%4]

works as a standalone program (argument on the commandline) or the body of a function.

Python - 31
print[1,'i',-1,'-i'][input()%4]

I have only recently started learning python. Even though I know it's not good, it's the best I can do.

Haskell GHCi, 29 Bytes - 15 = 14
i p=[cos(p*pi/2),sin(p*pi/2)]

Usage:
*Main> i 0
[1.0,0.0]
*Main> i pi
[0.22058404074969779,-0.9753679720836315]
*Main> i (-6.4)
[-0.8090169943749477,0.5877852522924728]

Jelly, 2 - 20 = -18 bytes
ı*

Try it online!
It doesn't use an i ^ x builtin but it uses builtins for 1j and ** so not sure if allowed.

"If your language supports complex numbers, don't use any functions or arithmetic that could work this out." I think it's pretty clear...

@totallyhuman Well, I'm not sure if the 1j literal is banned either though?

Yeah, but the arithmetic (*) is.

@totallyhuman Hm, maybe I'll add another version below, although "don't use any functions or arithmetic that could work this out" seems to suggest that I can't use a built-in to do this exact task...BTW the way he phrases it gets me to think that you're encouraged to use 1j literals.

Perl 6, 19 bytes - 5 = 14
{<1 i -1 -i>[$_%4]}

The result of % has the same sign as the divisor in this language.
Try it online!

C (gcc), 30 bytes
f(x){printf(L"iㄭ椭1"+x%4);}

Try it online!

Swift, 27
{["1","i","-1","-i"][$0%4]}

Try it online

Welcome to PPCG!

C (gcc), 44 bytes -15=29
#define f(x)cos(x*acos(0))+1i*sin(x*acos(0))

Try it online!
Handles signed and noninteger arguments.

R, (29 bytes -15) = 14
cos(m<-scan()*pi/2)+sin(m)*1i

Try it online!
Conventional complex number output; works for negative and real inputs.
(for completeness, there is also c(1,scan()*90) for a score of -1, using blutorange's dubious inventive polar output format in degrees)

Based on "(this bonus includes the -5 from the above bonus)", I don't think you can include both the -5 and -15 bonuses

@EthanChapman Ah, yes, you're right.  Fixed.  I was wondering why nobody else had such a good bonus...

Rust 34 33 bytes
fn main() {
	// closure:
	// |n:usize|["1","i","-1","-i"][n%4]

	// call with:
	print!("{}", (|n:usize|["1","i","-1","-i"][n%4])(3));
}

Try it online!
The closure itself:
|n:usize|["1","i","-1","-i"][n%4]

You should probably put a version without comments and whitespace here as well, so it's easier to see what the actual 34 byte program is.

Haskell, 29 bytes - 5 = 24
f n=words"1 i -1 -i"!!mod n 4

Works for negative powers.
I had a pointfree version worked out, but it turns out it's actually longer.
f=(words"1 i -1 -i"!!).(`mod`4)

C 105, was 117
char c[2];
int main()
{
int n,i,j=0;scanf("%d",&n);i=n%4;
i>1?c[j++]='-':c[j+1]='\0';
c[j]=i&1?'i':'1';
puts(c);
}

It doesn't even compile because you must parenthesize the assignments after : in ?: statements in plain C. Also, what's the point of using 0==0 when you can use single char 1? And no need in parentheses before ?. Also, the last ?: statement could be shortened to c[j]=i&1?'i':'1';.

@Ruslan In CodeBlocks Mingw there is only 1 warning around i&0. i&0==0 is a test for even, if i is even the result is 0 else it is 1.

Yeah, but what's the point of using 0==0 when it's identical to 1? Note that == has higher precedence than &, otherwise your (supposed) test of (i&0)==0 would always be true.

Clojure (64 54 31 chars)
(defn i2n[n](println(case(mod n 4) 1 "i" 2 "-1" 3 "-i" 0 "1")))

Edit
Per @SeanAllred's suggestion, here's a version which uses a literal vector instead of a case function:
(defn i2n[n](println (["1" "i" "-1" "-i"] (mod n 4))))

Edit 2
By counting on the REPL to print out the resultant collection and coding the function using the #() shortcut we can reduce it to
#(["1" "i" "-1" "-i"](mod % 4))

(Which is actually much more Clojure/Lisp-ish as the function now actually returns the generated result, allowing the function to be used with map, as in
(map #(["1" "i" "-1" "-i"](mod % 4)) [0 1 2 3 4 5 6 7 8])

which prints
("1" "i" "-1" "-i" "1" "i" "-1" "-i" "1")

Share and enjoy.

Instead of using a select structure, can't you use some sort of explicit array as in my answer?

C# 63-5 = 58
public string m(int n)=>n%2==0?(n%4==0?"1":"-1"):(m(n-1)+"i");

output is in form -1i, 1i, i, or 1

You cannot claim the -15 bonus as this would fail on the input 3.247104. You may only claim the -5 bonus.

Oh, sorry, yes - I didn't read the bonuses bit properly

I have asked a question on meta about this answer: http://meta.codegolf.stackexchange.com/questions/4851/are-c-linqpad-answers-encouraged

Groovy: 27-5 = 22
f={n->[1,'i',-1,'-i'][n%4]}

Ruby, 208 - 15 = 193
p=Math::PI/2;t=gets.to_f*p;l=->n{Math::cos(n).round(2)};k=l.call(t);if k!=0;k=k.to_i if k.abs==1;print k;end;m=l.call(t+p);if m!=0;r="i";r='-'+r if m==-1;r="#{m}"+r if 1>m && -1<m;r=" + "+r if k!=0;puts r end

This implementation completely conforms to the spec! 1.0 is written as 1, -1.0i is written as -i, etc. I don't see any other solution that incorporates this along with supporting floating points, except for maybe the TI-Calculator.
Ungolfed:
p=Math::PI/2
t=gets.to_f*p
l=->n{Math::cos(n).round(2)}

k=l.call(t)
if k!=0
  k=k.to_i if k.abs==1
  print k
end

m=l.call(t+p)
if m!=0
  r="i"
  r='-'+r if m==-1
  r="#{m}"+r if 1>m && -1<m
  r=" + "+r if k!=0
  puts r
end

l.call(t) → l[t]. Read Tips for golfing in Ruby for more.

C, 61
main(n){scanf("%d",&n);printf("%c%c",n%4/2*45,n%4%2?'i':49);}

Try it here.

PARI/GP, 26 - 5 = 21
n->Str([1,I,-1,-I][n%4+1])

n->cos(t=Pi*n/2)+I*sin(t) is one character shorter, but doesn't handle exact answers. Of course n->I^n is disallowed, and presumably also PARI's powIs.

Java (OpenJDK 8), 39 bytes
n->new String[]{"1","i","-1","-i"}[n%4]

Try it online!

Haskell, 27 bytes
(cycle(words"1 i -1 -i")!!)

Try it online!

Tcl, 50 bytes
proc I n {expr $n%4==3?"-i":$n%4==2?-1:$n%4?"i":1}

Try it online!

05AB1E, 12 bytes
®sfgm¹Éi1'i:

Try it online!

®             # Push -1 onto the stack.
 sfg          # Push the number of prime factors of input.
    m         # -1^(number_prime_factors)
     ¹Éi      # is input even?
        1'i:  # if input was even, replace 1 with i.

Forth (gforth), 53 bytes - 5 bytes (bonus) = 48 bytes
: f 4 mod dup 1 > if ." -"then 2 mod 56 * '1 + emit ;

Try it online!
This works for both positive and negative numbers
Code Explanation
: f             \ start a new word definition
  4 mod dup     \ get result of n % 4 (and make a copy)
  1 > if        \ if result is 2 or 3
    ." -'       \ print a minus sign
  then          \ end the if
  2 mod 56 *    \ get result modulo 2 and multiply by 56 (difference between ascii for '1' and 'i')
  '1 +          \ add to ascii value of '1'
  emit          \ output the character for the given value
;               \ end the word definition

Zsh, 30 bytes, score 25 (-5)
a=({,}{,-}{1,i})
<<<$a[$1%4+5]

Try it online!
Based on the bash answer, but with some changes needed:

%4 results in a value in the range -3 to 3 (negative inputs give negative outputs), so we shift up with +5.
Arrays are 1-indexed, hence +5 instead of +4.
We make our array twice as long by using brace expansion: {,}foo expands to foo foo.

Google Sheets, 32-15=17

Input is in A1
B1: A1/2*PI(
Result: =COMPLEX(COS(B1),SIN(B1

Stax, 9 - 5 = 4 bytes
ü▲τ}εT├?á

Run and debug it

Branch, 38 bytes
^\4^%/;c1^>/0c45^?[.0]anc2^%/49c105^?.

Try it on the online Branch interpreter!
Explanation
      Implicit - the initial node's value is set to the first argument
^\4   Create a parent and sibling and set the right child to 4
%     Modulo
/;    Go to the left child and copy the mod result
c1    Go to the right child (automatically assigned register C) and set it to 1
^     Return to the parent (the mod result)
>     1 if the mod result is greater than 1, 0 otherwise
/0    Go to the left child and set to 0
c45   Go to the right child and set it to 45 (codepoint for "-")
^     Return to the parent
?     Conditional - if the mod was greater, go to the right child (45), and left child (0) otherwise
[  ]  While the value isn't 0
 .    Output it
  0   And set it to zero (this is basically an if statement)
an    Go to the left child and load the first argument (register N by default)
c2    Go to the right child and set it to 2
%     Modulo
/49   Go to the left child and set it to 49 (codepoint for "1")
c105  Go to the right child and set it to 105 (codepoint for "i")
^     Go to the parent
?     Conditional - if the exponent was even, go left, otherwise, go right
.     Output

Lua, 33 - 5 = 28 bytes
print(({1,'i',-1,'-i'})[...%4+1])

Try it online!

Go, 75 57 bytes, no bonus
func(n int)string{return[]string{"1","i","-1","-i"}[n%4]}

Try it online!
if n<0{n=4+n} is included here because the % operator in Go returns negative if the dividend is negative.

At the moment, this qualifies for a -5 bonus (since it handles negative numbers too), so your score is 70 bytes. But, if you don't go for any bonuses, you can get this down to 58 bytes

You can also remove the redundant newline for 57 bytes

Keg, 15 - 5 = 10 bytes
1i0;`-i`¿4%⊙&ø&

Try it online!
Pushes the four different possibilities and then takes the input modulo 4 and indexes the stack.

You program supports negative numbers, you should have the -5 bonus! -5 if you can work the value out where n is also negative

Vyxal, r, 5 - 15 = -10 bytes
90*1"

Try it Online!
Well if the Ruby answer's output method is valid, so is this. Outputs in "polar form (angular unit: degrees)".
Explained
90*1"
90*   # Multiply the input by 90
   1" # Push one and pair the two inputs. The `-r` flag makes dyads take their arguments in reverse.

Thunno 2, 10 - 5 = 5 bytes
`-iu'i1K$i

Attempt This Online!
Port of Kevin Cruijssen's 05AB1E answer.
Explanation
`-iu'i1K$i  '# Implicit input
`-i          # Push the string "-i"
   u         # Push the number -1
    'i      '# Push the string "i"
      1      # Push the number 1
       K     # Wrap the stack into a list
             # -> [1, "i", -1, "-i"]
        $i   # Index the input in
             # (0-based, modular)
             # Implicit output

source: Stack Exchange

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

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

sort: votes


text:
Algorithm for finding a regex for a list of "words"
I just discovered this website and was amazed. Somehow this challenge popped into my mind:
Provided a very long list of words; Write or describe an algorithm which finds a regex to match them all.
Ex.: A very long list of Dates, model-numbers, CD-Codes, ISBNs et cetera.
I hope it's not too big or does not belong here. Please refer to downvote in that case but write a comment and I will delete this.
Edit: Sorry at my clumsy attempt. I fear there is not a very sharp goal.
Of course .* is not what I look for :) Here are some specifications:

It has to match all words
It has to group characters and find out what kind of characters are in that group, e.g. identify that an american date always consits of one to four numbers, then a slash etc.
It does not need to be able to identify transverses etc
There is a huge list of not-to-match-examples available as well

Winner is the one who can write a code which does what I described for one of my examples (or a similar one). In case that no code is committed, the winner is the one who can convince me, that the described algorithm could work.

something like .* ?

What's the winning criterion? Shortest code? Shortest regex? Something else? Does the regex need to match only the words?

I'm afraid your spec still isn't very solid. I don't know what you mean by your third bullet point. How long is a "huge list" (which can btw easily satisfied for any finite definition of "huge", with the expression ^.{n}$, where n  is the longest input string). And how should the grouping work? If my input is foo, bar, abc I can always form a pattern [fba][oab][orc], but that doesn't make a lot of sense. Or [abcfor]{3}. It's very unclear what a valid solution has to do.

Your problem is "regex golf". Search this site for it, or google it.

What about removing not-to-match list and asking for the shortest regex on some hidden set of tests?

You might be interested in this.

In Java 8:
public class Reg{

    public static void main(String... args){
        System.out.println(args[0].replaceAll(",", "|"));
    }

}

Matches only the strings inputed. Expects input to be of form:
goodWord1,goodWord2,goodWord3...(space)badWord1,badWord2,badWord3...
Edit: Edited for new requirements. Now accepts a list of bad words also. It also now works in Java 7.

Good quick answer. But not what I looked for. Sorry. I gave some more details.

@3244611user It matches only the words in the input sequence. It matches no other words. You don't even need a list of not-to-match examples. See next program for one that finds the shortest answer.

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


text:
Solving Des Chiffres Et Des Lettres - The total is right
One of the games of the French TV show Des chiffres et des lettres, called Le compte est bon ('The total is right'), consists of the following :
You get a number A between 101 and 999 as well as six numbers E1,..,E6 chosen randomly, with possible repetitions, from {1,2,3,4,5,6,7,8,9,10,25,50,75,100}
The goal is to get as close to A as possible by using the operations +,-,*,/ on E1,...,E6. Each number may only be used once, but you do not have to use them all. The result of each operation must be a positive integer
Example : A=859, E1,..,E6= 6, 75, 3, 6, 8, 9 -> Best result : 858=(((75+6)-(9-6))*(8+3))

Following that concept, here are the rules :

Write a function that takes as argument a positive integer A and a list of positive integers L. The function returns a string showing the closest one can get to A, which we'll call B, using the numbers in L, in the format B = operations (ex for A=859 : "858=(((75+6)-(9-6))*(8+3)))", you may reduce the number of parenthesis as long as it remains clear).
The only allowed operations are +,-,* and /. The result of each of the operations must be positive integers.
Each number of L may only be used once, but you don't have to use all the numbers.

This is code golf, the shortest code in bytes wins !

Out of curiosity, what are the total number of possible answers given 6 numbers and 4 operators?

@Compass I'm not sure, but the program I made in Python runs about 1500000 iterations (It's a pretty basic one)

It's not actually a duplicate, as this one is more constrained.  A winning answer here will probably not be general enough to qualify there, and a qualifying answer there will probably not win here.  Related, but not the same.


text:
Shortest Code to Translate a PHP array
NOTE: This question was migrated from https://stackoverflow.com/q/27134588/1442685
PHP QUESTION
Almost purely out of curiousity, how can I take an array like this:
array( 'fruit' => 'banana', 'drink' => 'milk')

And convert it to an array like this:
array( 'fruit=banana', 'drink=milk')

Requirements

Cannot use anonymous functions
If needed, can only use array_* functions that accept callable if that callable is native to PHP
Must be a one-liner solution

This is not for a class. I'm curious to see how clever one can be with array functions. Given the requirements, is it possible?

Hello, welcome to PPCG :) Presumably, you want the shortest code to do this? If so, I recommend tagging your problem [tag:code-golf] (Currently this lacks a winning criterion and could be closed). Consider using our sandbox for future questions.

Thanks @FryAmTheEggman - I've updated my tag, and am reading up on the sandbox now.

No problem :) Just some nit-picking, you might want to edit your title to reflect the rules i.e. "Shortest Code to translate a PHP array." You also shouldn't say "preferably"; either force one-liners, or don't. Also, just like SO, wait a while before accepting ;p

Got it. Will do.

This question isn't migrated: it's cross-posted, and it's already been answered on SO.

Yea, I don't know how to do that/I don't have authority to. How do suggest I handle this?

If you want to migrate a question from one site to another within the Stack Exchange network, you should use a custom flag. But 99% of the time you should pay no attention to people on SO who say that a question would be a better fit on PPCG, because most of them have no idea what's on topic here and what isn't.

explode('&',http_build_query($a))

33 bytes

PHP actually has an explode function? Cool. :D

By the way, since this is code-golf, you should update your answer with the length of your code in bytes. Also, I think you can remove that space character ;)

@FryAmTheEggman.  Thanks, it looks like vBuck modified it for me.  New to codegolf, just copied my answer from SO tbh. :)

split is one character shorter than explode (not the same, but in this case functionally equivalent).

@Devon Whenever you copy your answer from somewhere else, you should always give credit to the original source. Could you edit that in?

@isaacg, I copied it from myself lol.

@primo, split is deprecated as of 5.3

@Devon E_DEPRECATED is of no consequence to code golf.

@primo, okay Thanks, I think I'm understanding how this site works now.

Note that http_build_query() will encode special characters like &. http://rextester.com/ZFSIX69274

PHP (33 bytes)
I am not 100% sure if this is valid.
I used 0 (zero) functions.
This solution is 1 byte shorter than @Devon's solution.
The code:
foreach($a as$k=>$v)$z[]="$k=$v";

The var $a is the array, the var $z will have the new array.
There are no restrictions to the vars or how it should be implemented.

Nice solution. It does work, but @Devon's answer still takes the cake on the following grounds: 1). Easier to read; 2). It's truly a 'one-liner' solution, where your solution requires multiple lines to implement -- ie: foreach cannot be evaluated as part of an expression, and the addition of $z requires another line for assignment or use.

I totally disagree with point 2. PHP is a free-form language (most of the whitespace don't matter) and the braces are optional for 1 expression. And the foreach can be implemented as an expression using eval('foreach($a as$k=>$v)$z[]="$k=$v";return$z;');, but DO NOT USE THIS NO MATTER WHAT! But still, I wasn't expecting to win this one: I just wanted to show another solution. But mine as the advantage of keeping a copy of the old array.

Hmm, well that's a clever way to evaluate a loop. I'll give you that much :) If memory footprint was a requirement, I wonder how the loop + 2 arrays would stack against the consumption of @Devon's code.

@vBuck It will consume around +1kb than the other solution. But nothing serious. About cpu cycles, mine probably would be a tiny mini bit faster. The overhead of calling 2 functions + looking for a substring + storing it's multiple parts and so on vs. a single iteration over 2 keys.

32 bytes
foreach($a as$k=>&$v)$v="$k=$v";

Update by reference, shaves off 1 byte.
Not sure how important removing the original key is, sort of a grey area.
This is what I mean:
[
    ['fruit'] => 'fruit=banana',
    ['drink'] => 'drink=milk'
]

But it saves on variables, as your not creating a new array


text:
Challenge Ulamspiral
The challenge
Get familiar with the Ulam spiral:
The aim is to print the spiral like in the picture above!
Rules
Write a function ulam(n)
where n is a odd positive integer and describes the size of the grid to print.
All non-primes numbers should be replaced with | horizontal and - vertical as in the picture above following the spiral. (Corner elements belongs to the vertical)
All numbers need to take the same amount of space visually and smaller numbers are right centered vertically:

1000
 100
  10

10 needs two spaces on the left and 100 needs one space left.
This property depends on the biggest number you have to calculate.
Example: (n=3)
 -  - 3
|     |
7   - 2
|
 -  -

The test for primes/sieve you have to write yourself.
Smallest byte code wins.
Bonus
- 25 if you can make it more pretty find some symbols so that - and | takes the same space (-25 more if you can find a pretty corner symbol) and the symbol should show the line where the spiral evolves.

You can always use box-drawing characters for the lines, assuming you've got Unicode support (or code page 437)... Those are made to look nice, after all.

@Kasran no need for unicode, you can use extended ascii (codes 128-255), which has a 'good enough' set of box-drawing characters.

@stokastic "extended ASCII" isn't a single thing (and one such extension is exactly code page 437, which is probably what you're thinking of)

You refer a couple of times to a "picture above", but I don't see it...

I mean in the picture in the "link above"

Your example for n=3 shows what looks like a 4x5 grid.  Can you expand on how n describes the grid size?

yes that was a mistake it now it it is a 3x3 grid

Python 3 - 506 479 bytes
q=range
def p(n):
 for d in q(2,n//2+1):
  if n%d==0:return 0
 return 1
w=int(input());m=w**2;z=len(str(m))
def k(n):
 if n==1:return'-'*(z-1)+'>'
 if p(n):return str(n).zfill(z)
 return'.'*z
l=[k(n+1)for n in q(m)];s=[[0for n in q(w)]for n in q(w)];x=y=w//2;t=[n//2for n in q(2,w*w)];c=[[1,0],[0,-1],[-1,0],[0,1]];j=p=0
for r in t:
 d=c[p%4];p+=1;i=0
 while i<r and j<m:
  s[y][x]=l[j]+' ';x+=d[0];y+=d[1];i+=1;j+=1
s=[''.join(l)for l in s]
for l in s:print(l)

I am not sure if the byte count is correct.
Also, this can most likely be made shorter (I'm new to Python).
Right now I'm just substituting all non-primes with periods. You can change this to any character.
Note: You should only enter odd numbers as input, as otherwise the program breaks.
Furthermore, my function to determine whether a number is prime is the most primitive it can be, for the sake of less characters, so it is not efficient. Though it ran just fine on my computer with input values less than 100 in just under a second.
Note: Input values above 25 or 30 won't display correctly unless you have a ridiculously wide screen.

I just realized I didn't write a function. Oh well. One can easily change it to a function by removing w=int(input()) and adding a function header like def ulam(w): saving 13 bytes I think (though the function would have to be indented).

You could do, say, j=p=0. Also, boolean values are castable to 0 and 1, so you might be able to shorten your p(n) function a little bit that way if you're careful. And whitespace is costly in Python; contracting some of those statements onto a single line with semicolons can save you a few characters.

@Kasran Thanks! I got it down over 30 characters

You can make your p function quite a bit shorter with p=lambda n:all([n%d for d in q(2,n//2+1)])... at least, that works in Python 2. Also, surrounding a thing functions likerepr, which is handy for turning ints into strings in a golfy way; consider using that instead of str`.


text:
Numbers as Circular Graphics
First, study this puzzle to get a feel for what you will be producing.
Your challenge is to write a program or function which will output a circular graphic like the ones from the puzzle, given a (base 10) number between 1 and 100 (inclusive). This is similar to this challenge, except that you will be producing a graphic rather than roman numerals. The following circles represent the numbers 1-10, from left to right:

As the answer to the puzzle states, your graphic should read like a roman numeral from the inside-out, where the line thickness represents the roman numeral symbols and the entire graphic represents the number. For your reference, here are the line thicknesses which you will need. Each line should have a 3px padding between it and the next.
Number  Roman Numeral   Line Width
1       I               1px
5       V               3px
10      X               5px
50      L               7px
100     C               9px

Please post a sample or two of your output. Assume input is correct, standard loopholes, etc and so forth. This is code golf, so fewest bytes win. In the event of a tie, most votes win. Good luck!

Is the correct absolute size of the image necessary, or is it sufficient to have the right relative sizes?

@DavidZhang Yes, please stick to the line and padding sizes that I listed, for fairness sake.

Mathematica - 166 181 bytes
A bit more concise than the other Mathematica answer, thanks in part to a more point-free style.
c = Characters; r = Riffle;
Graphics[r[{0, 0}~Disk~# & /@ Reverse@Accumulate[
    l = {3} ~Join~ r[2 Position[c@"IVXLC", #][[1, 1]] - 1 & /@
        c@IntegerString[#, "Roman"], 3]], {White, Black}],
    ImageSize -> 2 Total@l] &

All whitespace is for clarity only. This defines an anonymous function which returns the desired graphic.
Animation

Generating an animated GIF of the number circles is trivial in Mathematica, which has built-in functions for animating and exporting sequences of arbitrary objects. Assuming the above code has just been executed,
Table[Show[%@n, PlotRange -> {{-100, 100}, {-100, 100}},
    ImageSize -> 200], {n, 1, 399, 1}];
Export["animcircles.gif", %]

Example Output

Please post a few results. Sorry for not asking this is the first place. I've also changed the question to accept functions.

Thanks for the suggestions @MartinBüttner. The code has been fixed to output correctly-sized images, and example output has been added.

Your animation wiggles. Not that I could do better.

Hmm, you're right. I'm really not sure why it does that, considering I specified the plot range explicitly for Mathematica.

Maybe related to the wiggling: http://mathematica.stackexchange.com/q/134272

Common Lisp - 376 331 304 bytes
(use-package(car(ql:quickload'vecto)))(lambda(n o &aux(r 3)l p)(map()(lambda(c)(setf l(position c" I V X L C D M")p(append`((set-line-width,l)(centered-circle-path 0 0,(+(/ l 2)r))(stroke))p)r(+ r l 3)))(format()"~@R"n))(with-canvas(:width(* 2 r):height(* 2 r))(translate r r)(map()'eval p)(save-png o)))

Examples
 (1)
 (24)
 (104)
 (1903)
 (3999)
Animation
For numbers from 1 to 400:

NB: For the record, this animation is done as follows:
I have a modified version of the code, named rings which returns the width of the produced image.
Hence, the result of the the following loop is the maximum size, here 182:
 (loop for x from 1 to 400
       maximize (rings x (format nil "/tmp/rings/ring~3,'0d.png" x)))

The whole loop takes 9.573 seconds. That gives approximately 24ms for each integer. Then, in a shell:
 convert -delay 5 -loop 0 -gravity center -extent 182x182 ring*png anim.gif

Ungolfed
(ql:quickload :vecto)
(use-package :vecto)

(lambda (n o)
  (loop with r = 3
        for c across (format nil "~@R" n)
        for l = (1+ (* 2(position c"IVXLCDM")))
        for h = (/ l 2)
        collect `(,(incf r h),l) into p
        do (incf r (+ h 3))
        finally (with-canvas(:width (* 2 r) :height (* 2 r))
                  (loop for (x y) in p
                        do (set-line-width y)
                           (centered-circle-path r r x)
                           (stroke))
                  (save-png o))))

Explanations

The function takes an integer N between 1 and 3999 and a filename
I use (format nil "~@R" N) to convert from decimal to roman. For example:
 (format nil "~@R" 34) => "XXXIV"

The ~@R format control string is specified to work for integers between 1 and 3999. That's why there is a limitation for the range of allowed inputs.
I iterate over the resulting string to build a list P containing (radius width) couples, for each numeral C.

The width is a simple linear mapping: I use the constant string "IVXLCDM" to compute the position of C in it. Multiplying by two and adding one, we obtain the desired value:
       (1+ (* 2 (position c "IVXLCDM")))

This is however done slightly differently in the golfed version:
       (position c " I V X L C D M")

The computation of each radius takes into account the width of each ring as well as empty spaces between rings. Without any speed optimization, computations remain precise because they are not based on floats, but rational numbers.
Edit: I changed the parameters to comply with the padding rules.

Once this is done, I know the required size of the resulting canvas (twice the latest computed radius).
Finally, I draw a circle for each element of P and save the canvas.

"This code supports all roman numerals (IVXLCDM)". Does that mean your program takes roman numerals as input? That's not what I intended, but pretty cool. Props for the animation too.

No, no, sorry if this is unclear: it works for any integer between 1 and 3999. In your question, you only required inputs from 1 to 100, and your table does not mention D or M... I'll edit that part.

HTML+JQuery, 288
HTML
<canvas>

JS
    r=3;w=9;c=$('canvas').get(0).getContext('2d')
    for(i=prompt(),e=100;e-.1;e/=10){
    if((x=Math.floor(i/e)%10)==4)d(w)+d(w+2)
    else if(x==9)d(w)+d(w+4)
    else{if(x>4)d(w+2)
    for(j=x%5;j;j--)d(w)}
    w-=4}
    function d(R){c.lineWidth=R
    c.beginPath()
    c.arc(150,75,r+=R/2,0,7)
    c.stroke()
    r+=R/2+3}

r=3;w=9;c=$('canvas').get(0).getContext('2d')
for(i=prompt(),e=100;e-.1;e/=10){
if((x=Math.floor(i/e)%10)==4)d(w)+d(w+2)
else if(x==9)d(w)+d(w+4)
else{if(x>4)d(w+2)
for(j=x%5;j;j--)d(w)}
w-=4}
function d(R){c.lineWidth=R
c.beginPath()
c.arc(150,75,r+=R/2,0,7)
c.stroke()
r+=R/2+3}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<canvas>

Fiddle

No stack snippet ?

@Optimizer Totally forgot we have that now

Java, 565
import java.awt.*;class Z{public static void main(String[]s){int i=new Byte(s[0]),j=i/10,k=i%10;String t="",u;if(j>8)t="59";if(j>9)t="9";if(j==4)t="57";else if(j<9){t=j>4?"7":"";j-=j>4?5:0;if(j>0)t+="5";if(j>1)t+="5";if(j>2)t+="5";}if(k>8)t+="15";if(k==4)t+="13";else if(k<9){t+=k>4?"3":"";k-=k>4?5:0;if(k>0)t+="1";if(k>1)t+="1";if(k>2)t+="1";}u=t;Frame f=new Frame(){public void paint(Graphics g){g.setColor(Color.BLACK);int x=0;for(char c:u.toCharArray()){int z=c-48,q=x;for(;x<q+z;)g.drawOval(99-x,99-x,x*2,x++*2);x+=3;}}};f.setSize(200,200);f.setVisible(1>0);}}

Examples
15

84

93

Formatted nicely:
import java.awt.*;
class Z {
    public static void main(String[] s) {
        int i = new Byte(s[0]), j = i / 10, k = i % 10;
        String t = "", u;
        if (j > 8)
            t = "59";
        if (j > 9)
            t = "9";
        if (j == 4) {
            t = "57";
        } else if (j < 9) {
            t = j > 4 ? "7" : "";
            j -= j > 4 ? 5 : 0;
            if (j > 0)
                t += "5";
            if (j > 1)
                t += "5";
            if (j > 2)
                t += "5";
        }
        if (k > 8)
            t += "15";
        if (k == 4) {
            t += "13";
        } else if (k < 9) {
            t += k > 4 ? "3" : "";
            k -= k > 4 ? 5 : 0;
            if (k > 0)
                t += "1";
            if (k > 1)
                t += "1";
            if (k > 2)
                t += "1";
        }
        u = t;
        Frame f = new Frame() {
            public void paint(Graphics g) {
                g.setColor(Color.BLACK);
                int x = 0;
                for (char c : u.toCharArray()) {
                    int z = c - 48, q = x;
                    for (; x < q + z;) {
                        g.drawOval(99 - x, 99 - x, x * 2, x++ * 2);
                    }
                    x += 3;
                }
            }
        };
        f.setSize(200, 200);
        f.setVisible(1 > 0);
    }
}

Please post a few results. Sorry for not asking this is the first place.

Mathematica 9 - 301 249 bytes
:D It feels cheaty to use the built-in converting to Roman numerals, but hey.
l=Length;k=Characters;r@n_:=(w=Flatten[Position[k@"IVXLC",#]*2-1&/@k@IntegerString[n,"Roman"]];Show[Table[Graphics@{AbsoluteThickness@w[[i]],Circle[{0,0},(Join[{0},Accumulate[3+w]]+3)[[i]]+w[[i]]/2]},{i,Range@l@w}],ImageSize->{(Total@w+(l@w)*3)*2}])

(When I did this last night I didn't have much time, but I realized it could be golfed down way more. And I also took some hints from David Zhang... :D Thanks!)
A bit more clearly:
l=Length;
k=Characters;
r@n_:=
    (
    w=Flatten[Position[k@"IVXLC",#]*2-1&/@k@IntegerString[n,"Roman"]];
    Show[Table[Graphics@{AbsoluteThickness@w[[i]],Circle[{0,0},(Join[{0},Accumulate[3+w]]+3)[[i]]+w[[i]]/2]},{i,Range@l@w}],ImageSize->{(Total@w+(l@w)*3)*2}]
    )

This is a function that you can call like this:
r[144]

Or, you can show the results from values a to b with: Table[r[i],{i,a,b}]
Note: This only works for values up to 399.

Python 2, 322 296
The script reads the number to be converted from stdin, and outputs the image as SVG markup.
.. I use 'red' instead of 'black', because it saves 2 chars :)
Here are some samples :
for 23 : http://jsfiddle.net/39xmpq49/
for 42 : http://jsfiddle.net/7Ls24q9e/1/
i=input();r=9
def R(n,p):
 global r,i;i-=n;print '<circle r="{0}" stroke-width="{1}"/>'.format(r,p);r+=p+3
print '<svg viewBox="-50 -50 99 99" fill="none" stroke="red">',[[R(n,int(p)) for p in s*int(i/n)] for n,s in zip([100,90,50,40,10,9,5,4,1],'9/59/7/57/5/15/3/13/1'.split('/'))]and'','</svg>'

JavaScript 342 334 308

function R(n){var v=document,o=[],x=1,c=v.body.appendChild(v.createElement('canvas')).getContext('2d')
while(n)v=n%10,y=x+2,o=[[],[x],[x,x],[x,x,x],[x,y],[y],[y,x],[y,x,x],[y,x,x,x],[x,x+=4]][v].concat(o),n=(n-v)/10
v=3
while(x=o.shift())c.lineWidth=x,c.beginPath(),c.arc(150,75,v+x/2,0,7),c.stroke(),v+=x+3}

for (var i = 1; i <= 100; i++) {
  R(i);
}