Skip to main content

AP CSA FRQ Guide

2007 FRQ 1: SelfDivisor

Determine whether a positive integer is divisible by every one of its decimal digits, then collect the first requested number of self-divisors at or above a starting value.

Digit Processing and Array Construction22 minute targetintegersmoduloloopsarrayshelper methods

Skills Tested

What this FRQ is really practicing

integersmoduloloopsarrayshelper methods

Review these topics before attempting the problem.

Starter Approach

How to begin with your own plan

  1. 1Part A: inspect every decimal digit, rejecting a zero digit or any digit that does not divide the original number evenly.
  2. 2Part B: return an array of size num containing the first num self-divisors greater than or equal to start, in increasing order.
  3. 3Use isSelfDivisor to test candidates and continue until the result array is full.

Attempt the problem before opening the solution.

Common Mistakes

Mistakes to watch for while writing

Taking a remainder by zero when a number contains a zero digit.
Testing each digit against a shortened working copy instead of the original number.
Checking only num candidates instead of collecting num successful results.

Self Check

Review questions before you submit

Extracts digits using remainder arithmetic.

Use a working copy so divisibility is tested against the original number.

Checks for a zero digit before division or remainder by that digit.

Any number containing a zero digit is not a self-divisor.

Allocates an array for the requested number of results.

The output length is num, even when many candidates fail.

Uses isSelfDivisor when collecting the results.

Start checking at start itself and advance after every candidate.

Practice Links

Where to go next