Find primes and integers that solve an equation - MATLAB Cody - MATLAB Central

Problem 60401. Find primes and integers that solve an equation

Difficulty:Rate
Write a function to find all primes p and non-negative integers k that solve the equation
p! + ap = k^2
where a is an integer. If there are no solutions for a given value of a, return p = [] and k = [].

Solution Stats

61.54% Correct | 38.46% Incorrect
Last Solution submitted on Aug 16, 2024

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Group

YouTube-inspired Image
YouTube-inspired
  • 15 Problems
  • 2 Finishers

Problem Recent Solvers7

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!