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 A285273 #37 Nov 09 2024 19:30:57 %S A285273 2,4,4,8,8,32,8,32,8,32,8,128,16,32,64,128,8,256,4,256,128,128,4,1024, %T A285273 64,128,32,512,64,8192,16,4096,64,128,256,2048,16,16,64,4096,32,16384, %U A285273 32,2048,512,128,8,8192,32,2048,256,1024,32,4096,512,8192,64,512,8 %N A285273 Number of integers, x, with n+1 digits, that have the property that there exists an integer k, with x <= k < 2*x, such that k/x = 1 + (x-10^n)/(10^n-1), i.e., the same digits appear in the denominator and in the recurring decimal. %C A285273 This was suggested by generalizing an exam question which asked "Jack typed a whole number into his calculator and divided by 154. The result was 1.545454545. What was his number?" %C A285273 It appears that a(n) is always a power of 2. %e A285273 The number 154 has the property that there exists an integer, 238, for which %e A285273 238/154 = 1 + 54/99 = 1.545454545... %e A285273 There are 4 three-digit values that give rise to a 2-digit recurring decimal: %e A285273 100/100.0 = 1.0000000000000000 %e A285273 208/144.0 = 1.4444444444444444... %e A285273 238/154.0 = 1.5454545454545454... %e A285273 394/198.0 = 1.9898989898989898... %e A285273 thus a(2) = 4. %e A285273 For n=3, a(3) = 8: %e A285273 10000/10000.0 = 1.0000000000000000 %e A285273 14938/12222.0 = 1.2222222222222222... %e A285273 16198/12727.0 = 1.2727272727272727... %e A285273 22348/14949.0 = 1.4949494949494949... %e A285273 22648/15049.0 = 1.5049504950495049... %e A285273 29830/17271.0 = 1.7271727172717271... %e A285273 31600/17776.0 = 1.7776777677767776... %e A285273 39994/19998.0 = 1.9998999899989998... %t A285273 a[n_] := Length@ List@ ToRules@ Reduce[k/x == 1 + (x-10^n)/(10^n-1) && 10^n <= x < 10^(n+1) && x <= k < 2 x, {k, x}, Integers]; Array[a, 20] (* for n<60, _Giovanni Resta_, Jun 30 2017 *) %o A285273 (Python) %o A285273 from math import sqrt %o A285273 def is_square(n): %o A285273 root = int(sqrt(n)) %o A285273 return root*root == n %o A285273 def find_sols(length): %o A285273 count = 0 %o A285273 k=10**length %o A285273 for n in range(k,4*k-2): %o A285273 discr= (2*k-1)*(2*k-1) - 4*(k*(k-1)-(k-1)*n) %o A285273 if is_square(discr): %o A285273 count+=1 %o A285273 b=(-(2*k-1)+sqrt(discr))/2 %o A285273 print(n, k+b, n/(k+b)) %o A285273 return count %o A285273 for i in range(8): %o A285273 print(find_sols(i)) %Y A285273 Cf. A288781, A288782. %K A285273 nonn,base %O A285273 1,1 %A A285273 _James Kilfiger_, Jun 14 2017 %E A285273 Definition corrected and a(11)-a(59) from _Giovanni Resta_, Jun 30 2017