OFFSET
1,2
COMMENTS
The values 4, 7, 10... (A016777 for n>1) are the values of floor( a(k)/ A018252(k) ) where k runs through the indices where A179879(k) mod A018252(k) != 0. - Odimar Fabeny.
Proof: a(k)/A018252(k) is 3*(A081252(k)-1)/2. This is a non-integer iff A018252(k) is even. Since the n-th even nonprime is 2*n+2, floor(3*(2*n+1)/2) = 3*n+1=a(n). - Robert Israel, Aug 27 2014
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
0(0) = 0, 1(2) = 0, 4(8) = 5,6,7 = 18, 6(12) = 7,8,9,10,11 = 45 and so on.
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 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Odimar Fabeny, Jul 31 2010
EXTENSIONS
More terms from Odimar Fabeny, Aug 11 2010
Offset adapted to A141468 and to match another 0 - R. J. Mathar, Sep 01 2010
STATUS
approved