|
|
|
|
3, 9, 17, 28, 41, 56, 74, 94, 116, 140, 167, 196, 227, 260, 295, 333, 373, 415, 459, 505, 553, 604, 657, 712, 769, 828, 889, 952, 1018, 1086, 1156, 1228, 1302, 1378, 1456, 1536, 1619, 1704, 1791, 1880, 1971, 2064, 2159, 2256, 2355, 2457, 2561, 2667, 2775, 2885, 2997, 3111
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
Set R = round(sqrt(2*n)), then a(n) = n^2+n+R*((6*n+1)-R^2)/6.
|
|
EXAMPLE
|
a(1) = 3;
a(2) = 3+6 = 9;
a(3) = 3+6+8 = 17;
a(4) = 3+6+8+11 = 28.
|
|
PROG
|
(PARI) vector(80, n, R = round(sqrt(2*n)); n^2+n+R*((6*n+1)-R^2)/6) \\ Michel Marcus, Apr 17 2015
(Python)
from math import isqrt
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
|
|
CROSSREFS
|
Cf. A118011 (complement of the Connell sequence).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|