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.

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

This page as a plain text file.
%I A162733 #11 Jul 23 2024 09:00:13
%S A162733 0,0,2,2,3,2,10,15,15,19,25,34,41,40,58,67,80,79,83,101,118,131,152,
%T A162733 132,170,191,180,193,223,234,253,254,294,300,329,334,356,393,384,417,
%U A162733 442,433,501,522,522,567,554,609,650,645,642,725,750,761,818,805,833,873
%N A162733 Sum of remainders of the n-th composite mod k, for k=1,2,3,...,n.
%e A162733 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.
%p A162733 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
%t A162733 composite[n_] := FixedPoint[n + PrimePi[#] + 1 &, n + PrimePi[n] + 1];
%t A162733 a[n_] := Total[Mod[composite[n], #]& /@ Range[n]];
%t A162733 Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, Jul 23 2024 *)
%o A162733 (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
%Y A162733 Cf. A002808, A099726.
%K A162733 nonn
%O A162733 1,3
%A A162733 _Juri-Stepan Gerasimov_, Jul 13 2009
%E A162733 Corrected and extended by _R. J. Mathar_ and _Franklin T. Adams-Watters_, Aug 01 2009