Find Sequences

Problem Overview

  • Find all sequences of consecutive positive integers whose squares sum to a given n.
  • Input: single integer n (1 ≤ n ≤ 10^10); Output: first a count k, then k strings each starting with length c followed by the c numbers, ordered by decreasing c.
  • Focuses on number theory and sequence decomposition with strict output formatting.
  • A coding interview problem suitable for practicing parsing and math logic.
  • From Trend_micro interviews and commonly asked as an interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: