PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Schonfeld

Find smallest N for 5-and-21 sums

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of integer linear combinations and elementary number theory, framed as a Frobenius coin problem that examines representability using non-negative multiples of 5 and 21.

  • medium
  • Schonfeld
  • Coding & Algorithms
  • Data Scientist

Find smallest N for 5-and-21 sums

Company: Schonfeld

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Take-home Project

You are given two positive integers: 5 and 21. We say a positive integer `x` is **representable** if it can be written in the form \[ x = 5a + 21b \] for some non‑negative integers `a` and `b` (i.e., using any number of 5s and 21s, order does not matter). For example, 99 is representable because: - 99 = 21 + 21 + 21 + 21 + 5 + 5 + 5. Find the **smallest integer N** such that **every integer greater than or equal to N** is representable. Output this minimal value of `N`.

Quick Answer: This question evaluates understanding of integer linear combinations and elementary number theory, framed as a Frobenius coin problem that examines representability using non-negative multiples of 5 and 21.

Related Interview Questions

  • Compute probability last passenger gets own seat - Schonfeld (medium)
Schonfeld logo
Schonfeld
Nov 1, 2025, 12:00 AM
Data Scientist
Take-home Project
Coding & Algorithms
1
0

You are given two positive integers: 5 and 21. We say a positive integer x is representable if it can be written in the form

x=5a+21bx = 5a + 21bx=5a+21b

for some non‑negative integers a and b (i.e., using any number of 5s and 21s, order does not matter).

For example, 99 is representable because:

  • 99 = 21 + 21 + 21 + 21 + 5 + 5 + 5.

Find the smallest integer N such that every integer greater than or equal to N is representable.

Output this minimal value of N.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Schonfeld•More Data Scientist•Schonfeld Data Scientist•Schonfeld Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.