login
Floor of Sum_{p prime <= n} (fractional part of n/p).
1

%I #9 Feb 06 2014 11:37:21

%S 0,0,0,0,1,0,1,1,1,0,1,1,2,1,1,1,2,2,3,3,2,2,3,2,3,2,3,2,4,3,4,5,4,4,

%T 3,3,4,4,4,3,5,3,5,5,4,4,6,5,6,6,5,5,7,6,6,6,5,5,7,5,7,7,6,7,7,6,7,7,

%U 7,6,7,7,9,8,8,8,8,7,8,8,9,9,10,9,9,9,8,8,10,9,9,8,8,8,8,8,9,9,9,9,11,9,11

%N Floor of Sum_{p prime <= n} (fractional part of n/p).

%e a(5) = [{5/2}+{5/3}+{5/5}] = [1/2 + 2/3 + 0] = 1.

%e a(6) = [{6/2}+{6/3}+{6/5}] = [0 + 0 + 1/5] = 0.

%t f[n_] := Floor[Plus @@ FractionalPart[n / Table[Prime[i], {i, PrimePi[ n]}]]]; Table[ f[n], {n, 103}]

%o (PARI) a(n) = {s = 0; forprime(p = 2, n, s+= frac(n/p);); floor(s);} \\ _Michel Marcus_, Feb 05 2014

%K nonn

%O 1,13

%A _Carlos Alves_, Feb 08 2005

%E More terms from _Robert G. Wilson v_, Feb 11 2005

%E Offset corrected by _Michel Marcus_, Feb 05 2014