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.

This page as a plain text file.
%I A384792 #35 Jul 04 2025 01:20:06
%S A384792 1,11,21,121,221,1121,1221,11121,11221,111221,211221,1211221,2211221,
%T A384792 11211221,12211221,111211221,112211221,1112211221,2112211221,
%U A384792 12112211221,22112211221,112112211221,122112211221,1112112211221
%N A384792 Smallest number with a n-character traditional Japanese notation.
%C A384792 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.
%C A384792 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.
%C A384792 Any other number is formed by combining those characters. For instance, 121 is 百二十一 ('one hundred two ten one').
%C A384792 Characters representing powers of 4 are always preceded by a digit. For instance, 10,001 is 一 万 一 (and not 万 一).
%C A384792 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.
%C A384792 The traditional character for zero (零) is excluded since its use is limited solely to denoting the number zero.
%C A384792 a(n) is increasing monotonically.
%C A384792 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.
%C A384792 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.
%D A384792 Yoshida, Mitsuyoshi. Jinkōki. 1627.
%H A384792 Renaud Gaudron, <a href="/A384792/b384792.txt">Table of n, a(n) for n = 1..103</a>
%H A384792 Wikipedia, <a href="https://en.wikipedia.org/wiki/Japanese_numerals">Japanese numerals</a>
%F A384792 (By construction, valid for n<= 103, corresponding to a(n) < 10^52)
%F A384792 Option 1: Digit pattern
%F A384792 For p>=0,
%F A384792 a(8*p+1) is a '1', followed by '1221' p times.
%F A384792 a(8*p+2) is a '11', followed by '1221' p times.
%F A384792 a(8*p+3) is a '21', followed by '1221' p times.
%F A384792 a(8*p+4) is a '121', followed by '1221' p times.
%F A384792 a(8*p+5) is a '221', followed by '1221' p times.
%F A384792 a(8*p+6) is a '1121', followed by '1221' p times.
%F A384792 a(8*p+7) is a '1221' p+1 times.
%F A384792 a(8*p+8) is a '11121', followed by '1221' p times.
%F A384792 Option 2: Closed form
%F A384792 For p>=0,
%F A384792 a(8*p+1) = (34/303)*10^(4*p+1)-37/303
%F A384792 a(8*p+2) = (337/303)*10^(4*p+1)-37/303
%F A384792 a(8*p+3) = (64/303)*10^(4*p+2)-37/303
%F A384792 a(8*p+4) = (367/303)*10^(4*p+2)-37/303
%F A384792 a(8*p+5) = (67/303)*10^(4*p+3)-37/303
%F A384792 a(8*p+6) = (3397/303)*10^(4*p+2)-37/303
%F A384792 a(8*p+7) = (37/303)*10^(4*(p+1))-37/303
%F A384792 a(8*p+8) = (33697/30300)*10^(4*(p+1))-37/303
%e A384792 Since we're excluding zero, the smallest 1-character number is 1 (一), so a(1)=1.
%e A384792 Numbers from 1 to 10 use only one character. The smallest number requiring two characters is 11 (十一), making a(2)=11.
%e A384792 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.
%e A384792 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.
%e A384792 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.
%e A384792 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.
%e A384792 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.
%o A384792 (Python)
%o A384792 # Note: Valid for n <= 103, corresponding to a(n) < 10^52
%o A384792 def a(n):
%o A384792     return [33697,34000,33700,64000,36700,67000,33970,37000][n&7]*10**(n>>1) //30300
%K A384792 nonn,easy,fini,full
%O A384792 1,2
%A A384792 _Renaud Gaudron_, Jun 10 2025