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.

A259981 Let b be the n-th composite number, A002808(n); a(n) is number of base-b digits x,y,z such that (xb+y)/(zb+x)=y/z.

This page as a plain text file.
%I A259981 #45 May 22 2025 10:21:43
%S A259981 1,2,2,2,4,4,2,6,7,4,4,10,6,6,6,4,6,10,6,4,8,6,6,21,2,6,18,6,4,18,10,
%T A259981 8,10,10,12,12,6,16,22,14,6,10,2,12,21,12,20,4,10,22,10,2,12,20,14,24,
%U A259981 8,24,8,10,28,6,6,18,10,28,16,10,6,6,30,4,24,37,6,6,46,14,10,6,18,24,6,18
%N A259981 Let b be the n-th composite number, A002808(n); a(n) is number of base-b digits x,y,z such that (xb+y)/(zb+x)=y/z.
%C A259981 R. P. Boas writes (slightly edited): The problem originated in the rather silly observation that 64/16 = 4/1 ("cancel" the 6's). I once asked what happens in base b, i.e., when is (xb+y)/(zb+x) = y/z? There are no nontrivial instances of the cancellation phenomenon when b is prime, so we restrict b to A002808; the sequence gives the number of instances of the phenomenon for each composite b. When b-1 is prime the only instances have x=b-1 and the number of them is the number of proper divisors of b (see A144925). A259983 is the subsequence of this sequence corresponding to bases b in A005381.
%H A259981 Chai Wah Wu, <a href="/A259981/b259981.txt">Table of n, a(n) for n = 1..1000</a>
%H A259981 R. P. Boas & N. J. A. Sloane, <a href="/A005381/a005381.pdf">Correspondence, 1974</a>
%H A259981 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/AnomalousCancellation.html">Anomalous Cancellation</a>
%t A259981 Table[Count[Flatten[Table[(x b + y) z == y (z b + x), {x, b}, {y, b}, {z, y - 1}], 2], True], {b, Select[Range[115], CompositeQ]}] (* _Eric W. Weisstein_, Oct 16 2015 *)
%o A259981 (Python)
%o A259981 from sympy import primepi
%o A259981 def A002808(n):
%o A259981     m = n
%o A259981     while m != primepi(m) + 1 + n:
%o A259981         m += 1
%o A259981     return m
%o A259981 def A259981(n):
%o A259981     b, c = A002808(n), 0
%o A259981     for x in range(1,b):
%o A259981         for y in range(1,b):
%o A259981             if x != y:
%o A259981                 w = b*(x-y)
%o A259981                 for z in range(1,b):
%o A259981                     if x != z:
%o A259981                         if z*w == y*(x-z):
%o A259981                             c += 1
%o A259981     return c # _Chai Wah Wu_, Jul 15 2015
%Y A259981 Cf. A002808, A005381, A144925, A259983.
%K A259981 nonn
%O A259981 1,2
%A A259981 _N. J. A. Sloane_, Jul 12 2015, following a suggestion from R. P. Boas, May 19 1974
%E A259981 Typo in a(61) corrected by _Chai Wah Wu_, Jul 15 2015