# Print all combinations of numbers from 1 to n that sum to n.

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/1130/combinations-n-n-sum
Source observed: 2026-11-05T00:29:56.962Z
Last checked: 2026-11-05T00:29:56.962+00:00
Indexed: 2026-11-06T06:47:12.748+00:00

---

# Print all combinations of numbers from 1 to n that sum to n.

We list this as a **Data Structures & Algorithms** and **Coding** interview question. It is associated with **Software Engineer**, **Data Engineer**, **Data Scientist**, and **Machine Learning Engineer** roles, and with **Apple**, **Reddit**, **Oracle**, **Adobe**, and **LinkedIn**. The page reports 25 interviews and says it was last asked 2 years ago.

## Access and answers

Detailed company statistics require an [Upgrade](https://www.aced.io/upgrade?src=questions). No community answers have been contributed yet. You can [log in or sign up to answer](https://www.aced.io/signup?src=nav).

## Related questions

- [Letter Combinations of a Phone Number](https://www.aced.io/questions/6631/generate-letter-combinations-phone-number)
- [Count total possible combinations of N-digit numbers in a mobile keypad.](https://www.aced.io/questions/1174/total-combinations-n-digit-numbers-mobile-keypad)
- [Given an array of integers, print all subarrays that sum to zero.](https://www.aced.io/questions/964/subarrays-with-zero-sum)

## Related courses

![Machine Learning Engineer Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/6UfkHxUyLQVfDHSfLNQtWa/1be1539a65b4f6f15201f5b573c0a578/ML_Engineer_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

### [Machine Learning Engineer Interview Prep](https://www.aced.io/courses/ml-engineer)

Prepare for machine learning roles at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other top companies with mock interviews, frameworks, and advice from senior candidates. Topics include ML system design, core concepts, coding, and behavioral interviews.

![Data Science Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/3U4C5C0OkDR0UeGch4AmlE/7ad489430b676a088cb973307fe77884/Data_Science_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

### [Data Science Interview Prep](https://www.aced.io/courses/data-science)

Prepare for data science roles at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Practice statistics, experimentation, coding, SQL, machine learning, and behavioral interviews with mock interviews, frameworks, and advice from senior candidates.

## Your answer

Submitting an answer marks this question complete.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F1130%2Fcombinations-n-n-sum&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F1130%2Fcombinations-n-n-sum). Opening a form does not execute a tool.