A179896 Sum of the numbers between k := n-th nonprime and 2k (like a jump in a Sieve of Eratosthenes).
0, 18, 45, 84, 108, 135, 198, 273, 315, 360, 459, 570, 630, 693, 828, 900, 975, 1053, 1134, 1305, 1488, 1584, 1683, 1785, 1890, 2109, 2223, 2340, 2583, 2838, 2970, 3105, 3384, 3528, 3675, 3825, 3978, 4293, 4455, 4620, 4788, 4959, 5310, 5673, 5859, 6048, 6240, 6435
Offset: 1
Examples
0(0) = 0, 1(2) = 0, 4(8) = 5,6,7 = 18, 6(12) = 7,8,9,10,11 = 45 and so on.
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..10000
Programs
-
Maple
ithnonprime := proc(n)local k: option remember: if(n=1)then return 1: else k := procname(n-1)+1: while true do if(not isprime(k))then return k fi: k:=k+1: od: fi: end: A179896 := proc(n)local k: k:=ithnonprime(n): return 3*k*(k-1)/2: end: seq(A179896(n),n=1..40); # Nathaniel Johnston, Apr 21 2011
-
Mathematica
f[n_] := Plus @@ Range[n + 1, 2 n - 1]; f /@ Select[ Range@ 64, ! PrimeQ@# &] (* Robert G. Wilson v, Sep 02 2010 *)
Formula
Extensions
More terms from Odimar Fabeny, Aug 11 2010
Offset adapted to A141468 and to match another 0 - R. J. Mathar, Sep 01 2010
Comments