g | x | w | all
Bytes Lang Time Link
103Rust240919T172709Zbzr
023Uiua240921T012016ZAdelie
015Japt P201023T200305ZShaggy
037bash + coreutils231121T192450ZSomeone
100JavaScript201024T192110Zbzr
101Lexurgy220121T063731Zbigyihsu
010Vyxal210221T013116Zlyxal
029Zsh210221T133913Zpxeger
nanPowerShell210221T051750ZWasif
105Befunge93201106T094431ZDarkAndr
029Raku201101T174328ZSean
056R201024T063153ZRobin Ry
033x86 machine code MSDOS .COM format201024T232714ZErikF
040Scala201025T060217ZTomer Sh
028GolfScript201023T213031Z2014MELO
024CJam201027T101801ZJosiahRy
041Pyth201027T063218ZPkmnQ
018Charcoal201023T200909ZNeil
054JavaScript ES6201024T113857ZArnauld
039APL+WIN201024T112151ZGraham
027Perl 5201024T112032ZKjetil S
037Ruby nl201024T103045ZKirill L
01305AB1E201023T203328Zovs
043Haskell201024T085857Zxnor
060C gcc201023T224036ZNoodle9
017Husk201024T043555ZRazetime
049C gcc201024T020909ZErikF
048Haskell201024T014905Zlynn
051Python 3201023T201348Zhyper-ne
026Retina 0.8.2201023T195933ZNeil
015Jelly201023T200212Zcaird co

Rust, 111 103 bytes

-8 bytes thanks to ceilingcat

let f=|s:&str|{for c in s.chars(){let e=c.to_digit(10).unwrap()as usize;dbg!(&"nubtqphsoe"[e..e+1]);}};

Attempt This Online!

Uiua, 23 bytes

⊂⊙(↘1)⌵⊢.⊏:"nubtqphsoe"

Function that takes in an array of digits and maps each digit to a letter. Try it online!

Explanation

⊂⊙(↘1)⌵⊢.⊏:"nubtqphsoe" # main function
           "nubtqphsoe" # string literal
          :             # flip top 2 stack values
         ⊏              # pick multiple characters from the string using the input array's elements as indexes,
                        # which creates another string
        .               # duplicate said string
       ⊢                # take the first character of the string
      ⌵                 # convert character to uppercase
 ⊙(  )                  # temporarily pop this character from the stack, then:
   ↘1                   # drop the first character from the string
                        # after this, the character is pushed back to the stack
⊂                       # join the character and string together

Japt -P, 17 16 15 bytes

ì`eo¢pqt¿n`Ô vu

Try it

ì`...`Ô vu     :Implicit input of integer
ì              :Convert to digit array in custom base
 `...`         :  Compressed string "eoshpqtbun"
      Ô        :  Reverse
        v      :Modify first element
         u     :  Uppercase
               :Implicitly join and output

bash + coreutils, 40 37 bytes

c=`tr 0-9 nubtqphsoe<<<$1`
echo ${c^}

JavaScript, 264 157 150 100 bytes

-107 bytes by replacing if statements with a JavaScript object to match each number with a corresponding string.

-7 bytes by using ES6 for loop through a string, and shorter arrow functions.

-50 bytes by replacing JavaScript Object with ES6 string indexing.

a='';o='nubtqphsoe';x=c=>a+=o[c];for(let e of prompt())x(e);alert(a[0].toUpperCase()+a.substring(1))

Lexurgy, 101 bytes

Map a digit to its respective letter.

Class D {\0,\1,\2,\3,\4,\5,\6,\7,\8,\9}
a:
@D=>{N,U,B,T,Q,P,H,S,O,E}/$ _
@D=>{n,u,b,t,q,p,h,s,o,e}

Vyxal, 11 10 bytes

«/
∨+Ċ≤«βǐ

Try it Online!

I finally turned my suggested 13 byte 05AB1E answer into a Vyxal answer.

Explained

«...«βǐ
«...«    # the string "nubtqphsoe"
     β   # convert the input to bijective-base 10 using the above string as the alphabet
      ǐ  # titlecase that result

Zsh, 29 bytes

<<<${(C)$(tr 0-9 nubtqphsoe)}

Try it online!

PowerShell, 142 100 94 bytes

$k=[string]$args;0..9|%{$k=$k.replace([string]$_,'nubtqphsoe'[$_])};get-culture|% t*o|% *se $k

Try it online!

Befunge-93, 105 bytes

Terrible implementation, it works at least, input is each digit of the number then any other character to terminate. Feel free to suggest any optimisations.

~::68*`vnubtqphsoe
 v+4*96_@
 `
@_68*8--0 v
   v        <
v:~<,-*84g<
>:68*` v
 v+4*96_@
 `
@_68*8--0 g,^

Try it online!

Raku, 29 bytes

*.trans(^10=>'nubtqphsoe').tc

Try it online!

R, 80 72 56 bytes

-8 bytes thanks to Kirill L.

-16 bytes thanks to Giuseppe.

sub("(.)","\\U\\1",chartr("0-9","nubtqphsoe",scan()),,T)

Try it online!

First we translate the digits to the relevant letters thanks to chartr, then sub switches the first letter to upper case. This last part is possible thanks to the option perl = T, a nice trick found by Giuseppe.

Also, note that all the functions are vectorized the way we need them to be, so we can handle several inputs at a time, which is rather unusual in R golf with scan().

x86 machine code (MS-DOS .COM format), 35 33 bytes

The program will terminate at the end of input from the command line.

For fun, I decided to use XLAT to index each digit's representation as the translation array easily fits into an 8-bit index and everything is 1:1.

Byte representation:

0000    B4 20 BB 19 01 BE 82 00 AC 2C 0D 74 09 D7 32 C4
0010    CD 29 32 E4 EB F0 C3 6E 75 62 74 71 70 68 73 6F
0020    65

Assembly code (TASM):

IDEAL

MODEL TINY
CODESEG
ORG 100H

SYMS_M EQU OFFSET SYMS-23H

MAIN:
    MOV AH,20H
    MOV BX,SYMS_M
    MOV SI,82H
VAL:
    LODSB
    SUB AL,0DH
    JZ  QUIT
    XLATB
    XOR AL,AH
    INT 29H
    XOR AH,AH
    JMP VAL
QUIT:
    RET

SYMS DB "nubtqphsoe"

END MAIN
ENDS

Scala, 47 40 bytes

_+""map(d=>"nubtqphsoe"(d-48))capitalize

Try it online!

GolfScript, 31 29 28 bytes

~{"nubtqphsoe"1/=}%()[32-]|\

Try it online!

Input as a digit array.

~                             # Parse the input to an array         [6 8 5 9]
 {               }%           # For each digit
  "nubtqphsoe"1/              # Split each letter of this string    6 ["n" "u" ... "e"]
                =             # Get the corresponding letter        "h"
                   (          # Get the first letter                ["o" "p" "e"] "h"
                    )         # Get the ascii value                 ["o" "p" "e"] "" 104
                      32-     # Subtract 32                         ["o" "p" "e"] "" 72
                     [   ]    # Put it in an array                  ["o" "p" "e"] "" [72]
                          |   # Convert to ascii                    ["o" "p" "e"] "H"
                           \  # Swap the two elements in the stack  "H" ["o" "p" "e"]
                              # Only the strings are outputted      "Hope"

CJam, 24 bytes

q~{"nubtqphsoe"1/=}%(eu\

Try it online!

Input in the form of a digit array string.

Pyth, 41 bytes

V.T,.T]."buÞ“;UØ".T]."09I–Ò"=:zeNhN;rz3

Try it online!

Explanation

The main part of the program is .T,.T]."buÞ“;UØ".T]."09I–Ò", which returns the list [['u', '1'], ['b', '2'], ['t', '3'], ..., ['n', '0']]. ."buÞ“;UØ" is the packed string ubtqphsoen, and ."09I–Ò" is the packed string 1234567890. .T] splits them into characters, and .T, zips them together.

Pyth, 24 bytes

Vz=+k@."bu\nL‘"vN;rk3

Try it online!

This one is a port of HyperNeutrino's Python 3 answer.

Charcoal, 20 18 bytes

⭆⍘Nnubtqphsoe⎇κι↥ι

Try it online! Link is to verbose version of code. Edit: Saved 2 bytes thanks to @Lyxal's comment on @ovs's answer. Explanation:

  N                 Input number
 ⍘                  Custom base conversion using
   nubtqphsoe       Literal string
⭆                   Map over characters
              κ     Current index
             ⎇      If not first character then
               ι    Current character
                ↥ι  Else uppercased character
                    Implicitly print

JavaScript (ES6), 54 bytes

Expects an array of digits.

a=>a.map((c,i)=>"nNuUbBtTqQpPhHsSoOeE"[c*2+!i]).join``

Try it online!

APL+WIN, 39 bytes

Prompts for a character vector of digits with index origin = 0

⎕av[(↑n),32+1↓n←⎕av⍳'NUBTQPHSOE'[⍎¨⍕⎕]]

Explanation:

[⍎¨⍕⎕]] Convert input to individual digits

⎕av⍳'NUBTQPHSOE' Find index positions of all upper case characters in atomic vector
and use result above to select those according to input

(↑n),32+1↓n Concatenate first index to remaining indices + 32 to apply appropriate case

⎕av[...] Use the above indices to select required characters from atomic vector

Perl 5, 27 bytes

y/0-9/nubtqphsoe/;$_="\u$_"

Try it online!

Ruby -nl, 37 bytes

p$_.tr("0-9","nubtqphsoe").capitalize

Try it online!

05AB1E, 13 bytes

Input is a list of digits.

.•*Š"—Êo•sèJ™

Try it online! or Try all cases!

Commented:

.•*Š"—Êo•      # compressed alphabet string "nubtqphsoe"
         s     # swap to implicit input
          è    # index each digit into the string
           J   # join into a single string
            ™  # apply title case

See the step-by-step output here.


Lyxal has suggested another 13-byter with a nicer input format:

.•*Š"—Êo•ÅвJ™

Try it online!

This uses Åв, which converts the input integer into the custom base defined by the string.

Haskell, 43 bytes

f(h:t)="NUBTQPHSOE"!!h:map("nubtqphsoe"!!)t

Try it online!

Input is a list of digits. Yes, the code really just writes out the string once in uppercase and a second time in lowercase. This kludge seems shorter than other things I tried. Haskell without imports doesn't have built-ins to capitalize and is really clumsy in working with characters.

43 bytes

zipWith(!!)$"NUBTQPHSOE":repeat"nubtqphsoe"

Try it online!

Taking Lynn's solution and making it more boring. We can also write:

43 bytes

zipWith(!!)$"NUBTQPHSOE":l
l="nubtqphsoe":l

Try it online!

47 bytes

(%0)
(h:t)%i=["NUBTQPHSOE"!!h..]!!i:t%32
_%_=""

Try it online!

Based off Lynn's solution. Handles the capitalization by passing in an offset i of 0 initially, then updating it to 32 in each recursive function call.

It doesn't seem like Haskell has a nice function to title-case a string even with imports, which are probably too lengthy anyway to be competitive. The below with Data.Text doesn't work because it operates on Text not [Char]. Data.Char only has toUpper to capitalize a single character.

44 bytes (non-working)

import Data.Text
toTitle.map("NUBTQPHSOE"!!)

Try it online!

C (gcc), 63 60 bytes

Saved 3 bytes thanks to AZTECCO!!!

f(a,l)int*a;{l--&&f(a,l)+putchar("nubtqphsoe"[a[l]]-!l*32);}

Try it online!

Inputs a pointer to an array of digits and its length (since there's no way to know how long an array passed into a function as a pointer is in C) and prints the corresponding systematic chemical symbol.

Husk, 20 17 bytes

§:oa←tm!¨Ḃ+q²"ṗen

Try it online!

input as a list of digits.

There's probably a better way to do the titlecasing part.

-3 bytes from Dominic van Essen.

Explanation (old)

§:oa←tmo!¨nḂ+q²"ṗe¨→
                   → increment input to accomodate 0-indexing
      mo             map each digit to
        !¨nḂ+q²"ṗe¨  it's index value in the compressed string
§:                   join the
  oa←                first letter uppercased
     t               with it's tail

C (gcc), 51 49 bytes

Apparently I can get rid of the customary "assign to first parameter" because I only care about a false/non-false answer from this function. Interesting to know!

f(n){n&&putchar("nubtqphsoe"[n%10]^32*!f(n/10));}

Try it online!

Haskell, 48 bytes

zipWith(\i d->["NUBTQPHSOE"!!d..]!!i)$0:k
k=32:k

Try it online!

Python 3, 51 bytes

lambda a:"".join("nubtqphsoe"[x]for x in a).title()

Try it online!


Proton, 42 bytes

a=>"".join("nubtqphsoe"[x]for x:a).title()

Try it online!

Retina 0.8.2, 26 bytes

T`d`nubtq\p\hs\oe
T`l`L`^.

Try it online! Link includes test cases. Explanation:

T`d`nubtq\p\hs\oe

Translate each digit to the appropriate letter. The letters h, o and p have special meaning, so they need to be quoted.

T`l`L`^.

Translate the first letter to upper case.

Jelly, 15 bytes

ị“ubtqphsoen”Œt

Try it online!

Inputs as a list of digits, which the Footer does for you.

As it appears the string can't be compressed, this is likely to be the shortest approach in Jelly

How it works

ị“ubtqphsoen”Œt - Main link. Takes a list l on the left
 “ubtqphsoen”   - Yield the string “ubtqphsoen”
ị               - For each digit in l, index into the string (1-indexing)
             Œt - Title case (capitalise the first character)