All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Semiprimes and Emirps (Posted on 2023-01-14) Difficulty: 3 of 5
Determine the total number of semiprimes below 2023, that are immediately followed by an emirp.

For example, 22 is a semiprime which is immediately followed by 23. But 23 is NOT an emirp, since 32 is composite.

List all valid pairs in conformity with the provisions of the problem.

*** Computer program/ excel solver aided methods are welcome, but a semi-analytic methodology is preferred.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 3 of 5 |
clearvars,clc
spCt=0; spEmirp=0;
for n=1:2022
   f=factor(n);
   if length(f)==2
      spCt=spCt+1;
      np1=char(string(n+1));
      emirp=str2double(flip(np1));
      if isprime(emirp) && isprime(n+1) && n+1 ~= emi
         spEmirp=spEmirp+1;
         fprintf('%5d ',n,factor(n),emirp,n+1);
         fprintf('\n');
    %     disp([n factor(n) emirp])
      end
   end
end
disp([spCt spEmirp]);

finds
           prime          mutual
  n    factorization     emirps
  
  106     2    53       701   107 
  166     2    83       761   167 
  178     2    89       971   179 
  346     2   173       743   347 
  358     2   179       953   359 
  982     2   491       389   983 
 1282     2   641      3821  1283 
 1438     2   719      9341  1439 
 1486     2   743      7841  1487 
 1522     2   761      3251  1523 
 1618     2   809      9161  1619 
 
   581 semiprimes found,   11 followed by emirp


  Posted by Charlie on 2023-01-14 11:01:12
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information