%I #55 Jan 09 2017 02:55:14
%S 1,1,2,1,4,2,6,1,4,0,10,1,12,-2,8,1,16,12,18,-11,8,-6,22,-12,16,-8,8,
%T -3,28,50,30,1,8,-12,28,-11,36,-14,8,-66,40,104,42,13,24,-18,46,-103,
%U 36,-16,8,21,52,88,36,48,8,-24,58,-667,60,-26,-8,1,40,72
%N The bottom entry in the difference table of the divisors of n.
%C Note that if n is prime then a(n) = n - 1.
%C Note that if n is a power of 2 then a(n) = 1.
%C a(A193671(n)) > 0; a(A187204(n)) = 0; a(A193672(n)) < 0. [_Reinhard Zumkeller_, Aug 02 2011]
%C First differs from A187203 at a(14). - _Omar E. Pol_, May 14 2016
%C From _David A. Corneth_, May 20 2016: (Start)
%C The bottom of the difference table of the divisors of n can be expressed in terms of the divisors of n and use of Pascal's triangle. Suppose a, b, c, d and e are the divisors of n. Then the difference table is as follows (rotated for ease of reading):
%C a
%C . . b-a
%C b . . . . c-2b+a
%C . . c-b . . . . . d-3c+3b-a
%C c . . . . d-2c+b . . . . . . e-4d+6c-4b+a
%C . . d-c . . . . . e-3d+3c-b
%C d . . . . e-2d+c
%C . . e-d
%C e
%C From here we can see Pascal's triangle occurring. Induction can be used to show that it's the case in general.
%C (End)
%H T. D. Noe, <a href="/A187202/b187202.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = Sum_{k=0..d-1} (-1)^k*binomial(d-1,k)*D[d-k], where D is a sorted list of the d = A000005(n) divisors of n. - _N. J. A. Sloane_, May 01 2016
%F a(2^k) = 1.
%e a(18) = 12 because the divisors of 18 are 1, 2, 3, 6, 9, 18, and the difference triangle of the divisors is:
%e 1 . 2 . 3 . 6 . 9 . 18
%e . 1 . 1 . 3 . 3 . 9
%e . . 0 . 2 . 0 . 6
%e . . . 2 .-2 . 6
%e . . . .-4 . 8
%e . . . . . 12
%e with bottom entry a(18) = 12.
%e Note that A187203(18) = 4.
%p f:=proc(n) local k,d,lis; lis:=divisors(n); d:=nops(lis);
%p add( (-1)^k*binomial(d-1,k)*lis[d-k], k=0..d-1); end;
%p [seq(f(n),n=1..100)]; # _N. J. A. Sloane_, May 01 2016
%t Table[d = Divisors[n]; Differences[d, Length[d] - 1][[1]], {n, 100}] (* _T. D. Noe_, Aug 01 2011 *)
%o (PARI) A187202(n)={ for(i=2,#n=divisors(n), n=vecextract(n,"^1")-vecextract(n,"^-1")); n[1]} \\ _M. F. Hasler_, Aug 01 2011
%o (Haskell)
%o a187202 = head . head . dropWhile ((> 1) . length) . iterate diff . divs
%o where divs n = filter ((== 0) . mod n) [1..n]
%o diff xs = zipWith (-) (tail xs) xs
%o -- _Reinhard Zumkeller_, Aug 02 2011
%Y Cf. A000005, A007318, A027750, A187203, A273102.
%K easy,sign
%O 1,3
%A _Omar E. Pol_, Aug 01 2011
%E Edited by _N. J. A. Sloane_, May 01 2016