# Công thức với dãy số

```
// Some code
# Tỏng các số tự nhiên từ 1 đến n
s = int(n*(n+1)/2)

# Tổng các số tự nhiên lẻ từ 1 đến n
s_le = int(n/2 + 0.5)**2 

# Tổng các số tự nhiên chẵn
s_chan = int((n/2)**2 + n/2 )

#Tổng bình phương của n số tự nhiên liên tiếp
s_binhphuong = int((n*(n+1)*(2*n - 1))/6 )

# Tổng lập phương dãy n số tự nhiên
s_lapphuong = int((n*2 + n)/2)**2
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://python.dainganxanh.com/phu-luc/cong-thuc-voi-day-so.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
