cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Carlos Alves, Feb 08 2005

Keywords

Examples

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

Programs

  • Mathematica
    f[n_] := Floor[Plus @@ FractionalPart[n / Table[Prime[i], {i, PrimePi[ n]}]]]; Table[ f[n], {n, 103}]
  • PARI
    a(n) = {s = 0; forprime(p = 2, n, s+= frac(n/p);); floor(s);} \\ Michel Marcus, Feb 05 2014

Extensions

More terms from Robert G. Wilson v, Feb 11 2005
Offset corrected by Michel Marcus, Feb 05 2014