login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A073700 a(1) = 1, a(n) = Floor[(Sum of composite numbers up to n)/(Sum of primes up to n)]. 0

%I #11 Dec 05 2013 19:55:31

%S 1,0,0,0,0,1,0,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,2,2,2,3,2,2,2,2,2,2,

%T 2,3,2,2,2,3,2,2,2,2,2,2,2,2,2,2,3,3,2,2,3,3,3,3,3,3,2,2,3,3,3,3,3,3,

%U 3,3,2,3,2,2,3,3,3,3,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3

%N a(1) = 1, a(n) = Floor[(Sum of composite numbers up to n)/(Sum of primes up to n)].

%C Though the sequence is not monotonically increasing the average value increases and a derived sequence could be the smallest value of k for which a(k) = n.

%C Note 1 is neither composite nor prime.

%e a(10) = Floor[ {4+6+8+9+10}/{2+3+5+7)] =2.

%p a := 0:b := 0:for i from 2 to 300 do if isprime(i) then a := a+i: else b := b+i:fi: c[i] := floor(b/a):od:c[1] := 1:seq(c[j],j=1..300);

%t Module[{nn=110,pr,comp},pr=Prime[Range[PrimePi[nn]]];comp=Complement[Range[ 2,nn], pr]; Join[{1}, Table[Floor[Total[Select[comp,#<=n&]]/Total[Select[pr,#<=n&]]],{n,2,nn}]]] (* _Harvey P. Dale_, Feb 22 2013 *)

%t Join[{1}, Table[t1 = Select[x = Range[n], PrimeQ]; Floor[Divide @@ Plus @@@ {Rest[Complement[x, t1]], t1}], {n, 2, 105}]] (* _Jayanta Basu_, Jul 07 2013 *)

%K nonn

%O 1,10

%A _Amarnath Murthy_, Aug 12 2002

%E More terms from _Sascha Kurz_, Aug 15 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 06:57 EDT 2024. Contains 371265 sequences. (Running on oeis4.)