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.
%I A262115 #28 Feb 16 2025 08:33:27 %S A262115 0,0,1,0,1,0,2,1,2,0,2,1,0,3,2,4,1,2,0,5,1,1,1,2,5,1,4,2,8,5,7,1,6,3, %T A262115 1,8,6,10,3,5,1,11,2,2,2,4,9,2,7,4,14,9,12,2,10,5,2,13,10,16,5,8,2,17, %U A262115 3,3,3,6,13,3,10,6,20,13,17,3,14,7,3,18,14,22,7,11,3,23,4,4,4,8,17 %N A262115 Irregular triangle read by rows: row b (b >= 2) gives periodic part of digits of the base-b expansion of 1/7. %C A262115 The number of terms associated with a particular value of b are cyclical: 3, 5, 3, 5, 2, 1, 1, repeat. This is because the values are associated with b (mod 7), starting with 2 (mod 7). %C A262115 The expansion of 1/7 either terminates after one digit when b == 0 (mod 7) or is purely recurrent in all other cases of b (mod 7), since 7 is prime and must either divide or be coprime to b. %C A262115 The period for purely recurrent expansions of 1/7 must be a divisor of Euler's totient of 7 = 6, i.e., one of {1, 2, 3, 6}. %C A262115 b == 0 (mod 7): 1 (terminating) %C A262115 b == 1 (mod 7): 1 (purely recurrent) %C A262115 b == 2 (mod 7): 3 (purely recurrent) %C A262115 b == 3 (mod 7): 6 (purely recurrent) %C A262115 b == 4 (mod 7): 3 (purely recurrent) %C A262115 b == 5 (mod 7): 6 (purely recurrent) %C A262115 b == 6 (mod 7): 2 (purely recurrent) %C A262115 The expansion of 1/7 has a full-length period 6 when base b is a primitive root of p = 7. %C A262115 Digits of 1/7 for the following bases: %C A262115 2 0, 0, 1 %C A262115 3 0, 1, 0, 2, 1, 2 %C A262115 4 0, 2, 1 %C A262115 5 0, 3, 2, 4, 1, 2 %C A262115 6 0, 5 %C A262115 7* 1 %C A262115 8 1 %C A262115 9 1, 2, 5 %C A262115 10 1, 4, 2, 8, 5, 7 %C A262115 11 1, 6, 3 %C A262115 12 1, 8, 6, 10, 3, 5 %C A262115 13 1, 11 %C A262115 14* 2 %C A262115 15 2 %C A262115 16 2, 4, 9 %C A262115 17 2, 7, 4, 14, 9, 12 %C A262115 18 2, 10, 5 %C A262115 19 2, 13, 10, 16, 5, 8 %C A262115 20 2, 17 %C A262115 21* 3 %C A262115 ... %C A262115 Asterisks above denote terminating expansion; all other entries are digits of purely recurrent reptends. %C A262115 Each entry associated with base b with more than one term has a second term greater than the first except for b = 2, where the first two terms are 0, 0. %C A262115 Entries for b == 0 (mod 7) (i.e., integer multiples of 7) appear at 21, 43, 65, ..., every 22nd term thereafter. %D A262115 U. Dudley, Elementary Number Theory, 2nd ed., Dover, 2008, pp. 119-126. %D A262115 G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 6th ed., Oxford Univ. Press, 2008, pp. 138-148. %D A262115 Oystein Ore, Number Theory and Its History, Dover, 1988, pp. 311-325. %H A262115 Michael De Vlieger, <a href="/A262115/b262115.txt">Table of n, a(n) for n = 2..10000</a> %H A262115 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DecimalPeriod.html">Decimal Period</a>. %H A262115 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/RepeatingDecimal.html">Repeating Decimal</a>. %F A262115 Conjectures from _Colin Barker_, Oct 09 2015: (Start) %F A262115 a(n) = 2*a(n-22) - a(n-44) for n>44. %F A262115 G.f.: x^3*(x^39 +x^38 +x^37 +x^36 +2*x^35 +2*x^34 +2*x^33 +x^32 +x^31 +2*x^30 +x^29 +3*x^28 +3*x^27 +4*x^26 +2*x^25 +2*x^24 +x^23 +3*x^22 +2*x^21 +x^20 +x^19 +x^18 +5*x^17 +2*x^15 +x^14 +4*x^13 +2*x^12 +3*x^11 +x^9 +2*x^8 +2*x^6 +x^5 +2*x^4 +x^2 +1) / (x^44 -2*x^22 +1). %F A262115 (End) %F A262115 From _Robert Israel_, Dec 04 2015: (Start) %F A262115 To prove the recursion, note that if a(n) is the k'th digit in the base-b expansion of 1/7, then a(n+22) and a(n+44) are the corresponding digits in the base-(b+7) and base-(b+14) expansions. %F A262115 The one digit in the base-(7k) expansion of 1/7 is k. %F A262115 For each d from 1 to 6, one can show that the digits in the base-(7k+d) expansion of ((7k+d)^p - 1)/7 where p is the order of d mod 7, and thus the digits of 1/7, are linear expressions in k. %F A262115 Thus for d=3, these digits are [5k+2, 4k+1, 6k+2, 2k, 3k+1, k], since those are nonnegative integers < 7k+3 and (5k+2) + (4k+1)*(7k+3) + (6k+2)*(7k+3)^2 + (2k)*(7k+3)^3 + (3k+1)*(7k+3)^4 + k*(7k+3)^5 = ((7*k+3)^6 - 1)/7. %F A262115 The g.f. follows from the recursion. (End) %e A262115 For b = 8, 1/7 = .111..., contributing the term 1 to the sequence. %e A262115 For b = 9, 1/7 = .125125..., thus 1, 2, 5 are the next terms in the sequence. %e A262115 For b = 10, 1/7 = .142857142857..., thus 1, 4, 2, 8, 5, 7 are terms that follow in the sequence. %p A262115 F:= proc(N) # to get rows for bases 2 to N, flattened. %p A262115 local b, R, p, L; %p A262115 R:= NULL; %p A262115 for b from 2 to N do %p A262115 if b mod 7 = 0 then %p A262115 R:= R, b/7 %p A262115 else %p A262115 p:= numtheory:-order(b, 7); %p A262115 L:= convert((b^p-1)/7, base, b); %p A262115 if nops(L) < p then L:= [op(L), 0$ (p - nops(L))] fi; %p A262115 R:= R, op(ListTools:-Reverse(L)); %p A262115 fi %p A262115 od: %p A262115 R; %p A262115 end proc: %p A262115 F(100); # _Robert Israel_, Dec 04 2015 %t A262115 RotateLeft[Most@ #, Last@ #] &@ Flatten@ RealDigits[1/7, #] & /@ Range[2, 30] // Flatten (* _Michael De Vlieger_, Sep 11 2015 *) %Y A262115 Cf. A004526 Digits of expansions of 1/2. %Y A262115 Cf. A026741 Full reptends of 1/3. %Y A262115 Cf. A130845 Digits of expansions of 1/3 (eliding first 2 terms). %Y A262115 Cf. A262114 Digits of expansions of 1/5. %K A262115 nonn,base,tabf,easy %O A262115 2,7 %A A262115 _Michael De Vlieger_, Sep 11 2015