cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A171152 Partial sums of A118011.

This page as a plain text file.
%I A171152 #35 Jul 30 2022 19:37:05
%S A171152 3,9,17,28,41,56,74,94,116,140,167,196,227,260,295,333,373,415,459,
%T A171152 505,553,604,657,712,769,828,889,952,1018,1086,1156,1228,1302,1378,
%U A171152 1456,1536,1619,1704,1791,1880,1971,2064,2159,2256,2355,2457,2561,2667,2775,2885,2997,3111
%N A171152 Partial sums of A118011.
%F A171152 Set R = round(sqrt(2*n)), then a(n) = n^2+n+R*((6*n+1)-R^2)/6.
%e A171152 a(1) = 3;
%e A171152 a(2) = 3+6 = 9;
%e A171152 a(3) = 3+6+8 = 17;
%e A171152 a(4) = 3+6+8+11 = 28.
%o A171152 (PARI) vector(80, n, R = round(sqrt(2*n)); n^2+n+R*((6*n+1)-R^2)/6) \\ _Michel Marcus_, Apr 17 2015
%o A171152 (Python)
%o A171152 from math import isqrt
%o A171152 def A171152(n): return n*(n+1)+(r:=(m:=isqrt(k:=n<<1))+int((k-m*(m+1)<<2)>=1))*(3*k+1-r**2)//6 # _Chai Wah Wu_, Jul 30 2022
%Y A171152 Cf. A118011 (complement of the Connell sequence).
%K A171152 nonn
%O A171152 1,1
%A A171152 _Gerald Hillier_, Dec 04 2009
%E A171152 More terms from _Michel Marcus_, Apr 17 2015