A187202 The bottom entry in the difference table of the divisors of n.
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, -3, 28, 50, 30, 1, 8, -12, 28, -11, 36, -14, 8, -66, 40, 104, 42, 13, 24, -18, 46, -103, 36, -16, 8, 21, 52, 88, 36, 48, 8, -24, 58, -667, 60, -26, -8, 1, 40, 72
Offset: 1
Examples
a(18) = 12 because the divisors of 18 are 1, 2, 3, 6, 9, 18, and the difference triangle of the divisors is: 1 . 2 . 3 . 6 . 9 . 18 . 1 . 1 . 3 . 3 . 9 . . 0 . 2 . 0 . 6 . . . 2 .-2 . 6 . . . .-4 . 8 . . . . . 12 with bottom entry a(18) = 12. Note that A187203(18) = 4.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a187202 = head . head . dropWhile ((> 1) . length) . iterate diff . divs where divs n = filter ((== 0) . mod n) [1..n] diff xs = zipWith (-) (tail xs) xs -- Reinhard Zumkeller, Aug 02 2011
-
Maple
f:=proc(n) local k,d,lis; lis:=divisors(n); d:=nops(lis); add( (-1)^k*binomial(d-1,k)*lis[d-k], k=0..d-1); end; [seq(f(n),n=1..100)]; # N. J. A. Sloane, May 01 2016
-
Mathematica
Table[d = Divisors[n]; Differences[d, Length[d] - 1][[1]], {n, 100}] (* T. D. Noe, Aug 01 2011 *)
-
PARI
A187202(n)={ for(i=2,#n=divisors(n), n=vecextract(n,"^1")-vecextract(n,"^-1")); n[1]} \\ M. F. Hasler, Aug 01 2011
Formula
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
a(2^k) = 1.
Extensions
Edited by N. J. A. Sloane, May 01 2016
Comments