# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a351855 Showing 1-1 of 1 %I A351855 #31 Apr 05 2022 17:06:35 %S A351855 5,64,506,64325,268723,480129,6282620,64548862,9657523883,13480852825, %T A351855 29766135708,105223301080,519861666225,851245744041,1378216791896, %U A351855 581522966976875,583298551668358,885441628670251,1651966084813205,16868988672306046,17170433482837259 %N A351855 Partial sums of nonsquares that are partial sums of nonprimes. %H A351855 Chai Wah Wu, Table of n, a(n) for n = 1..26 %e A351855 a(2) = 64 is a term because 64 = 1+4+6+8+9+10+12+14 = 2+3+5+6+7+8+10+11+12 is the sum of the first 8 nonprimes and the sum of the first 9 nonsquares. %p A351855 i:= 0: j:= 0: s:= 0: t:= 0: %p A351855 R:= NULL: count:= 0: %p A351855 while count < 13 do %p A351855 if s <= t then %p A351855 i:= i+1; %p A351855 if not issqr(i) then %p A351855 s:= s+i; %p A351855 if s=t then R:= R,s; count:= count+1 fi; %p A351855 fi %p A351855 else %p A351855 j:= j+1; %p A351855 if not isprime(j) then %p A351855 t:= t+j; %p A351855 if s=t then R:= R,t; count:= count+1 fi; %p A351855 fi %p A351855 fi %p A351855 od: %p A351855 R; %o A351855 (Python) %o A351855 from itertools import islice %o A351855 from sympy import nextprime %o A351855 def A351855_gen(): # generator of terms %o A351855 c, k, ks, m, p, q = 0, 1, 2, 1, 4, 5 %o A351855 while True: %o A351855 for n in range(ks,ks+2*k): %o A351855 c += n %o A351855 if c == m: %o A351855 yield c %o A351855 else: %o A351855 while c > m: %o A351855 m += p %o A351855 p += 1 %o A351855 if p == q: %o A351855 q = nextprime(q) %o A351855 p += 1 %o A351855 ks += 2*k+1 %o A351855 k += 1 %o A351855 A351855_list = list(islice(A351855_gen(),20)) # _Chai Wah Wu_, Apr 04 2022 %Y A351855 Intersection of A051349 and A086849. %K A351855 nonn %O A351855 1,1 %A A351855 _J. M. Bergot_ and _Robert Israel_, Mar 31 2022 %E A351855 a(20)-a(21) from _Jon E. Schoenfield_, Mar 31 2022 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE