List the Beatriz numbers - MATLAB Cody - MATLAB Central

Problem 53810. List the Beatriz numbers

Difficulty:Rate
Write a function to find integers n less than or equal to an input value m that solve the equation sigma(n-1) = phi(n+1). The function sigma(x) gives the sum of divisors of x; for example, sigma(15) = 1+3+5+15 = 24. The totient function phi(x) counts numbers less than x that are relatively prime to x. For example, phi(15) = 8 because 1, 2, 4, 7, 8, 11, 13, and 14 are relatively prime to 15; that is, the greatest common divisor of 15 and each of the eight numbers is 1.
An oblique hint is that I call solutions to sigma(n-1) = phi(n+1) “Beatriz numbers” in honor of a good friend and former co-worker of EmilyR and JessicaR. The natural search will not help, unless you are interested in combinatorics related to Higham’s conjecture.

Solution Stats

64.29% Correct | 35.71% Incorrect
Last Solution submitted on Mar 20, 2025

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

Problem Recent Solvers7

Community Treasure Hunt

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

Start Hunting!