This article is a translation from https://qiita.com/kawasaki/items/bfa9f0edc32c132eff30

##

Corporate Number

“Corporate Number” or “Houjin-Bango” is a 13-digit enterprise identification number which is now commonly used in Japan. Each number is automatically generated by adding a check digit as a highest-order digit of 12-digit “Kaisha-Houjin-To-Bango” which is an older version of enterprise identification number.

I found an error of definition in the process of calculating the check digit according to the definition given by the Ministerial order 70 of MOF, 2014, Specification of Corporate Number.

##

False (current)

(Formula of check digit)

Article 2 The formula stipulated in paragraph 1, article 35, the cabinet order, is defined as

```
9 - \left( \sum_{n=1}^{12} P_n \times Q_n modulo\ 9 \right)
```

where

Pn is the n-th digit number of the base number stipulated in paragraph 1, article 35, the cabinet order, in which the first digit of the base number is defined as its lowest digit, and

Qn is 1 if n is an odd number and 2 if n is an even number.

##

True

(Formula of check digit)

Article 2 The formula stipulated in paragraph 1, article 35, the cabinet order, is defined as

```
9 - \left( \left( \sum_{n=1}^{12} P_n \times Q_n \right) modulo\ 9 \right)
```

where

Pn is the n-th digit number of the base number stipulated in paragraph 1, article 35, the cabinet order, in which the first digit of the base number is defined as its lowest digit, and

Qn is 1 if n is an odd number and 2 if n is an even number.

##

Explanation

The difference exists in the scope of parentheses.

In the current definition,

```
P_n \times Q_n modulo\ 9
```

is included in the summation and the formula generates a 2-digit number contradicting the definition in the higher Cabinet order. Supplemental documents by National Tax Agency (PDF) suggests that the content of the summation is Pn x Qn.