cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A384792 Smallest number with a n-character traditional Japanese notation.

Original entry on oeis.org

1, 11, 21, 121, 221, 1121, 1221, 11121, 11221, 111221, 211221, 1211221, 2211221, 11211221, 12211221, 111211221, 112211221, 1112211221, 2112211221, 12112211221, 22112211221, 112112211221, 122112211221, 1112112211221
Offset: 1

Views

Author

Renaud Gaudron, Jun 10 2025

Keywords

Comments

The sequence is only well defined for a(n) < 10^52 (corresponding to n<=103), as various historical and modern sources propose different traditional Japanese notations for numbers above 10^52.
There are distinct traditional Japanese characters for digits (0-9) and for powers of ten (10, 100, 1000). For larger numbers, values are grouped by 'myriads' (10,000): For instance, 10,000 is 万 (man), 100,000,000 is 億 (oku), and 1,000,000,000,000 is 兆 (chō), and so on. Every power of 4 from 10^4 to 10^48 is represented with a single character.
Any other number is formed by combining those characters. For instance, 121 is 百二十一 ('one hundred two ten one').
Characters representing powers of 4 are always preceded by a digit. For instance, 10,001 is 一 万 一 (and not 万 一).
While there are multiple conventions for writing 1,000 (千, sen), we adhere to the convention where 千 is always preceded by a digit for the sake of consistency.
The traditional character for zero (零) is excluded since its use is limited solely to denoting the number zero.
a(n) is increasing monotonically.
a(n) can only contain digits 0, 1, or 2. Replacing any other digit with a 2 results in a smaller number with the same character count.
a(n) exhibits a modulo 8 cycle. This occurs because it takes 8 steps for each new group of four digits to reach the smallest four-digit number, 1221, which utilizes the maximum of seven characters in its traditional Japanese notation. The reason for this being an 8-step cycle, rather than a 7-step one, is due to the first step involving the 'demotion' of the previous 4-digit group's character count from seven (for 1221) to six (for 1121) as two new characters are simultaneously introduced for the subsequent number.

Examples

			Since we're excluding zero, the smallest 1-character number is 1 (一), so a(1)=1.
Numbers from 1 to 10 use only one character. The smallest number requiring two characters is 11 (十一), making a(2)=11.
Numbers from 12 to 19 also use two characters (ten + a character for 2-9), and 20 is also two characters (二十). The first number to require three characters is 21 (二十一), thus a(3)=21.
To introduce a fourth character, we must use 百 (100). While 100 itself only uses one character, combining it with the smallest 3-character number, a(3) (which is 21), creates the smallest 4-character number: 121 (百二十一). Therefore, a(4)=121.
To increase the character count further, we apply the same principle: we add a character in front of a(4). The smallest digit we can introduce is '二' (two). This yields 221 (二百二十一) as the smallest number with five characters. Therefore, a(5)=221.
The next available character to add is '千' (thousand), but in our convention, '一千' (one thousand) uses two characters. We prepend this to a(4) (the smallest 4-character number) to form 1121 (一千百二十一), which is the smallest 6-character number. Thus, a(6)=1121.
Following the same pattern, we add '一千' (one thousand) to the beginning of a(5) (the smallest 5-character number). This results in 1221 (一千二百二十一), which is the smallest number requiring seven characters. Therefore, a(7)=1221.
		

References

  • Yoshida, Mitsuyoshi. Jinkōki. 1627.

Programs

  • Python
    # Note: Valid for n <= 103, corresponding to a(n) < 10^52
    def a(n):
        return [33697,34000,33700,64000,36700,67000,33970,37000][n&7]*10**(n>>1) //30300

Formula

(By construction, valid for n<= 103, corresponding to a(n) < 10^52)
Option 1: Digit pattern
For p>=0,
a(8*p+1) is a '1', followed by '1221' p times.
a(8*p+2) is a '11', followed by '1221' p times.
a(8*p+3) is a '21', followed by '1221' p times.
a(8*p+4) is a '121', followed by '1221' p times.
a(8*p+5) is a '221', followed by '1221' p times.
a(8*p+6) is a '1121', followed by '1221' p times.
a(8*p+7) is a '1221' p+1 times.
a(8*p+8) is a '11121', followed by '1221' p times.
Option 2: Closed form
For p>=0,
a(8*p+1) = (34/303)*10^(4*p+1)-37/303
a(8*p+2) = (337/303)*10^(4*p+1)-37/303
a(8*p+3) = (64/303)*10^(4*p+2)-37/303
a(8*p+4) = (367/303)*10^(4*p+2)-37/303
a(8*p+5) = (67/303)*10^(4*p+3)-37/303
a(8*p+6) = (3397/303)*10^(4*p+2)-37/303
a(8*p+7) = (37/303)*10^(4*(p+1))-37/303
a(8*p+8) = (33697/30300)*10^(4*(p+1))-37/303