11institutetext:  Dip. Ingegneria dell’Informazione, University of Pisa, Italy
22institutetext: School of Computer Science, University College Dublin,
Ireland

# A Transformer Architecture for Online Gesture Recognition of Mathematical
Expressions

Mirco Ramo 1122 Guénolé C.M. Silvestre 22

###### Abstract

The Transformer architecture is shown to provide a powerful framework as an
end-to-end model for building expression trees from online handwritten
gestures corresponding to glyph strokes. In particular, the attention
mechanism was successfully used to encode, learn and enforce the underlying
syntax of expressions creating latent representations that are correctly
decoded to the exact mathematical expression tree, providing robustness to
ablated inputs and unseen glyphs. For the first time, the encoder is fed with
spatio-temporal data tokens potentially forming an infinitely large
vocabulary, which finds applications beyond that of online gesture
recognition. A new supervised dataset of online handwriting gestures is
provided for training models on generic handwriting recognition tasks and a
new metric is proposed for the evaluation of the syntactic correctness of the
output expression trees. A small Transformer model suitable for edge inference
was successfully trained to an average normalised Levenshtein accuracy of 94%,
resulting in valid postfix RPN tree representation for 94% of predictions.

###### Keywords:

Online Gesture Recognition Transformer Multilevel Segmentation Expression Tree
Transfer Learning RPN

##  1 Introduction

Modern edge communicating devices are built around touch-sensitive display
panels equipped with handwriting recognition systems. These systems are of
great assistance eschewing the need for structured UIs such as virtual
keyboards that are often slow and error-prone while also distant to the
natural handwriting experience with pens.

In this context, online recognition of glyphs (as opposed to offline that
takes a graphical image representation as input) refers to the problem of
mapping spatio-temporal samplings of user gestures corresponding to
handwritten text into a symbolic representation. Each 3-dimensional sample
individuates a touch. A coherent and consecutive sequence of touches defines a
stroke that can be combined to form glyphs. Glyphs correspond to characters or
symbols encoded in a language vocabulary. In this work, we will consider the
online input of mathematical arithmetic expressions as a formally correct
sequence of gestures of numerals, operators and symbols. Note that some
numerals and operators may require more than one stroke to be represented as
depicted in Fig. 1. Table 1 formalizes the terminology adopted in this work.

Table 1: Terminology Term | Definition
---|---
touch/point |  $(x,y,[t])$ tuple of finger location on touch panel sampled at time $t$
stroke | Sequence of points where finger consecutively touches the panel
glyph |  List of one or more strokes individuating an element in the vocabulary
numeral/ operand |  Ordered list of glyphs corresponding to digits $\\{0,\ldots,9\\}$ and comprising at most one decimal notation mark $\\{.\\}$ – note: a numeral always evaluates in a finite rational numeric value
symbol |  One of the 4 operators $\\{+,-,\times,\div\\}\cup\\{=,(,)\\}$

Gesture recognition applications must solve several problems at once, namely:
i) feature extraction in a multi-dimensional spatio-temporal space, ii)
segmentation of stroke sequences into glyph items, iii) glyph segmentation
with the aim of numeral recognition, and iv) the encoding of expression rules
and patterns to form a correct symbolic output. An example of an online
gesture sequence is shown in Fig. 1.

With mathematical expressions, users often wish to go beyond the mere
recognition of glyphs and hope for additional tasks to be performed such as
automatic evaluation, step-by-step simplification or listing of equivalent
forms. The Expression Tree (ExpTree) formalism [1] was introduced to represent
mathematical expressions as binary trees and consequently resolve all
equivalent forms to some unique representation, scheduling its evaluation by
transforming an input symbol list into a computation graph. In particular, a
post-ordered traverse of tree generates the Reverse Polish Notation (RPN)
using postfix notation, a unique representation that postpones operators,
crushing the need for brackets.

####  1.0.1 Main Contributions

  1. (i)

We propose a new dataset for handwritten expressions (cf. Section 3) obtained
from several hundred users and suitable for a wide range of supervised and
unsupervised machine learning applications.

  2. (ii)

We study the ability of an attention mechanism to learn and represent implicit
structures of spatio-temporal gesture data, even when the underlying syntax is
not enforced (in the loss computation or model architecture).

  3. (iii)

We prove the power of Transformers not only as language models but also as a
solution to several sequence mapping tasks, demonstrating transfer learning
behaviours of the encoder on unseen glyphs from online gesture input111Encoder
with frozen parameters (pre-trained on digit-agnostic datasets) subsequently
used on a new task, taking token input from spatio-temporal sequences in a
potentially infinitely large vocabulary..

  4. (iv)

We propose a small footprint222Despite its small footprint, model can perform
the tasks of glyph segmentation, numeral segmentation, character recognition
and tree building at remarkable performance levels, learning efficiently the
input/output mapping. topology for end-to-end online mathematical expression
recognition and ExpTree generation, with fast optimisation, very high accuracy
and suitable for edge inference.

  5. (v)

We test the model robustness on ablated input, showing its ability to generate
compliant RPN expressions even in case of missing strokes.

  6. (vi)

We show the multi-level segmentation capability of the attention mechanism,
highlighting the correlation between syntactically correct predictions and
explainability in cross-attention visualisation.

Figure 1: Online gesture example of a stroke sequence (a) for the mathematical
expression (b) and its corresponding RPN expression tree (c). Each cell in (a)
depicts the linear interpolation of spatio-temporal points that forms an input
token. Green and red cells denote the
$\stretchto[1200]{\langle}{10pt}$bos$\stretchto[1200]{\rangle}{10pt}$ and
$\stretchto[1200]{\langle}{10pt}$eos$\stretchto[1200]{\rangle}{10pt}$
respectively. Glyph segmentation, numeral segmentation and RPN ExpTree parsing
are colour coded with blue, green and red respectively.

##  2 Related Work

The field of Handwriting Text Recognition (HTR) consists on a set of
techniques and algorithms that aim at generating text directly from
handwritten inputs. Most HTR systems [2] work on offline data due to dataset
availability [3]. With the current popularity of the attention mechanism [4,
5], the field remains in constant development. However, as noted in [6], the
temporal dimension provides some valuable additional information that may
simplify stroke segmentation and avoid recourse to complicated regression
strategies such as text-line segmentation [7]. As a result, online methods may
expect superior performance over offline counterparts as reported in a 2014
extensive survey of online HTR methods [6]. Further progress has since been
observed, with much effort and resources employed on improving existing
techniques [8, 9].

In this context, Handwriting Digit Recognition (HDR) remains a popular HTR
sub-problem still actively researched using both offline [10] and online
methods [11]. In particular Handwritten Mathematical Expression Recognition
(HMER) consists in the generation of mathematical expressions using formal
syntaxes such as LaTeX. State-of-the-art HMER models have reached impressive
levels of accuracy, particularly when exploiting attention [12] and combining
potentialities of online and offline data [13]. However, although predictions
are mostly correct, these models fail to learn the intrinsic structure of the
mathematical expression. In contrast, learning a tree representation provides
a more natural form [14] and can be achieved with an RNN encoder and a HMER
tree decoder to explicitly represent the tree formalism.

We propose to push this challenge further, leaving the task of learning
implicitly the RPN syntax to the model, and doing this by relying on the
attention mechanism embedded in a Transformer framework [15]. This provides a
powerful sequence mapping architecture entirely based on the attention
mechanism [4], eschewing recourse to recurrent or convolution layers, hence
allowing for significant parallelisation and unattenuated gradient flow. This
topology currently stands as the state-of-the-art on almost all NLP tasks [16,
17, 18], but also on a wider and more generic group of sequence transduction
problems [19, 20, 21, 22, 23]. The Transformer popularity saw many experiments
revisiting its design with several optimized architectures being proposed [24,
25, 26, 27]. However very few are capable of clearly outperforming the
original topology. As a result this work will follow the seminal Transformer
proposal of [15].

##  3 Dataset

An important contribution of this work is that of an online gesture dataset of
mathematical expressions suitable for investigating several tasks such as
Handwriting Character Recognition (HCR), HDR or HMER, but also touch, stroke
or glyph segmentation, automatic result computation, unsupervised generation
or eventually, ExpTree building. Our handwritten database is presented as a
coherent collection of tables composing a SQL Schema with spatio-temporal data
for arabic numerals [11] and mathematical symbols, collected from volunteers
writing on touch panels. This stage saw the contribution of 455 subjects for a
total of 21 752 labelled glyphs composed by 27 477 strokes, thus over 700
thousand touches. The dataset can be used at different levels of granularity,
namely touch, stroke and glyph.

Subjects have been split into training, validation and test sets (60/20/20
proportions) such that models were tested on unseen handwriting styles to
ensure accurate estimation of the generalisation power. In addition, strokes
were also randomly augmented and composed to form expressions.

An expression ($E$) is defined as a bounded sequence of numerals ($N$) and
operators ($\odot\in\\{+,-,\times,\div\\}$). The generation of expressions is
carried out according to the following grammar:

  1. 1.

an expression can be a numeral: $E\rightarrow N$

  2. 2.

an expression can be a binary operation: $E\rightarrow E\odot E$

  3. 3.

an expression can be a binary operation between brackets: $E\rightarrow(E\odot
E)$

As a supplementary rule, every expression must end with the ’=’ symbol. For
each expression, we provide 3 ground truth labels (namely ASCII text, RPN tree
and numerical evaluation), for a total of 240 000 samples split as specified
above. In this work, we report results at the stroke level, leaving to the
model the burden of glyph segmentation.

##  4 Transformer Architecture & Experimental Details

Our model leverages the original Transformer architecture [15]. However
crucial modifications are introduced to work with spatio-temporal data. Given
some input sequence, $X\in\bbbr^{d_{\mathrm{f}}\times n}$, of $n$ stroke
tokens defined as interleaved spatio-temporal data with zero-padding of fixed-
length $d_{\mathrm{f}}$ (maximum of 64 $(x,y)$ touch samples per stroke,
appropriately
$\stretchto[1200]{\langle}{10pt}$bos$\stretchto[1200]{\rangle}{10pt}$
prefixed,
$\stretchto[1200]{\langle}{10pt}$eos$\stretchto[1200]{\rangle}{10pt}$ suffixed
and $\stretchto[1200]{\langle}{10pt}$pad$\stretchto[1200]{\rangle}{10pt}$
padded), a mask $M_{x}$ is computed to ensure encoder’s attention is only paid
on valid online data tokens.

As the input is composed of spatio-temporal information corresponding to
touches, each encoder token embeds a stroke as $d_{\mathrm{f}}$ scalars (cf.
Fig. 1) resulting in the identification within a potentially unbounded input
vocabulary and therefore eschewing any form of embedding.

Positional encoding provides a strategy to embed the positional information of
input tokens in the encoder, a necessary operation since the attention
mechanism has no built-in concept of sequentiality. Frequency modulation is
proposed in [15]. However, since we observed no performance gain with such a
strategy, we use a learnable 1D embedding based on the incremental index of
the token. Stroke positions are encoded in
$P_{x}\in\bbbr^{d_{\mathrm{f}}\times n}$.

The encoder is trained to learn some latent sequence representation
$Z=\operatorname{Enc}(X+\alpha P_{x},M_{x})\in\bbbr^{d_{\mathrm{a}}\times
d_{\mathrm{h}}\times n}$ where $\alpha$ is a scaling factor blending the input
data and positional information, $d_{\mathrm{a}}$ the number of attention
heads and $d_{\mathrm{h}}$ the hidden state dimension of the attention heads.
The encoder consists of a stack of $l_{e}$ identical multi-head vanilla self-
attention layers and a positional feed-forward network of dimension
$d_{\mathrm{p}}$. Each layer is followed by a residual connection before
layer-normalisation.

In this work, we explored the transfer learning capabilities of the encoder
that was never trained from scratch but relied on an optimised snapshot, pre-
trained in conjunction with a language modelling decoder using a large corpus
of English sentences [28] that contained almost no digits and arithmetic
operators (classified as
$\stretchto[1200]{\langle}{10pt}$unk$\stretchto[1200]{\rangle}{10pt}$ tokens).
This transfer learning strategy resulted in considerable speed-up during
training and model optimisation. We use a frozen encoder with
$\mathrm{\Theta}_{\mathrm{e}}$ parameters as a feature extractor on this new
domain. The decoder generates a causal sequence of tokens in an auto-
regressive manner given some vocabulary and relative token encoding. It is
initialised with the
$\stretchto[1200]{\langle}{10pt}$bos$\stretchto[1200]{\rangle}{10pt}$ token
and iteratively outputs a new token using greedy sampling of the decoder’s
softmax output until the
$\stretchto[1200]{\langle}{10pt}$eos$\stretchto[1200]{\rangle}{10pt}$ token is
predicted or the maximum sequence length, $m$, is reached. The decoder also
consists of $l_{d}$ identical layers, each composed by: i) a masked self-
attention layer that prevents the decoder from peeking at the subsequent
tokens, ii) a cross-attention layer that attends over the encoder output $Z$
to generate predictions, and iii) a feed-forward layer as in the encoder but
of dimension $3d_{\mathrm{p}}$.

At each step, the decoder’s input is an auto-regressive sequence of tokens
mapped into an embedding layer with positional encoding, and used to predict
the next token of the output sequence. All $\mathrm{\Theta}_{\mathrm{d}}$
parameters of the decoder were trained from some randomly initialised state.

Experimental details: models were all configured with
$d_{\mathrm{f}}\\!=\\!d_{\mathrm{a}}\times
d_{\mathrm{h}}\\!=\\!d_{\mathrm{p}}\\!=\\!128$. For v$\,{}_{\\!1-5}$,
$n\\!=\\!2\,m\\!=\\!24$. For v$\,{}_{\\!10-11}$, $n\\!=\\!2\,m\\!=\\!48$. The
encoder has $\mathrm{\Theta}_{\mathrm{e}}=523\,520$ parameters and decoder has
$\mathrm{\Theta}_{\mathrm{d}}=934\,136$ parameters. Models were trained on
Nvidia TitanX GPUs333Nvidia is acknowledged for the donation of GPUs, for a
maximum of 200 epochs, using cross-entropy loss and Adam optimiser with a
decay schedule (initial learning rate of $8\times 10^{-4}$ and halving every
30 epochs).

##  5 Experimental Results

A series of experiments were carried out to investigate two different
problems, namely: (1) expression recognition in glyph sequences and (2)
ExpTree recognition in RPN forms. The first task involves the recognition of a
sequence of glyphs composing an arithmetic expression from stroke input as
time series. The second task requires further understanding of symbolic syntax
and semantics through the construction of an ExpTree using postfix notation.

Models are evaluated using a number of performance metrics on the test sets
and results are reported in terms of: (a) Cross-Entropy Loss (XEL), (b)
normalised Levenshtein distance [29] Accuracy (LA), (c) Character Error Rate
(CER), and where applicable (d) RPN Accuracy Range (cf. Section 5.2). The LA
and CER are both accuracy metrics based on edit distance.

###  5.1 Expression Recognition

In this set of experiments, models v$\,{}_{\\!1-3}$ are trained to output
glyph sequence of simple arithmetic expressions in the absence of brackets
while model v$\,{}_{\\!4}$ adds groups of terms with brackets. Table 2
summarises training datasets, model hyper-parameter configuration and
performance evaluation in this experiment.

Table 2: Expression recognition, model hyper-parameters and dataset configuration. Performance is reported in term of Cross-Entropy Loss (XEL) and normalised Levenshtein distance Accuracy (LA). Model v$\,{}_{\\!4}$ trained on larger expressions using 4 Heads (H) in a 4 Layer (L) decoder performs best. Model | Data size | Bracket | Enc∗ ($l_{\mathrm{e}},d_{\mathrm{a}}$) | Dec ($l_{\mathrm{d}},d_{\mathrm{a}}$) | XEL | LA (%)
---|---|---|---|---|---|---
v$\,{}_{\\!1}$ | 10k | No | 5L, 4H | 2L, 4H | 0.76 | 71.3
v$\,{}_{\\!2}$ | 240k | No | 5L, 4H | 4L, 4H | 0.43 | 84.8
v$\,{}_{\\!3}$ | 240k | No | 5L, 4H | 4L, 2H | 0.43 | 84.8
v$\,{}_{\\!4}$ | 240k | Yes | 5L, 4H | 4L ,4H | 0.40 | 84.9
∗ Encoder: using transfer learning with frozen (untrained) parameters

We observe that there are no clear benefits in increasing the number of
decoder heads in the absence of brackets (models v$\,{}_{\\!2-3}$). However,
despite an increase of vocabulary size and, in principle, also some decoding
complexity, the addition of brackets resulted in better performance as seen in
model v$\,{}_{\\!4}$. This model is capable of learning some non-trivial
valuable syntax rules such as number of ’(’ should match that of ’)’, or an
operator can never precede a ’)’.

###  5.2 Expression Tree Recognition

The ExpTree recognition task requires of an additional step to glyph
recognition with the construction of an RPN form. In this set of experiments,
model performance is also evaluated in terms of CER and RPN Accuracy Range
(RAR) defined as the range
$[1-V_{\ell}^{\textsf{max}},1-V_{\ell}^{\textsf{min}}]$, where $V_{\ell}$
stands for violation loss. If $v_{i}$ denotes the count of violations in the
i-th expression,
$V_{\ell}^{\textsf{min}}=\frac{1}{N}\sum_{i=1}^{N}\mathbbm{1}_{v_{i}>0}$ and
$V_{\ell}^{\textsf{max}}=\frac{1}{N}\sum_{i=1}^{N}v_{i}$, where $N$ is the
test set cardinality. Referring to the standard infix to postfix conversion
algorithm in [1], a violation occurs every time the stack is in an
inconsistent state while conversion is performed.

This does not required the initialisation of stack operations to be
determined. Instead one can linearly scan the output using a counter,
incrementing its value for a push, decrementing it for a pop. Counter value
should be 1 at the end and never become negative. Adding the number of times a
negative value is observed to the absolute value of the final counter minus 1
defines the number of violations.

Table 3 summarises experimental results on ExpTree predictions. Models
v$\,{}_{\\!5,\,10-11}$ were trained on the same dataset size as
v$\,{}_{\\!2-4}$ (240k expressions), with the possible inclusion of brackets.
The v$\,{}_{\\!5}$ model training dataset further constrained numerals to
contain at most one decimal digit. This restriction was lifted in training
sets associated with models v$\,{}_{\\!10-11}$. As a result, an end-of-numeral
token, $\stretchto[1200]{\langle}{10pt}$eon$\stretchto[1200]{\rangle}{10pt}$,
was added to the decoder’s output vocabulary for learning an additional
numeral segmentation task of RPN forms.

Table 3: ExpTree recognition for various model hyper-parameters. Performance is reported in term of Cross-Entropy Loss (XEL), normalised Levenshtein distance Accuracy (LA), Character Error Rate (CER), and RPN Accuracy Range (RAR). Models trained on 240k expression datasets. Fine-tuned model v$\,{}_{\\!11}$ with $\stretchto[1200]{\langle}{10pt}$eon$\stretchto[1200]{\rangle}{10pt}$ for numeral segmentation provides best performance. Name | Enc ($l_{\mathrm{e}},d_{\mathrm{a}}$) | Dec ($l_{\mathrm{d}},d_{\mathrm{a}}$) | XEL | LA(%) | CER | RAR (%)
---|---|---|---|---|---|---
v$\,{}_{\\!5}$ | 5L, 4H∗ | 4L, 4H‡ | 0.46 | 83.7 | 0.19 | $[91.8,91.8]$
v$\,{}_{\\!10}$ | 5L, 4H∗ | 4L, 4H‡ | 0.34 | 87.4 | 0.14 | $[92.4,93.2]$
v$\,{}_{\\!11}$ | 5L, 4H† | 4L, 4H† | 0.24 | 93.7 | 0.07 | $[{\bf 93.3},{\bf 94.0}]$
∗ Frozen parameters
† Fined-Tuned parameters using transfer learning
‡ Trained from scratch from some randomly initialised state

With the same hyper-parameter configuration of Table 2, an expected
degradation in performance is observed for model v$\,{}_{\\!5}$ on this more
complicated task. The addition of the
$\stretchto[1200]{\langle}{10pt}$eon$\stretchto[1200]{\rangle}{10pt}$ token in
model v$\,{}_{\\!10}$ showed some significant improvement in accuracy,
outperforming our best results for simple expression glyph recognition.
Despite the use of a larger vocabulary size for the decoder’s output, the
addition of a specific token to model explicitly the language semantic of
numerals is observed to yield higher accuracy once again. The new token forces
the network to learn a pattern resulting in better numeral segmentation and
improved performance.

In Section 4 we proposed to test the transfer learning capabilities of the
encoder, using frozen parameters on a new domain. Excellent results have been
observed, demonstrating the encoder’s ability to correctly segment and combine
strokes generating latent representations that are generic enough to be
valuable for any downstream tasks even when used with completely different
output vocabulary.

However, further improvement can be reached with fine-tuning of all parameters
as observed with model v$\,{}_{\\!11}$ that leveraged frozen encoder weights
of model v$\,{}_{\\!10}$, introducing the concepts of digits or operators for
the first time. Final model achieves 94% on the Normalised Levensthein
Accuracy, with a Character Error Rate lower than 7%, generating on average 94%
of strings compliant to the RPN, while mean number of violations per output
expression is only 0.067.

##  6 Attention Visualisation & Output Distributions

Visualisation of attention mechanisms provides some interesting insights in
the learning process. Fig. 2a depicts the cross-attention weights that the
decoder puts over the encoder’s output. It shows that head 1 of layer 1 is
responsible for numeral segmentation. For every
$\stretchto[1200]{\langle}{10pt}$eon$\stretchto[1200]{\rangle}{10pt}$ or
decimal mark tokens, this head has learned to attend over the stroke of the
previous digit. In Fig. 2b, head 4 of layer 3 attends over the
$\stretchto[1200]{\langle}{10pt}$eos$\stretchto[1200]{\rangle}{10pt}$ token
while predicting the ’=’ token demonstrating that the model has successfully
learned the syntax rule ‘every expression must end with ’=’ symbol’.

Figure 2: Cross-attention plots. In (a), output tokens ’.’ (decimal mark) and
$\stretchto[1200]{\langle}{10pt}$eon$\stretchto[1200]{\rangle}{10pt}$ (end-of-
numeral) can be seen tracking the previous digit; in (b), output token ’=’ is
attending token
$\stretchto[1200]{\langle}{10pt}$eos$\stretchto[1200]{\rangle}{10pt}$.

Fig. 3 shows the confusion matrix over the decoder’s vocabulary for the
average probability distribution of the output softmax. This provides some
insight into model mispredictions leading to errors. In Fig. 3a, model
v$\,{}_{\\!10}$ leveraged a frozen encoder pre-trained on a completely
different output vocabulary with no digits and operators. The model confuses
’2’ with ’3’ and, to a lesser extent, operator ’-’ with ’+’ since the latter
is often written with an horizontal stroke. Fig. 3b shows that fine-tuning the
encoder in model v$\,{}_{\\!11}$ results in better performance and improved
diagonality, which also justifies the greedy decoding strategy used in our
decoder.

Figure 3: Softmax distribution mean of the decoder’s output predictions
showing the probability mass for all token pairs. Frozen model v$\,{}_{\\!10}$
in plot (a) reveals decoding errors caused by confusion between digits 2 and
3, and also between operators. Model v$\,{}_{\\!11}$ in plot (b) shows that
fined-tuning on all glyphs reduces confusion dramatically.

##  7 Model Robustness

Model robustness is investigated by means of ablation studies; strokes are
removed from the input sequence to observe the model’s ability to enforce
domain rules even when it is fed with incorrect expressions.

Equal sign ablation: in our dataset, every expression to be considered
syntactically correct must end with ’=’. The learning of this rule is assessed
by observing the inference results of models v$\,{}_{\\!4,\,10-11}$ when
strokes representing the equal sign are omitted in the encoder’s input. All
three models are able to make the correct inference, inserting the missing ’=’
in decoder’s output as shown in rows 1–3 of Table 4.

Closing bracket ablation: in any correct plain expressions, the number of ’(’
should match that of ’)’. This syntactic rule is investigated in model
v$\,{}_{\\!4}$ that was trained to recognise glyphs of an expression (not
possible with models v$\,{}_{\\!10-11}$ as RPN forms eschew the use of
brackets). When the stroke of a closing bracket was removed from the encoder’s
input, the model acknowledges the input error and inserts the missing bracket
in the output as shown in row 4 of Table 4. Of course, the exact position is
not always guessed correctly, but the symbol is predicted so that to ensure
syntax correctness of the output.

Operator ablation is investigated on models v$\,{}_{\\!10-11}$, where an
operator’s strokes is removed from the input as shown in rows 5–6 of Table 4.
To ensure ExpTree correctness when using postfix notation, an output
expression must be terminated by an operator and its total number of operators
always be a unit lower than the cardinality of operands. Both models appear to
have learned this rule and are able to infer the presence of additional
operator at the end (actual operator can only be guessed).

Table 4: Model robustness: ablation experiments with input strokes elided from input and corresponding to the equal sign in rows 1–3, a closing bracket in row 4 and an operator in rows 5–6. Metric is the Levenshtein Distance (LD). Model |  Input ($X$), Ground truth ($Y$) & Model inference ($\hat{Y}$) | LD
---|---|---
v$\,{}_{\\!4}$ |  $\begin{aligned} X\\!\\!&=\raisebox{-3.99994pt}{\includegraphics[height=13.00005pt]{figs/v4_ablation_equal.pdf}}\\\ Y\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{4}\,\times\,\texttt{6}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\\\ \hat{Y}\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{4}\,\times\,\texttt{6}\,\texttt{{\color[rgb]{0,0.7,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0.7,0}=}}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\end{aligned}$ | 1
v$\,{}_{\\!10}$ |  $\begin{aligned} X\\!\\!&=\raisebox{-3.99994pt}{\includegraphics[height=13.00005pt]{figs/v10_ablation_equal.pdf}}\\\ Y\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{6.3}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{3}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{2}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{+}\,\texttt{-}\,\texttt{5}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{+}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\\\ \hat{Y}\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{6.{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2}}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{3}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{2}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{+}\,\texttt{-}\,\texttt{5}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{+}\,\texttt{{\color[rgb]{0,0.7,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0.7,0}=}}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\\\ \end{aligned}$ | 2
v$\,{}_{\\!11}$ |  $\begin{aligned} X\\!\\!&=\raisebox{-3.99994pt}{\includegraphics[height=13.00005pt]{figs/v11_ablation_equal.pdf}}\\\ Y\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{9}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{7}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{3}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\div\,\texttt{2}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{-}\,\texttt{+}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\\\ \hat{Y}\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{9}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{7}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{3}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\div\,\texttt{2}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{-}\,\texttt{+}\,\texttt{{\color[rgb]{0,0.7,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0.7,0}=}}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\\\ \end{aligned}$ | 1
v$\,{}_{\\!4}$ |  $\begin{aligned} X\\!\\!&=\raisebox{-3.99994pt}{\includegraphics[height=13.00005pt]{figs/v4_ablation_bracket.pdf}}\\\ Y\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{7}\,\texttt{.}\,\texttt{4}\,\times\,\texttt{(}\,\texttt{3}\,\texttt{.}\,\texttt{8}\,+\,\texttt{9}\,\texttt{=}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\\\ \hat{Y}\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{7}\,\texttt{.}\,\texttt{4}\,\times\,\texttt{(}\,\texttt{3}\,\texttt{.}\,\texttt{8}\,+\,\texttt{9}\,\texttt{{\color[rgb]{0,0.7,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0.7,0})}}\,\texttt{=}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\end{aligned}$ | 1
v$\,{}_{\\!10}$ |  $\begin{aligned} X\\!\\!&=\raisebox{-3.99994pt}{\includegraphics[height=13.00005pt]{figs/v10_ablation_operator.pdf}}\\\ Y\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{6.3}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{3}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{2}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{+}\,\texttt{-}\,\texttt{5}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{=}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\\\ \hat{Y}\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{6.{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}2}}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{3}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{2}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{+}\,\texttt{-}\,\texttt{5}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{{\color[rgb]{0,0.7,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0.7,0}+}}\,\texttt{=}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\end{aligned}$ | 2
v$\,{}_{\\!11}$ |  $\begin{aligned} X\\!\\!&=\raisebox{-3.99994pt}{\includegraphics[height=13.00005pt]{figs/v11_ablation_operator.pdf}}\\\ Y\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{9}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{3}\,\texttt{.}\,\texttt{5}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{-}\,\texttt{7}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{+}\,\texttt{5}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{=}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\\\ \hat{Y}\\!\\!&=\\!\left\\{\texttt{$\stretchto[1200]{\langle}{10pt}${{\small bos}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{9}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{3}\,\texttt{.}\,\texttt{5}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{-}\,\texttt{7}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{+}\,\texttt{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}1}}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eon}}$\stretchto[1200]{\rangle}{10pt}$}\,\texttt{{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}-}}\,\texttt{=}\,\texttt{$\stretchto[1200]{\langle}{10pt}${{\small eos}}$\stretchto[1200]{\rangle}{10pt}$}\right\\}\end{aligned}$ | 2

##  8 Conclusion

This work proposed a Transformer network for mathematical expression tree
building from online input gesture data corresponding to handwritten strokes
of digits and mathematical symbols. The encoder’s input was modified to
receive spatio-temporal data as real-valued tokens. It can directly operate at
stroke level without the need for mapping on a fixed input vocabulary. Model
can predict ExpTrees by handling internally the multi-level segmentation of
inputs (at glyph and numeral levels) and also understanding and learning how
to represent and enforce syntactic and semantic rules of data. In addition,
index positional encoding was shown to be as effective as cosine modulation
yet standing as a simpler and more natural encoding for the position
information. The Transformer’s ability to generate complex representations and
learn non-trivial input/output mapping between sequences is well known [16,
19]. However the challenge was further pushed in this work with no ad hoc
solutions to represent syntax or semantic rules and the absence of an
engineered loss computation and model architecture. In addition, the encoder
was trained on a completely different domain [28] and used as a frozen feature
extractor in most experiments. Such transfer learning capabilities suggest
that the encoder can create general latent representations suitable for
problems of different nature, reducing the overall number of model parameters.
The objective of this work is not so much to push out some state-of-the-art
model but rather to state some important considerations that may be the
starting points for future works in language modelling. Neural Machine
Translation may be extended in this way to online data at different
granularity levels, with no need for separate input segmentation or complex
positional embeddings. Finally, pre-trained encoders could be effectively
leveraged with transfer learning on different domains without fine-tuning or
explicit domain adaptation, accelerating training for new problem classes
where computational power/time or dataset size is limited.

## References

  * [1] Gries, D.: Compiler construction for digital computers. New York: Wiley (1971)
  * [2] Plamondon, R., Srihari, S.: Online and off-line handwriting recognition: a comprehensive survey. IEEE Transactions on Pattern Analysis and Machine Intelligence 22(1), 63–84 (2000)
  * [3] Sinwar, D., Dhaka, V.S., Pradhan, et al.: Offline script recognition from handwritten and printed multilingual documents: a survey. International Journal on Document Analysis and Recognition (IJDAR) 24(1), 97–121 (2021)
  * [4] Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. In: International Conference on Learning Representations (ICLR) (Jul 2015)
  * [5] Poulos, J., Valle, R.: Character-based handwritten text transcription with attention networks. Neural Computing and Applications 33(16), 10563–10573 (2021)
  * [6] Kim, J., Sin, B.K.: Handbook of Document Image Processing and Recognition, chap. Online Handwriting Recognition, pp. 887–915. Springer London (2014)
  * [7] Barakat, B., Droby, A., Kassis, M., El-Sana, J.: Text line segmentation for challenging handwritten document images using fully convolutional network. In: 2018 16th International Conference on Frontiers in Handwriting Recognition (ICFHR). pp. 374–379 (2018)
  * [8] Keysers, D., Deselaers, T., Rowley, et al.: Multi-language online handwriting recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence 39(6), 1180–1194 (2017)
  * [9] Graves, A.: Generating sequences with recurrent neural networks. arXiv (2013). https://doi.org/10.48550/arXiv.1308.0850
  * [10] Shrivastava, A., Jaggi, I., Gupta, et al.: Handwritten digit recognition using machine learning: A review. In: 2019 2nd International Conference on Power Energy, Environment and Intelligent Control (PEEIC). pp. 322–326 (2019)
  * [11] Corr, P.J., Silvestre, G.C., Bleakley, C.J.: Open source dataset and deep learning models for online digit gesture recognition on touchscreens. In: 2017 Irish Machine Vision and Image Processing Conference (IMVIP) (2017). https://doi.org/10.48550/arXiv.1709.06871
  * [12] Li, Z., Jin, L., Lai, et al.: Improving attention-based handwritten mathematical expression recognition with scale augmentation and drop attention. In: 2020 17th International Conference on Frontiers in Handwriting Recognition (ICFHR). pp. 175–180 (2020)
  * [13] Wang, J., Du, J., Zhang, et al.: Multi-modal attention network for handwritten mathematical expression recognition. In: 2019 International Conference on Document Analysis and Recognition (ICDAR). pp. 1181–1186 (2019)
  * [14] Zhang, J., Du, J., Yang, et al.: Srd: A tree structure based decoder for online handwritten mathematical expression recognition. IEEE Transactions on Multimedia 23, 2471–2480 (2021)
  * [15] Vaswani, A., Shazeer, N., Parmar, et al.: Attention is all you need. In: Advances in neural information processing systems. vol. 30, pp. 6000––6010 (2017)
  * [16] Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: BERT: Pre-training of deep bidirectional transformers for language understanding. In: Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics. pp. 4171–4186. Association for Computational Linguistics (Jun 2019)
  * [17] Brown, T., Mann, B., Ryder, et al.: Language models are few-shot learners. Advances in neural information processing systems 33, 1877–1901 (2020)
  * [18] Wolf, T., Debut, L., Sanh, et al.: Transformers: State-of-the-art natural language processing. In: Proceedings of the 2020 conference on empirical methods in natural language processing: system demonstrations. pp. 38–45 (2020). https://doi.org/10.18653/v1/2020.emnlp-demos.6
  * [19] Parmar, N., Vaswani, et al.: Image transformer. In: International conference on machine learning. pp. 4055–4064. PMLR (2018)
  * [20] Huang, C.Z.A., Vaswani, A., et al.: Music transformer: Generating music with long-term structure. In: International Conference on Learning Representations (ICLR) (2019)
  * [21] Zhao, H., Jiang, L., Jia, et al.: Point transformer. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 16259–16268 (2021)
  * [22] Kozlov, A., Andronov, V., Gritsenko, Y.: Lightweight network architecture for real-time action recognition. In: Proceedings of the 35th Annual ACM Symposium on Applied Computing. pp. 2074–2080 (2020)
  * [23] D’Eusanio, A., Simoni, A., Pini, et al.: A transformer-based network for dynamic hand gesture recognition. In: 2020 International Conference on 3D Vision (3DV). pp. 623–632 (2020)
  * [24] Wang, S., Li, B.Z., Khabsa, et al.: Linformer: Self-attention with linear complexity. arXiv (2020). https://doi.org/10.48550/arXiv.2006.04768
  * [25] Kitaev, N., Kaiser, L., Levskaya, A.: Reformer: The efficient transformer. In: International Conference on Learning Representations (2020)
  * [26] Choromanski, K., Likhosherstov, V., Dohan, D., et al.: Rethinking attention with performers. In: International Conference on Learning Representations (2021)
  * [27] Rao, R.M., Liu, J., Verkuil, et al.: MSA transformer. In: International Conference on Machine Learning. pp. 8844–8856. PMLR (2021)
  * [28] Akinremi, O., Balado, F., Silvestre, G.C.: A machine translation model for online glyph recognition. UCD Internal Research Report (to be publihed) (2021)
  * [29] Yujian, L., Bo, L.: A normalized levenshtein distance metric. IEEE Transactions on Pattern Analysis and Machine Intelligence 29(6), 1091–1095 (2007)


On the distribution of the lcm of $k$-tuples and related problems

Sungjin Kim
---
Santa Monica College, California State University Northridge
<EMAIL_ADDRESS>

###### Abstract

We study the distribution of the least common multiple of positive integers in
$\mathbb{N}\cap[1,x]$ and related problems. We refine some results of
Hilberdink and Tóth (2016). We also give a partial result toward a conjecture
of Hilberdink, Luca, and Tóth (2020).

##  1 Introduction

Let $\mathbb{N}=\\{1,2,3,\ldots\\}$ be the set of positive integers and
$\mathcal{P}=\\{2,3,5,\ldots\\}$ be the set of prime numbers. Let
$(n_{1},\ldots,n_{k})=\gcd(n_{1},\ldots,n_{k})$ and
$[n_{1},\ldots,n_{k}]=\textrm{lcm}(n_{1},\ldots,n_{k})$ be the greatest common
divisor (gcd) and the least common multiple (lcm) of $k$-tuple of positive
integers $n_{1},\ldots,n_{k}$ respectively. A well known result is that the
probability of $(n_{1},n_{2})=1$ for randomly chosen positive integers
$n_{1}\leq x$ and $n_{2}\leq x$ tends to $1/\zeta(2)=6/\pi^{2}$ as $x$ tends
to $\infty$. This can be made more precise by providing an asymptotic formula
with an error term. Further, it is possible to write the probability
distribution of the gcd of $k$-tuples of positive integers for $k\geq 2$. This
is studied in [FF1, Theorem A’]. For any integer $x\geq 2$, let
$(X_{i}^{(x)})$ be sequence of independent discrete uniform distribution (iid)
on the set $\\{1,\ldots,x\\}$. For $1\leq m\leq x$ and $k\geq 3$,

$\textbf{P}(\gcd(X_{1}^{(x)},\ldots,X_{k}^{(x)})=m)=\frac{1}{m^{k}\zeta(k)}+O\left(\frac{1}{xm^{k-1}}\right).$

We are interested in achieving a similar result for the distribution of the
lcm of tuples. This also has been extensively studied in the literature. P.
Diaconis and P. Erdős [DE, Theorem 1] provided a distribution function with an
error term in the case $k=2$. For any $0\leq t\leq 1$,

$\textbf{P}(\textrm{lcm}(X_{1}^{(x)},X_{2}^{(x)})\leq
tx^{2})=1-\frac{1}{\zeta(2)}\sum_{j=1}^{\lfloor
1/t\rfloor}\frac{1-jt(1-\log(jt))}{j^{2}}+O_{t}\left(\frac{\log x}{x}\right).$

For $k\geq 3$, the distributions of lcm are more intricate. The case $k=3$ is
handled by J. Fernández, P. Fernández [FF1, Theorem 3]. For $0\leq t\leq 1$,

$\lim_{x\rightarrow\infty}\textbf{P}(\textrm{lcm}(X_{1}^{(x)},X_{2}^{(x)},X_{3}^{(x)})\leq
tx^{3})=1-T_{3}\sum_{j=1}^{\infty}\frac{1}{j^{3}}\sum_{m=1}^{\infty}\frac{\Upsilon_{3}(m)3^{\omega(m)}}{m^{2}}(1-\Omega_{3}(tj^{2}m)),$

where
$T_{3}=\prod_{p}\left(1-\frac{1}{p}\right)^{2}\left(1+\frac{2}{p}\right)$ is
the probability that three random positive integers are pairwise coprime,
$\Upsilon_{3}(m)=\prod_{p|m}\frac{1+1/p}{1+2/p}$, $\omega(m)$ is the number of
distinct prime divisors of $m$, and $\Omega_{k}(s)$, $0<s\leq 1$ is the volume
of $\\{(x_{1},\ldots,x_{k})\in[0,1]^{k}:x_{1}\cdots x_{k}\leq s\\}$. Note that
this result does not provide an error term in the asymptotic formula.

For $k>3$, J. Fernández, P. Fernández [FF1, Theorem 1] proved that

$\textbf{P}(\textrm{lcm}(X_{1}^{(x)},\ldots,X_{k}^{(x)})>tx^{k})\asymp\sum_{j=1}^{\infty}\frac{1-\Omega_{k}(tj^{k-1})}{j^{k}}$

T. Hilberdink, L. Tóth [HT, Corollary 1] computed the moments of the
distributions of lcm. Let $k\geq 3$ and $r>-1$. Then for every $\epsilon>0$,

$\textbf{E}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]^{r}}{x^{kr}}\right)=\frac{1}{x^{k}}\sum_{n_{1},\ldots,n_{k}\leq
x}\frac{[n_{1},\ldots,n_{k}]^{r}}{x^{kr}}=\frac{C_{r,k}}{(r+1)^{k}}+O\left(x^{-\frac{1}{2}\mathrm{min}(r+1,1)+\epsilon}\right).$

This result combined with the method of moments [D, Lemma 3], prove that there
is a limiting distribution of $\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{x^{k}}$
as $x\rightarrow\infty$. However, an expression of the limiting distribution
using the method of moments is quite complicated and it conveys no
arithmetical information.

A. Bostan, A. Marynych, K. Raschel [BMR, Theorem 2.3] used the probabilistic
method to find the limiting distribution of lcm. They proved that for $k\geq
2$,

$\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{x^{k}}$

converges in distribution to

$\prod_{j=1}^{k}U_{j}\prod_{p\in\mathcal{P}}p^{\max\limits_{j\leq
k}\mathcal{G}_{j}(p)-\sum\limits_{j\leq k}\mathcal{G}_{j}(p)}$

where $(U_{j})$ is a sequence uniform distribution on $(0,1)$ and for each
prime $p$, $(\mathcal{G}_{j}(p))$ is a sequence of random variables such that
$\mathcal{G}_{j}(p)$ is has a geometric distribution with

$\mathcal{G}_{j}(p)=m\ \textrm{ with probability
}\left(1-\frac{1}{p}\right)\frac{1}{p^{m}}\ \textrm{ for $m\geq 0$. }$

All distributions here are independent.

We write

$R_{k}:=\prod_{p\in\mathcal{P}}p^{\max\limits_{j\leq
k}\mathcal{G}_{j}(p)-\sum\limits_{j\leq k}\mathcal{G}_{j}(p)}\in
1/\mathbb{N}.$

Then we must have for any $0<t\leq 1$,

$\textbf{P}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{x^{k}}>t\right)\rightarrow\sum_{n\leq\frac{1}{t}}\int_{nt}^{1}\frac{(-\log
x)^{k-1}}{(k-1)!}dx\ \textbf{P}\left(R_{k}=\frac{1}{n}\right)\ \textrm{as
$x\rightarrow\infty$.}$ (1)

To see this, we have for each $n\in\mathbb{N}$, $\int_{nt}^{1}(-\log
x)^{k-1}/(k-1)!\ dx$ is the conditional probability that $R_{k}\prod_{j\leq
k}U_{j}>t$ given that $R_{k}=1/n$. Note that the integral is
$1-\Omega_{k}(nt)$ in the notation of J. Fernández and P. Fernández [FF1].
This conditional probability is $0$ if $n>1/t$. This is the reason that the
sum ranges up to $n\leq 1/t$. A detailed account of the probability of
$R_{k}=1/n$ will be described in section 3. We write
$p_{k}(n)=\textbf{P}(R_{k}=1/n)$. Note that $p_{2}(n)=1/(n^{2}\zeta(2))$. We
remark that this expression in (1) agrees with $r=3$ result of [FF1]. To see
this, we have for any positive integer $n$,

$p_{3}(n)=T_{3}\sum_{j^{2}m=n}\frac{\Upsilon_{3}(m)3^{\omega(m)}}{j^{3}m^{2}}.$

This paper brings improvements to the current literature in the following
aspects.

1\. Providing an error term to (1) in accordance with [DE, Theorem 1].

2\. Improving the error terms of the moments of
$\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{x^{k}}$ and
$\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{X_{1}^{(x)}\cdots X_{k}^{(x)}}$ from
[HT, Corollary 1].

3\. Improving [HLT, Theorem 4.1] and thereby giving a partial result toward
[HLT, Remark 4.2].

All three improvements are based on the probability that $k$ positive integers
$n_{1},\ldots,n_{k}$ are pairwise relatively prime (for any $i\neq j$,
$(n_{i},n_{j})=1$). L. Tóth [To] proved that such probability tends to

$T_{k}=\prod_{p\in\mathcal{P}}\left(1-\frac{1}{p}\right)^{k-1}\left(1+\frac{k-1}{p}\right).$

An error term of $O(x^{k-1}\log^{k-1}x)$ is provided in his asymptotic formula
for the counting function of such $k$ tuples. His result was successively
extended by J. Hu in [H1] and [H2]. See also [RH] for an improved error term
$O(x^{k-1}\log^{d}x)$ where $d$ is the maximum degree of the vertices of a
given graph $G$. However, this improvement does not affect the error terms of
our problems. We apply a modified version of [H2, Theorem 1] which counts the
number of $k$-tuples of pairwise coprime positive integers up to $x$ such that
the $i$-th component is coprime to $u_{i}$. See section 2 for details.

On the first aspect, we provide an error term to (1) in accordance with [DE,
Theorem 1]. The following theorem gives a quantitative description of the
distribution function of lcm as mentioned in [FF3, Page 26]. We prove this in
section 5. Our method is completely elementary.

######  Theorem 1.1.

Let $k\geq 2$ be an integer. For any $0<t\leq 1$, we have

$\textbf{P}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{x^{k}}>t\right)=\sum_{n\leq\frac{1}{t}}\int_{nt}^{1}\frac{(-\log
z)^{k-1}}{(k-1)!}dz\cdot\ p_{k}(n)+O_{t}(x^{-1}\log^{k-1}x).$

On the second aspect, we prove the following in section 6.

######  Theorem 1.2.

Let $k\geq 2$ be an integer. For any $r>-1$, we have

$\textbf{E}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]^{r}}{x^{kr}}\right)=\frac{1}{x^{k}}\sum_{n_{1},\ldots,n_{k}\leq
x}\left(\frac{[n_{1},\ldots,n_{k}]}{x^{k}}\right)^{r}=\frac{C_{r,k}}{(r+1)^{k}}+E_{r,k}(x)$

and

$\textbf{E}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]^{r}}{(X_{1}^{(x)}\cdots
X_{k}^{(x)})^{r}}\right)=\frac{1}{x^{k}}\sum_{n_{1},\ldots,n_{k}\leq
x}\left(\frac{[n_{1},\ldots,n_{k}]}{n_{1}\cdots
n_{k}}\right)^{r}=C_{r,k}+E^{*}_{r,k}(x).$

Here, $C_{r,k}$ is the constant given in [HT, Corollary 1]. We have an
expression in a convergent Dirichlet series.

$C_{r,k}=\sum_{n=1}^{\infty}n^{-r}p_{k}(n),\ r>-1.$

The error terms $E_{r,k}(x)$ and $E^{*}_{r,k}(x)$ are both

$\begin{cases}O_{r}(x^{-\frac{r+1}{2}}\log^{\max(2^{k}-k-1,2k^{2}-k-2)}x)\mbox{
if }-1<r\leq 1,\\\ O_{r}(x^{-1}\log^{k-1}x)\mbox{ if }r>1.\end{cases}$

A significance of Theorem 1.2 lies in realizing that the constant $C_{r,k}$
gives a function of a single variable $r$ defined as a Dirichlet series.
However, the series defining $C_{r,k}$ diverges at $r=-1$. Thus, the case
$r=-1$ should be dealt with special care. We treat this case in section 7.

On the third aspect, we prove the following in section 7.

######  Theorem 1.3.

Let $k\geq 2$ be an integer. We have

$\log^{2^{k}-k-1}x\ll\textbf{E}\left(\frac{X_{1}^{(x)}\cdots
X_{k}^{(x)}}{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}\right)\ll\log^{2^{k}-k-1}x.$

T. Hilberdink, F. Luca, L. Tóth [HLT, Theorem 4.1] proved that

$x^{k}\ll V_{k}(x):=\sum_{n_{1},\ldots,n_{k}\leq x}\frac{n_{1}\cdots
n_{k}}{[n_{1},\ldots,n_{k}]}\ll x^{k}\log^{2^{k}-2}x.$

They also conjectured in [HLT, Remark 4.2] that there is a positive constant
$\lambda_{k}$ such that $V_{k}(x)\sim\lambda_{k}x^{k}\log^{2^{k}-k-1}x$ as
$x\rightarrow\infty$. Our theorem shows that

$V_{k}(x)\asymp x^{k}\log^{2^{k}-k-1}x.$

Thus, we obtain the same order of magnitude as the conjecture.

After the author’s initial submission of this paper, D. Essouabri, C. Salinas
Zavala, L. Tóth [EST] provided a proof of [HLT, Remark 4.2] with a full
asymptotic formula. They used methods from complex analysis such as
multivariable Perron’s formula, whereas the methods of this paper are
elementary. The author provided elementary proofs of the main terms and
improved the error terms by a different version of multivariable Perron’s
formula in [K].

##  2 Pairwise coprime $k$-tuples

Let $x\geq 2$ be an integer and
$\mathbf{u}=(u_{1},\ldots,u_{k})\in\mathbb{N}^{k}\cap[1,\infty)$. We are
interested in counting the number of $k$-tuples
$(n_{1},\ldots,n_{k})\in\mathbb{N}^{k}\cap[1,x]^{k}$ such that
$(n_{i},n_{j})=1$ whenever $i\neq j$, and $(u_{i},n_{i})=1$ for each $i$.
These are ${\rm PC}_{\mathbf{u}}$ tuples in [FF1]. J. Hu [H2, Theorem 1]
states that for any graph $G=(V,E)$ with $V=\\{1,\ldots,k\\}$, the number
$Q_{G}^{\mathbf{u}}(x)$ of $k$-tuples
$(n_{1},\ldots,n_{k})\in\mathbb{N}^{k}\cap[1,x]^{k}$ such that
$(n_{i},n_{j})=1$ whenever $(i,j)\in E$, and $(u_{i},n_{i})=1$ for each $i$,
satisfies

$Q_{G}^{\mathbf{u}}(x)=A_{G}f_{G}(\mathbf{u})x^{k}+O(\theta(\mathbf{u})x^{k-1}\log^{k-1}x),$

where

$A_{G}=\prod_{p\in\mathcal{P}}\left(\sum_{m=0}^{k}i_{m}(G)\left(1-\frac{1}{p}\right)^{k-m}\frac{1}{p^{m}}\right),$
$f_{G}(\mathbf{u})=\prod_{p|u_{1}u_{2}\cdots
u_{k}}\left(1-\frac{\sum_{m=0}^{k}i_{m,S_{\mathbf{u},p}}(G)(p-1)^{k-m}}{\sum_{m=0}^{k}i_{m}(G)(p-1)^{k-m}}\right),$

and

$\theta(\mathbf{u})=\max_{i\leq k}2^{\omega(u_{i})}.$

Given a graph $G=(V,E)$ with $V=\\{1,\ldots,k\\}$, we say that a subset
$S\subseteq V$ is independent if no two vertices of $S$ are connected by an
edge in $G$. Here, $i_{m}(G)$ is the number of independent sets of cardinality
$m$ and $i_{m,S}(G)$ is the number of independent sets of cardinality $m$
which contains a vertex in $S$. The set of indices $i$ with $1\leq i\leq k$
such that $d|u_{i}$ is denoted by $S_{\mathbf{u},d}$. We apply this theorem in
case $G=K_{k}$ is the complete graph. We have $i_{0}(G)=1$, $i_{1}(G)=k$, and
$i_{j}(G)=0$ if $j\geq 2$. Thus, we have $A_{G}=T_{k}$. If $p|u_{1}u_{2}\cdots
u_{k}$, we have $i_{0,S_{\mathbf{u},p}}=0$,
$i_{1,S_{\mathbf{u},p}}=\\#\\{1\leq i\leq k:p|u_{i}\\}=|S_{\mathbf{u},p}|$,
and $i_{j,S_{\mathbf{u},p}}=0$ if $j\geq 2$.

$Q_{K_{k}}^{\mathbf{u}}(x)=x^{k}T_{k}\prod_{p|u_{1}u_{2}\cdots
u_{k}}\left(1-\frac{|S_{\mathbf{u},p}|}{p+k-1}\right)+O(\theta(\mathbf{u})x^{k-1}\log^{k-1}x).$

Note that J. Fernández, P. Fernández [FF2, Theorem 3.1] obtained the main term
in case $\mathbf{u}$ is a pairwise coprime (PC) $k$-tuple. The inductive proof
in [H2] readily generalizes to the counting of tuples in arbitrary cubes. Let
$\mathbf{a}=(a_{1},\ldots,a_{k})\in\mathbb{N}^{k}$. Denote by
$Q_{K_{k}}^{\mathbf{u}}(\mathbf{a},x)$ the tuples in $\prod_{i}[1,x/a_{i}]$
satisfying $(n_{i},n_{j})=1$ whenever $(i,j)\in E$, and $(u_{i},n_{i})=1$ for
each $i$. Then we have

$Q_{K_{k}}^{\mathbf{u}}(\mathbf{a},x)=\frac{x^{k}}{a_{1}a_{2}\cdots
a_{k}}T_{k}\prod_{p|u_{1}u_{2}\cdots
u_{k}}\left(1-\frac{|S_{\mathbf{u},p}|}{p+k-1}\right)+O(\theta(\mathbf{u})x^{k-1}\log^{k-1}x).$

We would like to extend this asymptotic formula where each tuple is weighted
by $(n_{i}/(x/a_{i}))^{r}$ with $r>-1$, also by the characteristic function of
$(n_{i}/(x/a_{i}))_{i\leq
k}\in\\{(s_{1},\ldots,s_{k})\in[0,1]^{k}:s_{1}s_{2}\cdots s_{k}>t\\}$. Let
$f(\mathbf{s})=f(s_{1},\ldots,s_{k})$ be one of the following functions

$f(\mathbf{s})=(s_{1}\cdots s_{k})^{r},\ r>-1\ \textrm{ or }$ $f(\mathbf{s})\
\textrm{ is the characteristic function of
}\\{\mathbf{s}\in[0,1]^{k}:s_{1}s_{2}\cdots s_{k}>t\\}.$

######  Lemma 2.1.

Let $\mathbf{a}=(a_{1},\ldots,a_{k})\in\mathbb{N}^{k}$,
$\mathbf{u}=(u_{1},\ldots,u_{k})\in\mathbb{N}^{k}$, and
$\mathbf{s}=(s_{1},\ldots,s_{k})\in[0,1]^{k}$. Let
$Q_{K_{k},f}^{\mathbf{u}}(\mathbf{a},x)$ be the sum over pairwise coprime
$k$-tuples $(n_{1},\ldots,n_{k})$ in $\prod_{i\leq k}[1,x/a_{i}]$ such that
$(u_{i},n_{i})=1$ for each $i$, and each tuple is weighted by
$f((n_{i}/(x/a_{i}))_{i\leq k})$. Then for $r\geq 0$,

$Q_{K_{k},f}^{\mathbf{u}}(\mathbf{a},x)=\frac{x^{k}T_{k}}{a_{1}a_{2}\cdots
a_{k}}\int_{[0,1]^{k}}f(\mathbf{s})d\mathbf{s}\prod_{p|u_{1}u_{2}\cdots
u_{k}}\left(1-\frac{|S_{\mathbf{u},p}|}{p+k-1}\right)+O(\theta(\mathbf{u})x^{k-1}\log^{k-1}x).$
(2)

If $-1<r<0$, there is an additional error term

$O_{r}\left(x^{k-1+|r|}\left(\frac{1}{a_{1}^{|r|}a_{2}\cdots
a_{k}}+\frac{1}{a_{1}a_{2}^{|r|}a_{3}\cdots a_{k}}+\cdots+\frac{1}{a_{1}\cdots
a_{k-1}a_{k}^{|r|}}\right)\right).$

###### Proof.

For simplicity of notation, we write $x/a_{i}=b_{i}$ for each $i$. We follow
the inductive proof given in [H2]. We include the proof for completeness. If
$k=1$, the desired sum is

$\sum_{\begin{subarray}{c}{n\leq b_{1}}\\\
{(n,u_{1})=1}\end{subarray}}f(n/b_{1}).$

If $f(s)=s^{r}$, $r\geq 0$, then

$\displaystyle\sum_{\begin{subarray}{c}{n\leq b_{1}}\\\
{(n,u_{1})=1}\end{subarray}}(n/b_{1})^{r}$
$\displaystyle=\sum_{d|u_{1}}\mu(d)\sum_{\begin{subarray}{c}{n\leq b_{1}}\\\
{d|n}\end{subarray}}\left(\frac{n}{b_{1}}\right)^{r}$
$\displaystyle=\sum_{d|u_{1}}\mu(d)\frac{1}{b_{1}^{r}}\sum_{k\leq\frac{b_{1}}{d}}d^{r}k^{r}=\sum_{d|u_{1}}\mu(d)\left(\frac{d}{b_{1}}\right)^{r}\left(\left(\frac{b_{1}}{d}\right)^{r+1}\frac{1}{r+1}+O\left(\left(\frac{b_{1}}{d}\right)^{r}\right)\right)$
$\displaystyle=\sum_{d|u_{1}}\frac{\mu(d)}{d}\frac{b_{1}}{r+1}+O\left(\sum_{d|u_{1}}|\mu(d)|\right)=b_{1}T_{1}\int_{0}^{1}s^{r}ds\prod_{p|u_{1}}\left(1-\frac{1}{p}\right)+O(2^{\omega(u_{1})}).$

If $f(s)$ is the characteristic function of $(t,1]$, then

$\displaystyle\sum_{\begin{subarray}{c}{n\leq b_{1}}\\\ {(n,u_{1})=1}\\\
{n/b_{1}>t}\end{subarray}}1$
$\displaystyle=\sum_{d|u_{1}}\mu(d)\sum_{\begin{subarray}{c}{tb_{1}<n\leq
b_{1}}\\\ {d|n}\end{subarray}}1$
$\displaystyle=\sum_{d|u_{1}}\mu(d)\sum_{\frac{tb_{1}}{d}<k\leq\frac{b_{1}}{d}}1=\sum_{d|u_{1}}\mu(d)\left(\frac{(1-t)b_{1}}{d}+O(1)\right)$
$\displaystyle=\sum_{d|u_{1}}\frac{\mu(d)}{d}(1-t)b_{1}+O\left(\sum_{d|u_{1}}|\mu(d)|\right)=b_{1}T_{1}\int_{t}^{1}ds\prod_{p|u_{1}}\left(1-\frac{1}{p}\right)+O(2^{\omega(u_{1})}).$

Thus, the results are true for both functions when $k=1$. Suppose that the
result is true for some $k\geq 1$ and $f(\mathbf{s})=(s_{1}\cdots s_{k})^{r}$,
$r\geq 0$. That is,

$Q_{K_{k},f}^{\mathbf{u}}(\mathbf{a},x)=\frac{b_{1}b_{2}\cdots
b_{k}T_{k}}{(r+1)^{k}}f_{k}(\mathbf{u})+O(\theta(\mathbf{u})x^{k-1}\log^{k-1}x),$

where

$f_{k}(\mathbf{u})=\prod_{p|u_{1}u_{2}\cdots
u_{k}}\left(1-\frac{|S_{\mathbf{u},p}|}{p+k-1}\right).$

To prove the result for $k+1$, we write

$\displaystyle
Q_{K_{k+1},fs_{k+1}^{r}}^{\mathbf{u},u_{k+1}}(\mathbf{a},a_{k+1},x)=\sum_{\begin{subarray}{c}{j\leq
b_{k+1}}\\\
{(j,u_{k+1})=1}\end{subarray}}\left(\frac{j}{b_{k+1}}\right)^{r}Q_{K_{k},f}^{j\mathbf{u}}(\mathbf{a},x)$
$\displaystyle=\sum_{\begin{subarray}{c}{j\leq b_{k+1}}\\\
{(j,u_{k+1})=1}\end{subarray}}\left(\frac{j}{b_{k+1}}\right)^{r}\left(\frac{b_{1}\cdots
b_{k}T_{k}}{(r+1)^{k}}f_{k}(j\mathbf{u})+O(\theta(j\mathbf{u})x^{k-1}\log^{k-1}x)\right)$
$\displaystyle=\sum_{\begin{subarray}{c}{j\leq b_{k+1}}\\\
{(j,u_{k+1})=1}\end{subarray}}\left(\frac{j}{b_{k+1}}\right)^{r}\frac{b_{1}\cdots
b_{k}T_{k}}{(r+1)^{k}}f_{k}(j\mathbf{u})+O(\theta(\mathbf{u})x^{k}\log^{k}x).$

Since

$f_{k}(j\mathbf{u})=f_{k}(\mathbf{u})\sum_{d|j}\mu(d)\prod_{p|d}\frac{k-|S_{\mathbf{u},p}|}{p+k-1-|S_{\mathbf{u},p}|},$

we focus on the sum over $j$. That is,

$\sum_{\begin{subarray}{c}{j\leq b_{k+1}}\\\
{(j,u_{k+1})=1}\end{subarray}}\left(\frac{j}{b_{k+1}}\right)^{r}\sum_{d|j}\mu(d)g_{k}(d),$

where

$g_{k}(d)=\prod_{p|d}\frac{k-|S_{\mathbf{u},p}|}{p+k-1-|S_{\mathbf{u},p}|}\leq\prod_{p|d}\frac{k}{p+k-1}\leq\frac{k^{\omega(d)}}{d}$

if $d$ is square-free.

Substituting $de=j$ in the double sum, we have

$\displaystyle\sum_{\begin{subarray}{c}{de\leq b_{k+1}}\\\
{(de,u_{k+1})=1}\end{subarray}}$
$\displaystyle\left(\frac{de}{b_{k+1}}\right)^{r}\mu(d)g_{k}(d)=\sum_{\begin{subarray}{c}{d\leq
b_{k+1}}\\\
{(d,u_{k+1})=1}\end{subarray}}\mu(d)g_{k}(d)\sum_{\begin{subarray}{c}{e\leq
b_{k+1}/d}\\\
{(e,u_{k+1})=1}\end{subarray}}\left(\frac{d}{b_{k+1}}\right)^{r}e^{r}$
$\displaystyle=\sum_{\begin{subarray}{c}{d\leq b_{k+1}}\\\
{(d,u_{k+1})=1}\end{subarray}}\mu(d)g_{k}(d)\left(\frac{b_{k+1}}{d}\frac{1}{r+1}f_{1}(u_{k+1})+O(2^{\omega(u_{k+1})})\right)$
$\displaystyle=\sum_{\begin{subarray}{c}{d\leq b_{k+1}}\\\
{(d,u_{k+1})=1}\end{subarray}}\mu(d)g_{k}(d)\frac{b_{k+1}}{d}\frac{1}{r+1}f_{1}(u_{k+1})+O(\theta(u_{k+1})\log^{k}x)$
$\displaystyle=\frac{b_{k+1}f_{1}(u_{k+1})}{r+1}\sum_{(d,u_{k+1})=1}\frac{\mu(d)g_{k}(d)}{d}+O(\log^{k-1}x)+O(\theta(u_{k+1})\log^{k}x).$

The sum over $d$ is a convergent Euler product

$\prod_{p\nmid u_{k+1}}\left(1-\frac{g_{k}(p)}{p}\right).$

Rearranging the product over primes, we obtain the desired result for $k+1$ as
follows.

$Q_{K_{k+1},fs_{k+1}^{r}}^{\mathbf{u},u_{k+1}}(\mathbf{a},a_{k+1},x)=\frac{b_{1}b_{2}\cdots
b_{k+1}T_{k+1}}{(r+1)^{k+1}}f_{k+1}(\mathbf{u},u_{k+1})+O(\theta(\mathbf{u},u_{k+1})x^{k}\log^{k}x).$

Suppose that the result is true for $k$ with $f$ is the characteristic
function of the set $\\{(s_{1},\ldots,s_{k})\in[0,1]^{k}\ |\ s_{1}\cdots
s_{k}>t\\}$. That is, for $0<t\leq 1$,

$Q_{K_{k},f}^{\mathbf{u}}(\mathbf{a},x)=b_{1}b_{2}\cdots
b_{k}T_{k}f_{k}(\mathbf{u})\int_{\begin{subarray}{c}{\forall i,0\leq s_{i}\leq
1}\\\ {s_{1}s_{2}\cdots
s_{k}>t}\end{subarray}}d\mathbf{s}+O(\theta(\mathbf{u})x^{k-1}\log^{k-1}x).$

To prove the result for $k+1$, we proceed as before. Denote by $\overline{f}$
the characteristic function of the set
$\\{(s_{1},\ldots,s_{k+1})\in[0,1]^{k+1}\ |\ s_{1}\cdots s_{k+1}>t\\}$. Then
we have

$\displaystyle
Q_{K_{k+1},\overline{f}}^{\mathbf{u},u_{k+1}}(\mathbf{a},a_{k+1},x)$
$\displaystyle=\sum_{\begin{subarray}{c}{j\leq b_{k+1}}\\\
{(j,u_{k+1})=1}\end{subarray}}\left(b_{1}\cdots
b_{k}T_{k}\int_{\begin{subarray}{c}{\forall i,0\leq s_{i}\leq 1}\\\
{s_{1}\cdots
s_{k}>t/(j/b_{k+1})}\end{subarray}}d\mathbf{s}f_{k}(j\mathbf{u})+O(\theta(j\mathbf{u})x^{k-1}\log^{k-1}x)\right)$
$\displaystyle=\sum_{\begin{subarray}{c}{j\leq b_{k+1}}\\\
{(j,u_{k+1})=1}\end{subarray}}b_{1}\cdots
b_{k}T_{k}\int_{\begin{subarray}{c}{\forall i,0\leq s_{i}\leq 1}\\\
{s_{1}\cdots
s_{k}>t/(j/b_{k+1})}\end{subarray}}d\mathbf{s}f_{k}(j\mathbf{u})+O(\theta(\mathbf{u})x^{k}\log^{k}x).$

We obtain by the substitutions $de=j$ and $mv=e$,

$\displaystyle\sum_{\begin{subarray}{c}{j\leq b_{k+1}}\\\
{(j,u_{k+1})=1}\end{subarray}}$
$\displaystyle\int_{\begin{subarray}{c}{\forall i,0\leq s_{i}\leq 1}\\\
{s_{1}\cdots
s_{k}>t/(j/b_{k+1})}\end{subarray}}d\mathbf{s}\sum_{d|j}\mu(d)g_{k}(d)=\sum_{\begin{subarray}{c}{d\leq
b_{k+1}}\\\
{(d,u_{k+1})=1}\end{subarray}}\mu(d)g_{k}(d)\sum_{\begin{subarray}{c}{e\leq\frac{b_{k+1}}{d}}\\\
{(e,u_{k+1})=1}\end{subarray}}\int_{\begin{subarray}{c}{\forall i,0\leq
s_{i}\leq 1}\\\ {s_{1}\cdots s_{k}>t/(de/b_{k+1})}\end{subarray}}d\mathbf{s}$
$\displaystyle=\sum_{\begin{subarray}{c}{d\leq b_{k+1}}\\\
{(d,u_{k+1})=1}\end{subarray}}\mu(d)g_{k}(d)\sum_{m|u_{k+1}}\mu(m)\sum_{v\leq\frac{b_{k+1}}{dm}}\int_{\begin{subarray}{c}{\forall
i,0\leq s_{i}\leq 1}\\\ {s_{1}\cdots
s_{k}>t/(v/(b_{k+1}/dm))}\end{subarray}}d\mathbf{s}$
$\displaystyle=\sum_{\begin{subarray}{c}{d\leq b_{k+1}}\\\
{(d,u_{k+1})=1}\end{subarray}}\mu(d)g_{k}(d)\sum_{m|u_{k+1}}\mu(m)\left(\frac{b_{k+1}}{dm}\int_{\begin{subarray}{c}{\forall
i,0\leq s_{i}\leq 1}\\\ {s_{1}\cdots
s_{k}s_{k+1}>t}\end{subarray}}d\mathbf{s}ds_{k+1}+O(1)\right)$
$\displaystyle=b_{k+1}f_{1}(u_{k+1})\int_{\begin{subarray}{c}{\forall i,0\leq
s_{i}\leq 1}\\\ {s_{1}\cdots
s_{k}s_{k+1}>t}\end{subarray}}d(\mathbf{s},s_{k+1})\sum_{(d,u_{k+1})=1}\frac{\mu(d)g_{k}(d)}{d}$
$\displaystyle+O(\log^{k-1}x)+O(\theta(u_{k+1})\log^{k}x).$

Rearranging the product over primes, we obtain the desired result for $k+1$ as
follows.

$\displaystyle
Q_{K_{k+1},\overline{f}}^{\mathbf{u},u_{k+1}}(\mathbf{a},a_{k+1},x)=$
$\displaystyle b_{1}b_{2}\cdots
b_{k+1}T_{k+1}\int_{\begin{subarray}{c}{\forall i,0\leq s_{i}\leq 1}\\\
{s_{1}\cdots
s_{k}s_{k+1}>t}\end{subarray}}d(\mathbf{s},s_{k+1})f_{k+1}(\mathbf{u},u_{k+1})$
$\displaystyle+O(\theta(\mathbf{u},u_{k+1})x^{k}\log^{k}x).$

If $-1<r<0$, remark that

$\sum_{n\leq x}n^{r}=\frac{1}{r+1}x^{r+1}+\zeta(-r)+O(x^{r}).$

Applying this in the base step and the induction step of the proof, we see
that the additional error term appears. ∎

##  3 Divisibility conditions

Recall from [BMR] that for each prime $p$, $(\mathcal{G}_{j}(p))$ is a
sequence of independent random variables such that $\mathcal{G}_{j}(p)$ has a
geometric distribution such that

$\mathcal{G}_{j}(p)=m\ \textrm{ with probability
}\left(1-\frac{1}{p}\right)\frac{1}{p^{m}}\ \textrm{ for $m\geq 0$,}$

and

$R_{k}:=\prod_{p\in\mathcal{P}}p^{\max\limits_{j\leq
k}\mathcal{G}_{j}(p)-\sum\limits_{j\leq k}\mathcal{G}_{j}(p)}\in
1/\mathbb{N}.$

Let $X_{j}^{(x)}$ be the discrete uniform distribution over the set
$\\{1,\ldots,x\\}$. The distribution $\mathcal{G}_{j}(p)$ is a limiting
distribution (as $x\rightarrow\infty$) of

$\\{\textbf{P}(X_{j}^{(x)}\textrm{ is divisible by }p^{m}\textrm{ and not by
}p^{m+1})\\}_{m\geq 0}.$

It follows that we also have

$\lim_{x\rightarrow\infty}\textbf{P}(X_{j}^{(x)}\textrm{ is divisible by
}p^{m})=\frac{1}{p^{m}}=\textbf{P}(\mathcal{G}_{j}(p)\geq m).$

Thus, we see that the value of $\mathcal{G}_{j}(p)$ yields a $p$-power
divisibility condition on $X_{j}^{(x)}$. We write $p$-power divisibility
condition on $k$-tuple $(X_{1}^{(x)},\ldots,X_{k}^{(x)})$ as a tagged vector
$\langle e_{1},\ldots,e_{i}\uparrow,\ldots,e_{k}\rangle_{p}$, each component
may have a tag $\uparrow$. The use of uparrow notation is to indicate the
particular number ”or higher”. If we have the tag on a component $i$, then it
means $p^{e_{i}}|X_{i}^{(x)}$: i.e. $\mathcal{G}_{i}(p)\geq e_{i}$. A
component $i$ without tag means $p^{e_{i}}||X_{i}^{(x)}$: i.e.
$\mathcal{G}_{i}(p)=e_{i}$. For example, a tagged vector $\langle
2\uparrow,3,4\uparrow,6\rangle_{7}$ means $7^{2}|X_{1}^{(x)}$,
$7^{3}||X_{2}^{(x)}$, $7^{4}|X_{3}^{(x)}$, and $7^{6}||X_{4}^{(x)}$ (or
$\mathcal{G}_{1}(7)\geq 2$, $\mathcal{G}_{2}(7)=3$, $\mathcal{G}_{3}(7)\geq
4$, and $\mathcal{G}_{4}(7)=6$). Let $S\subseteq\mathcal{P}$ be a subset of
prime numbers. We may combine $p$-power divisibility conditions of $k$-tuples
for $p\in S$. For such combined divisibility conditions, we write

$\wedge_{p\in S}\langle
e_{p,1},\ldots,e_{p,i}\uparrow,\ldots,e_{p,k}\rangle_{p}.$

For example, $\langle 2,3\uparrow\rangle_{2}\wedge\langle
4\uparrow,5\rangle_{3}$ means $2^{2}||X_{1}^{(x)}$, $2^{3}|X_{2}^{(x)}$,
$3^{4}|X_{1}^{(x)}$, and $3^{5}||X_{2}^{(x)}$: i.e. $\mathcal{G}_{1}(2)=2$,
$\mathcal{G}_{2}(2)\geq 3$, $\mathcal{G}_{1}(3)\geq 4$, and
$\mathcal{G}_{2}(3)=5$. For each prime $p$ with divisibility condition
$\langle e_{p,1},\ldots,e_{p,k}\rangle_{p}$ without $\uparrow$, consider

$i_{0}=\max\\{i\leq k:e_{p,i}=\max_{j\leq k}e_{p,j}\\}.$

We call $e_{p,i_{0}}$ a dropped maximum. This naming is because
$\max\limits_{j\leq k}\mathcal{G}_{j}(p)-\sum\limits_{j\leq
k}\mathcal{G}_{j}(p)$ drops the maximum and sums up the remaining $k-1$
numbers. For

$i_{1}=\max\\{i\leq k:e_{p,i}=\max_{j\leq k,j\neq i_{0}}e_{p,j}\\},$

we call $e_{p,i_{1}}$ the second maximum.

Let $n\in\mathbb{N}$. We will find $\textbf{P}(R_{k}=\frac{1}{n})=p_{k}(n)$
from the definition of $R_{k}$. Let $p^{e}||n$. Denote by
$\mathbf{x}=(x_{1},\ldots,x_{k-1})$ the $(k-1)$-tuple of nonnegative integers
with a sum equals $e$. Let

$i_{1}:=i_{1}(\mathbf{x})=\max\\{i\leq k-1:x_{i}=\max_{j\leq k-1}x_{j}\\}$

so that $x_{i_{1}}$ is the maximum entry of ${\bf x}$. Note that the second
maximum of a valid divisibility condition is necessarily the maximum of the
entries of $\mathbf{x}$. Then the following table shows all possible
divisibility conditions.

Divisibility conditions | Dropped position
---|---
$\langle x_{1},\ldots,x_{i_{1}},x_{i_{1}+1},\ldots,x_{k-1},x_{i_{1}}\uparrow\rangle_{p}$ | $k$
$\langle x_{1},\ldots,x_{i_{1}},x_{i_{1}+1},\ldots,x_{i_{1}}\uparrow,x_{k-1}\rangle_{p}$ | $k-1$
$\vdots$ | $\vdots$
$\langle x_{1},\ldots,x_{i_{1}},x_{i_{1}}\uparrow,x_{i_{1}+1},\ldots,x_{k-1}\rangle_{p}$ | $i_{1}+1$
$\langle x_{1},\ldots,x_{i_{1}-1},(x_{i_{1}}+1)\uparrow,x_{i_{1}},x_{i_{1}+1},\ldots,x_{k-1}\rangle_{p}$ | $i_{1}$
$\langle x_{1},\ldots,(x_{i_{1}}+1)\uparrow,x_{i_{1}-1},x_{i_{1}},\ldots,x_{k-1}\rangle_{p}$ | $i_{1}-1$
$\vdots$ | $\vdots$
$\langle(x_{i_{1}}+1)\uparrow,x_{1},\ldots,x_{i_{1}},x_{i_{1}+1},\ldots,x_{k-1}\rangle_{p}$ | $1$

The probability that $p$-part of $R_{k}$ equals $e$ is

$\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\ {x_{i}\geq
0}\end{subarray}}\left(1-\frac{1}{p}\right)^{k-1}\frac{1}{p^{e}}\left(\frac{k-i_{1}(\mathbf{x})}{p^{x_{i_{1}}}}+\frac{i_{1}(\mathbf{x})}{p^{x_{i_{1}}+1}}\right).$

By the independence of $\mathcal{G}_{j}(p)$ for any prime $p$ and $j\geq 1$,
we obtain

$p_{k}(n)=\prod_{p\in\mathcal{P}}\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\
{x_{i}\geq
0}\end{subarray}}\left(1-\frac{1}{p}\right)^{k-1}\frac{1}{p^{e}}\left(\frac{k-i_{1}(\mathbf{x})}{p^{x_{i_{1}}}}+\frac{i_{1}(\mathbf{x})}{p^{x_{i_{1}}+1}}\right).$
(3)

Note that if a prime $q$ does not divide $n$, then $e=0$, $x_{i_{1}}=0$, and
$i_{1}(\mathbf{x})=k-1$, so it contributes

$\left(1-\frac{1}{q}\right)^{k-1}\left(1+\frac{k-1}{q}\right).$

Therefore, the product (3) converges. We are able to factor out $T_{k}$ and
rewrite (3) as

$p_{k}(n)=T_{k}\prod_{p^{e}||n}\frac{1}{1+(k-1)/p}\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\
{x_{i}\geq
0}\end{subarray}}\frac{1}{p^{e}}\left(\frac{k-i_{1}(\mathbf{x})}{p^{x_{i_{1}}}}+\frac{i_{1}(\mathbf{x})}{p^{x_{i_{1}}+1}}\right).$
(4)

We have a single variable function $F_{k}(s)$ on $\Re s>-1$ defined as a
Dirichlet series

$\displaystyle F_{k}(s)$ $\displaystyle=\sum_{n=1}^{\infty}n^{-s}\ p_{k}(n)$
$\displaystyle=T_{k}\prod_{p\in\mathcal{P}}\left(1+\frac{1}{1+(k-1)/p}\sum_{e=1}^{\infty}\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\
{x_{i}\geq
0}\end{subarray}}\frac{1}{p^{(s+1)e}}\left(\frac{k-i_{1}(\mathbf{x})}{p^{x_{i_{1}}}}+\frac{i_{1}(\mathbf{x})}{p^{x_{i_{1}}+1}}\right)\right).$

Note that if $r>-1$, $F_{k}(r)=C_{r,k}$ in [HT, Corollary 1]. Moreover, the
$p$-part of Euler product can be written in a finite sum. This is [BMR,
Corollary 2.7].

$F_{k}(s)=\textbf{E}R_{k}^{s}=\prod_{p\in\mathcal{P}}\frac{\left(1-\frac{1}{p}\right)^{k}}{\left(1-\frac{1}{p^{s+1}}\right)^{k}}\sum_{j=1}^{k}\binom{k}{j}(-1)^{j-1}\frac{1-\frac{1}{p^{j(s+1)}}}{1-\frac{1}{p^{(j-1)(s+1)+1}}}.$

It will be an interesting problem showing the two expressions of $F_{k}(s)$
are equivalent directly by means of rearranging sums and products. However, we
did not try this here.

##  4 Distribution of lcm - main lemma

In [BMR], the limiting distribution of
$\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{X_{1}^{(x)}\cdots X_{k}^{(x)}}$ is
proven to be $R_{k}$. Thus, we must have

$\lim_{x\rightarrow\infty}\textbf{P}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{X_{1}^{(x)}\cdots
X_{k}^{(x)}}=\frac{1}{n}\right)=p_{k}(n).$

We would like to have a quantitative asymptotic formula that is uniform on
both $n$ and $x$. We apply the method of section 3 to prove the following main
lemma of this paper. Denote by $P_{x}^{(1)}(n)$ the following item

$P_{x}^{(1)}(n)=\textbf{P}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{X_{1}^{(x)}\cdots
X_{k}^{(x)}}=\frac{1}{n}\right).$

We have

######  Lemma 4.1.

Let $k\geq 2$. Uniformly for $n\in\mathbb{N}$ and $x\geq 2$, we have

$P_{x}^{(1)}(n)=p_{k}(n)+O\left(\tau_{k-1}(n)(2k)^{\omega(n)}x^{-1}\log^{k-1}x\right).$
(5)

###### Proof.

Let $n=p_{1}^{e_{1}}\cdots p_{m}^{e_{m}}$ where $p_{i}$’s are distinct primes
and $e_{i}\geq 1$. For each $p_{i}$, a solution of
$x_{1}+\cdots+x_{k-1}=e_{i}$ gives rise to $k$ distinct divisibility
conditions (see the table in section 3, each has exactly one $\uparrow$). The
number of solutions of $x_{1}+\cdots+x_{k-1}=e_{i}$ is
$\tau_{k-1}(p_{i}^{e_{i}})$. Thus, each prime factor of $n$ gives rise to
$\tau_{k-1}(p_{i}^{e_{i}})k$ divisibility conditions. The number of ways to
combine all possible $p$-power divisibility conditions is
$\prod_{p|n}(\tau_{k-1}(p_{i}^{e_{i}})k)=\tau_{k-1}(n)k^{\omega(n)}$. Denote
by $B_{n}$ the set of all combined divisibility conditions so that
$|B_{n}|=\tau_{k-1}(n)k^{\omega(n)}$. Let $M\in B_{n}$ be written in the
following form

Divisibility condition | Tagged ($\uparrow$) entry
---|---
$\langle e_{1,1},\ldots,e_{1,k}\rangle_{p_{1}}$ | $e_{1,j_{1}}\uparrow$
$\langle e_{2,1},\ldots,e_{2,k}\rangle_{p_{2}}$ | $e_{2,j_{2}}\uparrow$
$\vdots$ | $\vdots$
$\langle e_{m,1},\ldots,e_{m,k}\rangle_{p_{m}}$ | $e_{m,j_{m}}\uparrow$

We count the number of $k$-tuples with the following conditions.

$(n_{1},\ldots,n_{k})\in[1,x]^{k}\textrm{ and $M\in B_{n}$ is satisfied.}\ \
(*)$

Let

$v_{1}=\frac{n_{1}}{a_{1}},\ldots,\textrm{ and }v_{k}=\frac{n_{k}}{a_{k}},$

where $a_{1}=p_{1}^{e_{1,1}}p_{2}^{e_{2,1}}\cdots p_{m}^{e_{m,1}}$,
$a_{2}=p_{1}^{e_{1,2}}p_{2}^{e_{2,2}}\cdots p_{m}^{e_{m,2}},\ldots,$ and
$a_{k}=p_{1}^{e_{1,k}}p_{2}^{e_{2,k}}\cdots p_{m}^{e_{m,k}}$. Let
$I_{1},\ldots,I_{k}$ be indicator functions with

$I_{j}(i)=\begin{cases}0&\mbox{ if }j=j_{i}\\\ 1&\mbox{ if }j\neq
j_{i}.\end{cases}$

Let $u_{j}=\prod_{i\leq m}p_{i}^{I_{j}(i)}$, $j\leq k$, $\mathbf{u}=\langle
u_{1},\ldots,u_{k}\rangle$, and $\mathbf{a}=\langle
a_{1},\ldots,a_{k}\rangle$. Then $(*)$ is equivalent to

$(v_{1},\ldots,v_{n})\in\prod_{i\leq
k}\left[1,\frac{x}{a_{i}}\right],\forall{j\leq k},(u_{j},v_{j})=1,\textrm{ and
}(v_{1},\ldots,v_{k})\textrm{ is pairwise coprime}.\ \ (**)$

By $r=0$ case of Lemma 2.1, the number of tuples satisfying $(**)$ is

$Q_{K_{k},1}^{\mathbf{u}}(\mathbf{a},x)=\frac{x^{k}T_{k}}{a_{1}a_{2}\cdots
a_{k}}\prod_{p|u_{1}u_{2}\cdots
u_{k}}\left(1-\frac{|S_{\mathbf{u},p}|}{p+k-1}\right)+O(\theta(\mathbf{u})x^{k-1}\log^{k-1}x).$

The set of prime factors of $u_{1}\cdots u_{k}$ and that of $n$ are identical.
Since each row of $M$ has only one tagged ($\uparrow$) entry,
$|S_{\mathbf{u},p_{i}}|=k-1$ for each $i\leq m$. Thus, the number of tuples
$(n_{1},\ldots,n_{k})$ satisfying $(*)$ is

$\frac{x^{k}T_{k}}{a_{1}a_{2}\cdots
a_{k}}\prod_{p|n}\left(1-\frac{k-1}{p+k-1}\right)+O(2^{\omega(n)}x^{k-1}\log^{k-1}x).$

Using $1-(k-1)/(p+k-1)=p/(p+k-1)=1/(1+(k-1)/p)$ and summing over all $M\in
B_{n}$, we obtain the result. ∎

Define

$P_{x}^{(2)}(n)=\frac{1}{x^{k}}\sum_{\begin{subarray}{c}{\forall{i\leq
k},n_{i}\leq x}\\\ {\frac{[n_{1},\ldots,n_{k}]}{n_{1}\cdots
n_{k}}=\frac{1}{n}}\end{subarray}}\left(\frac{n_{1}}{x}\right)^{r}\cdots\left(\frac{n_{k}}{x}\right)^{r}.$

We adopt notations $\mathbf{x}$, $x_{i_{1}}$, and $i_{1}(\mathbf{x})$ of
section 3. Let $q_{k}(n)$ be the sum of the following terms arising from each
$M\in B_{n}$,

$\frac{1}{a_{1}^{|r|}a_{2}\cdots a_{k}}+\frac{1}{a_{1}a_{2}^{|r|}a_{3}\cdots
a_{k}}+\cdots+\frac{1}{a_{1}\cdots a_{k-1}a_{k}^{|r|}}.$

Applying the functions $f(\mathbf{s})$ given in Lemma 2.1, we have the
analogous results.

######  Lemma 4.2.

Uniformly for $x\geq 2$ and $n\in\mathbb{N}$, for any $r\geq 0$, we have

$P_{x}^{(2)}(n)=\frac{1}{(r+1)^{k}}p_{k}(n)+O_{r}\left(\tau_{k-1}(n)(2k)^{\omega(n)}x^{-1}\log^{k-1}x\right).$
(6)

If $-1<r<0$, we have (6) with an additional error term

$O_{r}(q_{k}(n)x^{-(r+1)}).$

Moreover, if $0<t\leq 1$, we have

$\frac{1}{x^{k}}\sum_{\begin{subarray}{c}{\forall{i\leq k},n_{i}\leq x}\\\
{\frac{[n_{1},\ldots,n_{k}]}{n_{1}\cdots n_{k}}=\frac{1}{n}}\\\ {n_{1}\cdots
n_{k}>tx^{k}}\end{subarray}}1=(1-\Omega_{k}(t))p_{k}(n)+O\left(\tau_{k-1}(n)(2k)^{\omega(n)}x^{-1}\log^{k-1}x\right).$
(7)

###### Proof.

In the proof of Lemma 4.1, replace $Q_{K_{k},1}^{\mathbf{u}}(\mathbf{a},x)$ by
$Q_{K_{k},f}^{\mathbf{u}}(\mathbf{a},x)$. We have

$f(\mathbf{s})=(s_{1}\cdots s_{k})^{r}\textrm{ for }(6)\textrm{ and }$
$f(\mathbf{s})\textrm{ is the characteristic function of the set
}\\{(s_{1},\ldots,s_{k})\in[0,1]^{k}:s_{1}\cdots s_{k}>t\\}$

for (7). Then apply Lemma 2.1. The additional error term in case $-1<r<0$ is
due to the error term in Lemma 2.1. ∎

Recall that $\Omega_{k}(t)$, $0<t\leq 1$ is the volume of the set

$\\{(s_{1},\ldots,s_{k})\in[0,1]^{k}:s_{1}\cdots s_{k}\leq t\\}.$

This volume can be written as

$\Omega_{k}(t)=\int_{0}^{t}\frac{(-\log z)^{k-1}}{(k-1)!}dz=\int_{-\log
t}^{\infty}\frac{u^{k-1}e^{-u}}{(k-1)!}du=\sum_{j<k}\frac{t(-\log
t)^{j}}{j!}.$

The first identity is because $(-\log z)^{k-1}/(k-1)!$ is the probability
density function of $\prod_{j\leq k}U_{j}$ where $(U_{j})$ is a sequence of
the independent uniform distribution on $(0,1)$. The second identity is
obtained by the change of variable $-\log z=u$. The last identity is due to
the relation between Erlang distribution and Poisson distribution.

We study the Dirichlet series $\sum_{n=1}^{\infty}n^{-s}p_{k}(n)$. To prove
Theorem 1.2 and 1.3, we need to study the behavior of the series at $s=-1$. In
the following theorem, we prove results of Tauberian type. Let
$g_{k}(n)=T_{k}^{-1}p_{k}(n)\prod_{p|n}(1+(k-1)/p)$.

######  Lemma 4.3.

The Dirichlet series $F_{k}(s)=\sum_{n=1}^{\infty}n^{-s}p_{k}(n)$ is
convergent if $\Re(s)>-1$. Its Euler product is

$F_{k}(s)=T_{k}\prod_{p\in\mathcal{P}}\left(1+\frac{1}{1+(k-1)/p}\sum_{e=1}^{\infty}\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\
{x_{i}\geq
0}\end{subarray}}\frac{1}{p^{(s+1)e}}\left(\frac{k-i_{1}(\mathbf{x})}{p^{x_{i_{1}}}}+\frac{i_{1}(\mathbf{x})}{p^{x_{i_{1}}+1}}\right)\right).$

Similarly, we define $G_{k}(s)=\sum_{n=1}^{\infty}n^{-s}g_{k}(n)$. This series
is convergent if $\Re(s)>-1$ with an Euler product

$G_{k}(s)=\prod_{p\in\mathcal{P}}\left(1+\sum_{e=1}^{\infty}\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\
{x_{i}\geq
0}\end{subarray}}\frac{1}{p^{(s+1)e}}\left(\frac{k-i_{1}(\mathbf{x})}{p^{x_{i_{1}}}}+\frac{i_{1}(\mathbf{x})}{p^{x_{i_{1}}+1}}\right)\right).$

We have $x_{i_{1}}\geq 1$ and

$\sum_{e=1}^{\infty}\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\
{x_{i}\geq 0,\ x_{i_{1}}=1}\end{subarray}}(k-i_{1}(\mathbf{x}))=2^{k}-k-1.$
(8)

Consequently, for some constants $0<c_{k}<d_{k}$,

$\sum_{n\leq x}np_{k}(n)\sim c_{k}\log^{2^{k}-k-1}x\textrm{ and }\sum_{n\leq
x}ng_{k}(n)\sim d_{k}\log^{2^{k}-k-1}x.$ (9)

###### Proof.

The Euler product of $F_{k}(s)$ is obtained in section 3 and that of
$G_{k}(s)$ is clear from the definition of $g_{k}(n)$. It is clear that
$x_{i_{1}}\geq 1$ and $i_{1}\leq k-1$. If $x_{i_{1}}=1$, then the sum (8) is
restricted to a finite sum over $e\leq k-1$. For each $i_{1}\leq k-1$, we have
$x_{i_{1}+1}=\cdots=x_{k-1}=0$ and $x_{j}\in\\{0,1\\}$ for $j\leq i_{1}-1$.
Thus, the sum (8) is

$\sum_{i_{1}\leq k-1}2^{i_{1}-1}(k-i_{1})=2^{k-2}\cdot 1+2^{k-1}\cdot
2+\cdots+2^{0}\cdot(k-1)=2^{k}-k-1.$

Consequently, we see that

$H_{k}(s)=F_{k}(s)\zeta(s+2)^{-(2^{k}-k-1)}\textrm{ and
}I_{k}(s)=G_{k}(s)\zeta(s+2)^{-(2^{k}-k-1)}$

both have convergent Dirichlet series if $\Re(s)>-1-\frac{1}{2(k-1)}$. By
Selberg-Delange method [Te, Section 5.5, Theorem 5] or Tauberian theorem [MV,
Theorem 5.11], we have (9) for

$c_{k}=\frac{H_{k}(-1)}{(2^{k}-k-1)!}\textrm{ and
}d_{k}=\frac{I_{k}(-1)}{(2^{k}-k-1)!}.$

We have

$H_{k}(-1)=T_{k}\prod_{p\in\mathcal{P}}\left(1+\frac{1}{1+(k-1)/p}\sum_{e=1}^{\infty}\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\
{x_{i}\geq
0}\end{subarray}}\left(\frac{k-i_{1}(\mathbf{x})}{p^{x_{i_{1}}}}+\frac{i_{1}(\mathbf{x})}{p^{x_{i_{1}}+1}}\right)\right)\left(1-\frac{1}{p}\right)^{2^{k}-k-1}$

and

$I_{k}(-1)=\prod_{p\in\mathcal{P}}\left(1+\sum_{e=1}^{\infty}\sum_{\begin{subarray}{c}{x_{1}+\cdots+x_{k-1}=e}\\\
{x_{i}\geq
0}\end{subarray}}\left(\frac{k-i_{1}(\mathbf{x})}{p^{x_{i_{1}}}}+\frac{i_{1}(\mathbf{x})}{p^{x_{i_{1}}+1}}\right)\right)\left(1-\frac{1}{p}\right)^{2^{k}-k-1}.$

Clearly, $H_{k}(-1)<I_{k}(-1)$ and

$H_{k}(-1)\geq
T_{k}\prod_{p\in\mathcal{P}}\left(1+\frac{2^{k}-k-1}{p+k-1}\right)\left(1-\frac{1}{p}\right)^{2^{k}-k-1}.$

Therefore, $0<c_{k}<d_{k}$. ∎

The values of $n\in\mathbb{N}$ in
$\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{X_{1}^{(x)}\cdots
X_{k}^{(x)}}=\frac{1}{n}$ are within $1\leq n\leq x^{k-1}$. Usually the lcm is
large and $n$ is small, but the large values of $n$ around $x^{k-1}$ require
careful control. These large values contribute to a large error term
especially when $n>x$ and $-1\leq r\leq 1$. In this regard, we would like to
have uniform upper bounds in the direction of Lemma 4.1 and 4.2. The upper
bounds will be useful in the proof of Theorem 1.2 and 1.3. To this end, we
modify the proof of Lemma 4.1.

######  Lemma 4.4.

Let $k\geq 2$. Uniformly for $n\in\mathbb{N}$ and $x\geq 2$, we have

$P_{x}^{(1)}(n)\leq g_{k}(n)$ (10)

###### Proof.

In the proof of Lemma 4.1, we drop the coprimality conditions and trivially
bound it by the number of tuples $(v_{1},\ldots,v_{k})$ in $\prod_{i\leq
k}\left[1,\frac{x}{a_{i}}\right]$. That is

$\prod_{i\leq
k}\left\lfloor\frac{x}{a_{i}}\right\rfloor\leq\frac{x^{k}}{a_{1}\cdots
a_{k}}.$

Then we sum over all $M\in B_{n}$ to obtain the result. ∎

We also have similar upper bounds for weighted sums.

######  Lemma 4.5.

Uniformly for $x\geq 2$ and $n\in\mathbb{N}$, we have

$P_{x}^{(2)}(n)\leq g_{k}(n)\textrm{ if }r\geq 0.$ (11)

On the other hand, if $-1<r<0$,

$P_{x}^{(2)}(n)\leq\frac{1}{(r+1)^{k}}\ g_{k}(n).$ (12)

###### Proof.

In the proof of Lemma 4.1, we drop the coprimality conditions and trivially
bound it by the weighted sum of tuples $(v_{1},\ldots,v_{k})$ in $\prod_{i\leq
k}\left[1,\frac{x}{a_{i}}\right]$. If $r\geq 0$,

$\sum_{\forall{i\leq k},v_{i}\leq
x/a_{i}}\left(\frac{v_{1}}{x/a_{1}}\right)^{r}\cdots\left(\frac{v_{k}}{x/a_{k}}\right)^{r}\leq\prod_{i\leq
k}\left\lfloor\frac{x}{a_{i}}\right\rfloor\leq\frac{x^{k}}{a_{1}\cdots
a_{k}}.$

In case $-1<r<0$, the function $s\mapsto s^{r}$ is decreasing, hence

$\sum_{\forall{i\leq k},v_{i}\leq
x/a_{i}}\left(\frac{v_{1}}{x/a_{1}}\right)^{r}\cdots\left(\frac{v_{k}}{x/a_{k}}\right)^{r}\leq\frac{x^{k}}{a_{1}\cdots
a_{k}}\left(\int_{0}^{1}s^{r}ds\right)^{k}=\frac{x^{k}}{a_{1}\cdots
a_{k}}\frac{1}{(r+1)^{k}}.$

Then we sum over all $M\in B_{n}$ to obtain the result. ∎

##  5 Distribution of lcm - proof of Theorem 1.1

We have the equivalence of events

$\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{x^{k}}>t\ \Longleftrightarrow\
\exists{n\in\mathbb{N}},\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{X_{1}^{(x)}\cdots
X_{k}^{(x)}}=\frac{1}{n}\textrm{ and }\frac{X_{1}^{(x)}\cdots
X_{k}^{(x)}}{x^{k}}>nt.$

Since the event

$\frac{X_{1}^{(x)}\cdots X_{k}^{(x)}}{x^{k}}>nt$

is null whenever $nt>1$, we may write

$\textbf{P}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{x^{k}}>t\right)=\sum_{n\leq\frac{1}{t}}\textbf{P}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}{X_{1}^{(x)}\cdots
X_{k}^{(x)}}=\frac{1}{n}\textrm{ and }\frac{X_{1}^{(x)}\cdots
X_{k}^{(x)}}{x^{k}}>nt\right).$

By Lemma 4.2 (7), the sum on the right-hand side is

$\displaystyle\sum_{n\leq\frac{1}{t}}$
$\displaystyle\left((1-\Omega_{k}(nt))p_{k}(n)+O\left(\tau_{k-1}(n)(2k)^{\omega(n)}x^{-1}\log^{k-1}x\right)\right)$
$\displaystyle=\sum_{n\leq\frac{1}{t}}(1-\Omega_{k}(nt))p_{k}(n)+O_{t}(x^{-1}\log^{k-1}x)$
$\displaystyle=\sum_{n\leq\frac{1}{t}}\int_{nt}^{1}\frac{(-\log
z)^{k-1}}{(k-1)!}dz\cdot p_{k}(n)+O_{t}(x^{-1}\log^{k-1}x).$

This completes the proof of Theorem 1.1.

##  6 Moments of lcm - proof of Theorem 1.2

Let $1\leq n\leq x^{k-1}$ be an integer and $r>-1$ be a real number. we have

$\textbf{E}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]^{r}}{(X_{1}^{(x)}\cdots
X_{k}^{(x)})^{r}}\right)=\sum_{n\leq x^{k-1}}n^{-r}P_{x}^{(1)}(n)\textrm{ and
}$
$\textbf{E}\left(\frac{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]^{r}}{x^{kr}}\right)=\sum_{n\leq
x^{k-1}}n^{-r}P_{x}^{(2)}(n).$

Suppose that $r>1$. By Lemma 4.3, 4.4, and 4.5, we have

$\sum_{x<n\leq x^{k-1}}n^{-r}P_{x}^{(j)}(n)\ll\sum_{x<n\leq
x^{k-1}}n^{-r}g_{k}(n)\leq\frac{1}{x^{r+1}}\sum_{n\leq
x^{k-1}}ng_{k}(n)\ll\frac{x^{\epsilon}}{x^{r+1}}\textrm{ for }j=1,2.$

Also, $\sum_{n=1}^{\infty}n^{-r}p_{k}(n)$ is convergent and

$\sum_{n>x}n^{-r}p_{k}(n)\ll x^{-(r+1)+\epsilon}.$

By Lemma 4.1, 4.2, and the convergence of
$\sum_{n=1}^{\infty}n^{-r}\tau_{k-1}(n)(2k)^{\omega(n)}$, we have the result
of Theorem 1.2 for $r>1$.

Suppose that $-1<r\leq 1$. Again by Lemma 4.3, 4.4, and 4.5, we have

$\sum_{\sqrt{x}<n\leq x^{k-1}}n^{-r}P_{x}^{(j)}(n)\ll
x^{-\frac{r+1}{2}}\sum_{n\leq x^{k-1}}ng_{k}(n)\ll
x^{-\frac{r+1}{2}}\log^{2^{k}-k-1}x\textrm{ for }j=1,2.$

Also, $\sum_{n=1}^{\infty}n^{-r}p_{k}(n)$ is convergent and

$\sum_{n>\sqrt{x}}n^{-r}p_{k}(n)\ll x^{-\frac{r+1}{2}}\log^{2^{k}-k-1}x.$

The sum of the error terms of Lemma 4.1 and 4.2 over $n\leq\sqrt{x}$ is

$\sum_{n\leq\sqrt{x}}n^{-r}\tau_{k-1}(n)(2k)^{\omega(n)}x^{-1}\log^{k-1}x\ll
x^{\frac{1-r}{2}-1}\log^{2k^{2}-2k-1+k-1}x=x^{-\frac{r+1}{2}}\log^{2k^{2}-k-2}x$

and the extra error term in case $-1<r<0$ contributes

$\sum_{n\leq\sqrt{x}}n^{-r}q_{k}(n)x^{-(r+1)}.$

If $-1<r<0$, the Dirichlet series $\sum n^{-s}q_{k}(n)$ absolutely convergent
on $\Re s>r$. Thus, we have

$\sum_{n\leq\sqrt{x}}n^{-r}q_{k}(n)x^{-(r+1)}\ll\sum_{n\leq\sqrt{x}}n^{-r}\frac{x^{\frac{\epsilon}{2}}}{n^{\epsilon}}q_{k}(n)x^{-(r+1)}\ll
x^{-(r+1)+\epsilon}$

which is $\ll x^{-\frac{r+1}{2}}\log^{2^{k}-k-1}x$. Therefore, we have the
result of Theorem 1.2 with the error
$x^{-\frac{r+1}{2}}\log^{\max(2^{k}-k-1,2k^{2}-k-2)}x$.

##  7 Inverse moment of lcm - proof of Theorem 1.3

We begin with

$\textbf{E}\left(\frac{X_{1}^{(x)}\cdots
X_{k}^{(x)}}{[X_{1}^{(x)},\ldots,X_{k}^{(x)}]}\right)=\frac{1}{x^{k}}\sum_{n_{1},\ldots,n_{k}\leq
x}\frac{n_{1}\cdots n_{k}}{[n_{1},\ldots,n_{k}]}=\sum_{n\leq
x^{k-1}}nP_{x}^{(1)}(n).$

For the lower bound, we add the terms up to $x^{1/2-\delta}$ for $\delta>0$.
Then

$\sum_{n\leq x^{1/2-\delta}}nP_{x}^{(1)}(n)=\sum_{n\leq
x^{1/2-\delta}}np_{k}(n)+O\left(x^{-1}\log^{k-1}x\sum_{n\leq
x^{1/2-\delta}}n\tau_{k-1}(n)(2k)^{\omega(n)}\right).$

By Lemma 4.3,

$\sum_{n\leq x^{1/2-\delta}}np_{k}(n)\sim
c_{k}\log^{2^{k}-k-1}(x^{1/2-\delta})=c_{k}\left(\frac{1}{2}-\delta\right)^{2^{k}-k-1}\log^{2^{k}-k-1}x.$

The error term is $O(x^{-2\delta+\epsilon})$ for any $\epsilon<2\delta$ and it
is negligible. Thus, letting $\delta\rightarrow 0$, we obtain

$\liminf_{x\rightarrow\infty}\frac{1}{x^{k}\log^{2^{k}-k-1}x}\sum_{n_{1},\ldots,n_{k}\leq
x}\frac{n_{1}\cdots
n_{k}}{[n_{1},\ldots,n_{k}]}\geq\frac{c_{k}}{2^{2^{k}-k-1}}.$

For the upper bound, we apply Lemma 4.4. Then we have

$\sum_{n\leq x^{k-1}}nP_{x}^{(1)}(n)\leq\sum_{n\leq x^{k-1}}ng_{k}(n).$

Thus, by Lemma 4.3, we have

$\sum_{n\leq x^{k-1}}ng_{k}(n)\sim
d_{k}\log^{2^{k}-k-1}(x^{k-1})=d_{k}(k-1)^{2^{k}-k-1}\log^{2^{k}-k-1}x.$

Hence, we obtain

$\limsup_{x\rightarrow\infty}\frac{1}{x^{k}\log^{2^{k}-k-1}x}\sum_{n_{1},\ldots,n_{k}\leq
x}\frac{n_{1}\cdots n_{k}}{[n_{1},\ldots,n_{k}]}\leq d_{k}(k-1)^{2^{k}-k-1}.$

Acknowledgment.

The author thanks the referee for pointing out a mistake in the proof of Lemma
2.1 from the initial submission of this paper. This led to the author to
realize the presence of the extra error term in case $-1<r<0$.

## References

  * [BMR] A. Bostan, A. Marynych, K. Raschel, _On the least common multiple of several random integers_ , J. Number Theory, 204 (2019), pp. 113-133.
  * [DE] P. Diaconis, P. Erdős, _On the distribution of the greatest common divisor_ , A Festschrift for Herman Rubin Inst. of Math. Stat. Lecture Notes - Monograph Series, 45 (2004), pp. 56-61.
  * [D] H. Delange, _On the use of the method of moments for the study of additive function_ , J. Number Theory, 39 (1991), pp. 144-161.
  * [EST] D. Essouabri, C. Salinas Zavala, L. Tóth, _Mean values of multivariable multiplicative functions and applications to the average number of cyclic subgroups and multivariable averages associated with the LCM function_ , J. Number Theory, in press, available at https://www.sciencedirect.com/science/article/pii/S0022314X2100281X
  * [FF1] J. Fernández, P. Fernández, _On the probability distribution of the gcd and lcm of $r$-tuples of integers_, available at https://arxiv.org/abs/1305.0536
  * [FF2] J. Fernández, P. Fernández, _Equidistribution and coprimality_ , available at https://arxiv.org/abs/1310.3802
  * [FF3] J. Fernández, P. Fernández, _Divisibility properties of random sample of integers_ , RASCAM 115 26(2021).
  * [H1] J. Hu, _The probability that random positive integers are $k$-wise relatively prime_, Int. J. Number Theory, 9. 5(2013), pp. 1263-1271.
  * [H2] J. Hu, _Pairwise relative primality of positive integers_ , available at https://arxiv.org/abs/1406.3113
  * [HT] T. Hilberdink, L. Tóth, _On the average value of the least common multiple of $k$ positive integers_, J. Number Theory, 169 (2016), pp. 327-341.
  * [HLT] T. Hilberdink, F. Luca, L. Tóth, _On certain sums concerning the gcd’s and lcm’s of $k$ positive integers_, Int. J. Number Theory, 16. no. 1(2020), pp. 77-90.
  * [K] S. Kim, _On the reciprocal sum of lcm of $k$-tuples_, Res. Number Theory 8 44(2022).
  * [MV] H. Montgomery, R. Vaughan, _Multiplicative Number Theory I. Classical Theory_ , Cambridge University Press 2007.
  * [RH] J. Reyna, R. Heyman, _Counting tuples restricted by pairwise coprimality conditions_ , J. Integer. Seq, 18 (2015), Article 15.10.4.
  * [Te] G. Tenenbaum, _Introduction to analytic and probabilistic number theory_ , Cabridge University Press 1995.
  * [To] L. Tóth, _The probability that $k$ positive integers are pairwise relatively prime_, Fibonacci Quart. 40 (2002), pp. 13-18.