Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #42 Jun 27 2017 15:36:24
%S 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 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 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 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 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 Chai Wah Wu, <a href="/A259981/b259981.txt">Table of n, a(n) for n = 1..1000</a>
%H R. P. Boas & N. J. A. Sloane, <a href="/A005381/a005381.pdf">Correspondence, 1974</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/AnomalousCancellation.html">Anomalous Cancellation</a>
%t 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 (Python)
%o from sympy import primepi
%o def A002808(n):
%o ....m = n
%o ....while m != primepi(m) + 1 + n:
%o ........m += 1
%o ....return m
%o def A259981(n):
%o ....b, c = A002808(n), 0
%o ....for x in range(1,b):
%o ........for y in range(1,b):
%o ............if x != y:
%o ................w = b*(x-y)
%o ................for z in range(1,b):
%o ....................if x != z:
%o ........................if z*w == y*(x-z):
%o ............................c += 1
%o ....return c # _Chai Wah Wu_, Jul 15 2015
%Y Cf. A002808, A005381, A144925, A259983.
%K nonn
%O 1,2
%A _N. J. A. Sloane_, Jul 12 2015, following a suggestion from R. P. Boas, May 19 1974
%E Typo in a(61) corrected by _Chai Wah Wu_, Jul 15 2015