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.

Showing 1-2 of 2 results.

A162733 Sum of remainders of the n-th composite mod k, for k=1,2,3,...,n.

Original entry on oeis.org

0, 0, 2, 2, 3, 2, 10, 15, 15, 19, 25, 34, 41, 40, 58, 67, 80, 79, 83, 101, 118, 131, 152, 132, 170, 191, 180, 193, 223, 234, 253, 254, 294, 300, 329, 334, 356, 393, 384, 417, 442, 433, 501, 522, 522, 567, 554, 609, 650, 645, 642, 725, 750, 761, 818, 805, 833, 873
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 13 2009

Keywords

Examples

			a(7)=10 because the 7th composite is 14 and its remainders modulo 1, 2, 3, 4, 5, 6, 7 are 0, 0, 2, 2, 4, 2, 0 respectively and 0 + 0 + 2 + 2 + 4 + 2 + 0 = 10.
		

Crossrefs

Programs

  • Maple
    A002808 := proc(n) local a; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) ; end if; end do; end if; end proc: A162733 := proc(n) local c; c := A002808(n) ; add(c mod k, k=1..n) ; end: seq(A162733(n),n=1..80) ; # R. J. Mathar, Aug 01 2009
  • Mathematica
    composite[n_] := FixedPoint[n + PrimePi[#] + 1 &, n + PrimePi[n] + 1];
    a[n_] := Total[Mod[composite[n], #]& /@ Range[n]];
    Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Jul 23 2024 *)
  • PARI
    n=3;for(k=1,100,n++;n+=isprime(n);print1(sum(i=1,k,n%i)",")) \\ Franklin T. Adams-Watters, Aug 06 2009

Extensions

Corrected and extended by R. J. Mathar and Franklin T. Adams-Watters, Aug 01 2009

A173683 Sum of n mod p, for p = 2, 3, 5, ..., smallest prime >= n.

Original entry on oeis.org

1, 0, 1, 5, 3, 7, 4, 14, 16, 14, 8, 20, 13, 24, 23, 28, 18, 38, 27, 48, 47, 43, 29, 57, 62, 57, 64, 65, 46, 76, 56, 97, 95, 88, 88, 95, 70, 99, 96, 102, 74, 117, 88, 133, 140, 130, 98, 156, 165, 174, 170, 171, 134, 199, 200, 208, 203, 189, 147, 214
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 25 2010

Keywords

Examples

			a(1) = 1 because 1 mod 2 = 1 where 2 = smallest prime >= 1.
		

Crossrefs

Programs

  • Maple
    a:= n-> add(n mod ithprime(i), i=1..numtheory[pi](nextprime(n-1))):
    seq(a(n), n=1..60);  # Alois P. Heinz, Nov 25 2010

Extensions

More terms from Alois P. Heinz, Nov 25 2010
Showing 1-2 of 2 results.