Index: source/texk/web2c/luatexdir/tex/commands.w
===================================================================
--- source/texk/web2c/luatexdir/tex/commands.w	(revision 4242)
+++ source/texk/web2c/luatexdir/tex/commands.w	(working copy)
@@ -675,6 +675,7 @@
     primitive_tex("mathchardef", shorthand_def_cmd, math_char_def_code, 0);
     primitive_omega("omathchardef", shorthand_def_cmd, omath_char_def_code, 0);
     primitive_luatex("Umathchardef", shorthand_def_cmd, xmath_char_def_code, 0);
+    primitive_luatex("Umathcharnumdef", shorthand_def_cmd, xmath_char_num_def_code, 0);
     primitive_tex("countdef", shorthand_def_cmd, count_def_code, 0);
     primitive_luatex("attributedef", shorthand_def_cmd, attribute_def_code, 0);
     primitive_tex("dimendef", shorthand_def_cmd, dimen_def_code, 0);
Index: source/texk/web2c/luatexdir/tex/maincontrol.h
===================================================================
--- source/texk/web2c/luatexdir/tex/maincontrol.h	(revision 4242)
+++ source/texk/web2c/luatexdir/tex/maincontrol.h	(working copy)
@@ -112,6 +112,7 @@
 #  define skip_def_code 7       /* |shorthand_def| for \.{\\skipdef} */
 #  define mu_skip_def_code 8    /* |shorthand_def| for \.{\\muskipdef} */
 #  define toks_def_code 9       /* |shorthand_def| for \.{\\toksdef} */
+#  define xmath_char_num_def_code 10 /* |shorthand_def| for \.{\\Umathcharnumdef} */
 
 extern void adjust_space_factor(void);
 extern void main_control(void);
Index: source/texk/web2c/luatexdir/tex/maincontrol.w
===================================================================
--- source/texk/web2c/luatexdir/tex/maincontrol.w	(revision 4242)
+++ source/texk/web2c/luatexdir/tex/maincontrol.w	(working copy)
@@ -2269,6 +2269,13 @@
                 mval.character_value;
             define(p, xmath_given_cmd, cur_val);
             break;
+        case xmath_char_num_def_code:
+            mval = scan_mathchar(xetexnum_mathcode);
+            cur_val =
+                (mval.class_value + (8 * mval.family_value)) * (65536 * 32) +
+                mval.character_value;
+            define(p, xmath_given_cmd, cur_val);
+            break;
         default:
             scan_register_num();
             switch (n) {
