login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = A040976(n+1) - A006218(n).
7

%I #15 Jul 25 2024 04:42:47

%S 0,0,0,0,1,1,1,1,1,4,2,6,4,4,4,6,7,7,7,9,5,7,7,11,11,12,10,10,6,8,14,

%T 16,16,14,20,18,15,19,19,21,19,19,21,21,19,15,23,33,27,26,24,26,22,30,

%U 28,30,28,26,28,30,20,28,38,36,31,31,37,41,45,43,39,43,39,43,45,43,43,47,43,49,49

%N a(n) = A040976(n+1) - A006218(n).

%p A006218 := proc(n) add(floor(n/k),k=1..n) ; end:

%p A040976 := proc(n) ithprime(n)-2 ; end:

%p A161912 := proc(n) A040976(n+1)-A006218(n) ;end:

%p seq(A161912(n),n=0..120) ; # _R. J. Mathar_, Jul 01 2009

%o (PARI) first(n)=my(v=primes(n+1),s); v[1]-=s=2; forfactored(k=1,n, v[k[1]+1]-=s+=numdiv(k)); v \\ _Charles R Greathouse IV_, Nov 03 2021

%Y Cf. A000005, A001223, A006218, A040976, A161911.

%K easy,nonn,less

%O 0,10

%A _Omar E. Pol_, Jun 28 2009

%E Invalid formula deleted and sequence extended by _R. J. Mathar_, Jul 01 2009