%I #7 Mar 14 2015 18:08:40
%S 0,5,9,7,2,31,28,8,9,1,45,38,54,61,84,13,72,85,81,5,92,94,99,131,4,
%T 111,90,123,126,87,108,11,48,146,157,240,108,164,115,7,144,184,180,
%U 191,88,200,207,142,204,2,217,228,252,247,243,249,251,253,261,349,270,217,246
%N Sum of the first n digits to the right of the decimal expansion of 1/n.
%C First occurrence of k or -1 if not present: 1, 10, 5, -1, 25, 2, -1, 4, 8, 3, -1, 32, -1, 16, -1, -1, -1, -1, -1, 64, -1, -1, -1, 128, -1, 256, ..., . - _Robert G. Wilson v_, Aug 17 2006
%e a(2)=5 because 1/2 = 0.50 and 5 + 0 = 5.
%e a(3)=9 because 1/3 = 0.3333... and 3 + 3 + 3 = 9.
%e a(7)=28 because 1/7 = 0.14285714285714... and 1 + 4 + 2 + 8 + 5 + 7 + 1 = 28.
%t f[n_] := If[n == 1, 0, Plus @@ IntegerDigits[Floor[10^n/n]]]; Array[f, 63] (* _Robert G. Wilson v_, Aug 17 2006 *)
%K nonn,base
%O 1,2
%A _Gil Broussard_, Aug 09 2006
|