How many PR numbers exist in a given range? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to (efficiently) compute the sum of the digits of evey number lying between two given numbers?Finding GCD of all permutations of a decimal numberFinding the GCD of three numbers?Determination quantity of integers, the sum of digits of which is equal to $N$Fast way to find the sum of LCM of the given range of numbers?Does this algorithm find prime numbers only?count subsets with given constraintsCount good numbers that are multiple of 7 upto MGiven number n. Find the n digit numbers.Algorithm to identify the most satisfiable value or range with predefined set of intervals

Can a 1st-level character have an ability score above 18?

Difference between "generating set" and free product?

What can I do if neighbor is blocking my solar panels intentionally?

Problems with Ubuntu mount /tmp

how can a perfect fourth interval be considered either consonant or dissonant?

Can smartphones with the same camera sensor have different image quality?

Was credit for the black hole image misattributed?

Can the prologue be the backstory of your main character?

Make it rain characters

Finding the path in a graph from A to B then back to A with a minimum of shared edges

Does Parliament hold absolute power in the UK?

What's the point in a preamp?

What are these Gizmos at Izaña Atmospheric Research Center in Spain?

Typeface like Times New Roman but with "tied" percent sign

Single author papers against my advisor's will?

Does the AirPods case need to be around while listening via an iOS Device?

How to pronounce 1ターン?

If the empty set is a subset of every set, why write ... ∪ ∅?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Is this wall load bearing? Blueprints and photos attached

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

Wall plug outlet change

Relations between two reciprocal partial derivatives?

Can undead you have reanimated wait inside a portable hole?



How many PR numbers exist in a given range?



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to (efficiently) compute the sum of the digits of evey number lying between two given numbers?Finding GCD of all permutations of a decimal numberFinding the GCD of three numbers?Determination quantity of integers, the sum of digits of which is equal to $N$Fast way to find the sum of LCM of the given range of numbers?Does this algorithm find prime numbers only?count subsets with given constraintsCount good numbers that are multiple of 7 upto MGiven number n. Find the n digit numbers.Algorithm to identify the most satisfiable value or range with predefined set of intervals










0












$begingroup$


You are given 2 integers 'L' and 'R' . You are required to find the count of all the PR numbers in the range 'L' to 'R' inclusively. PR number are the numbers which satisfy following properties: -



1) :- No pair of adjacent digits are co-prime i.e. adjacent digits in a PR number will not be co-prime to each other.



2) :- PR number is divisible by all the single digit prime numbers which occur as a digit in the PR number.



Note:- Two numbers 'a' and 'b' are co-prime , if
gcd(a,b)=1 .



Also, gcd(0,a)=a;



Example:-
[2,5].



Output:- '4'.



(Note '1' : - '1' is not a prime-number,though its very common)



(All the integers:- '2','3','4','5') satisfy the condition of PR numbers :-)



What can be the the most efficient algorithm to solve this ?










share|cite|improve this question











$endgroup$











  • $begingroup$
    Can you clarify the definition - does $30$ count as PR? What about $10$?
    $endgroup$
    – Mark Bennet
    Mar 25 at 6:59










  • $begingroup$
    '30' is a PR number as gcd (0,3) = 3 and and 30 is divisible by '3' :-)
    $endgroup$
    – Firex secred
    Mar 25 at 7:25










  • $begingroup$
    10 is not as its gcd=1
    $endgroup$
    – Firex secred
    Mar 25 at 7:25










  • $begingroup$
    Note that this question is cross-posted on SO.
    $endgroup$
    – user202729
    Mar 26 at 15:10















0












$begingroup$


You are given 2 integers 'L' and 'R' . You are required to find the count of all the PR numbers in the range 'L' to 'R' inclusively. PR number are the numbers which satisfy following properties: -



1) :- No pair of adjacent digits are co-prime i.e. adjacent digits in a PR number will not be co-prime to each other.



2) :- PR number is divisible by all the single digit prime numbers which occur as a digit in the PR number.



Note:- Two numbers 'a' and 'b' are co-prime , if
gcd(a,b)=1 .



Also, gcd(0,a)=a;



Example:-
[2,5].



Output:- '4'.



(Note '1' : - '1' is not a prime-number,though its very common)



(All the integers:- '2','3','4','5') satisfy the condition of PR numbers :-)



What can be the the most efficient algorithm to solve this ?










share|cite|improve this question











$endgroup$











  • $begingroup$
    Can you clarify the definition - does $30$ count as PR? What about $10$?
    $endgroup$
    – Mark Bennet
    Mar 25 at 6:59










  • $begingroup$
    '30' is a PR number as gcd (0,3) = 3 and and 30 is divisible by '3' :-)
    $endgroup$
    – Firex secred
    Mar 25 at 7:25










  • $begingroup$
    10 is not as its gcd=1
    $endgroup$
    – Firex secred
    Mar 25 at 7:25










  • $begingroup$
    Note that this question is cross-posted on SO.
    $endgroup$
    – user202729
    Mar 26 at 15:10













0












0








0


2



$begingroup$


You are given 2 integers 'L' and 'R' . You are required to find the count of all the PR numbers in the range 'L' to 'R' inclusively. PR number are the numbers which satisfy following properties: -



1) :- No pair of adjacent digits are co-prime i.e. adjacent digits in a PR number will not be co-prime to each other.



2) :- PR number is divisible by all the single digit prime numbers which occur as a digit in the PR number.



Note:- Two numbers 'a' and 'b' are co-prime , if
gcd(a,b)=1 .



Also, gcd(0,a)=a;



Example:-
[2,5].



Output:- '4'.



(Note '1' : - '1' is not a prime-number,though its very common)



(All the integers:- '2','3','4','5') satisfy the condition of PR numbers :-)



What can be the the most efficient algorithm to solve this ?










share|cite|improve this question











$endgroup$




You are given 2 integers 'L' and 'R' . You are required to find the count of all the PR numbers in the range 'L' to 'R' inclusively. PR number are the numbers which satisfy following properties: -



1) :- No pair of adjacent digits are co-prime i.e. adjacent digits in a PR number will not be co-prime to each other.



2) :- PR number is divisible by all the single digit prime numbers which occur as a digit in the PR number.



Note:- Two numbers 'a' and 'b' are co-prime , if
gcd(a,b)=1 .



Also, gcd(0,a)=a;



Example:-
[2,5].



Output:- '4'.



(Note '1' : - '1' is not a prime-number,though its very common)



(All the integers:- '2','3','4','5') satisfy the condition of PR numbers :-)



What can be the the most efficient algorithm to solve this ?







algorithms






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 25 at 7:30







Firex secred

















asked Mar 25 at 6:47









Firex secredFirex secred

142




142











  • $begingroup$
    Can you clarify the definition - does $30$ count as PR? What about $10$?
    $endgroup$
    – Mark Bennet
    Mar 25 at 6:59










  • $begingroup$
    '30' is a PR number as gcd (0,3) = 3 and and 30 is divisible by '3' :-)
    $endgroup$
    – Firex secred
    Mar 25 at 7:25










  • $begingroup$
    10 is not as its gcd=1
    $endgroup$
    – Firex secred
    Mar 25 at 7:25










  • $begingroup$
    Note that this question is cross-posted on SO.
    $endgroup$
    – user202729
    Mar 26 at 15:10
















  • $begingroup$
    Can you clarify the definition - does $30$ count as PR? What about $10$?
    $endgroup$
    – Mark Bennet
    Mar 25 at 6:59










  • $begingroup$
    '30' is a PR number as gcd (0,3) = 3 and and 30 is divisible by '3' :-)
    $endgroup$
    – Firex secred
    Mar 25 at 7:25










  • $begingroup$
    10 is not as its gcd=1
    $endgroup$
    – Firex secred
    Mar 25 at 7:25










  • $begingroup$
    Note that this question is cross-posted on SO.
    $endgroup$
    – user202729
    Mar 26 at 15:10















$begingroup$
Can you clarify the definition - does $30$ count as PR? What about $10$?
$endgroup$
– Mark Bennet
Mar 25 at 6:59




$begingroup$
Can you clarify the definition - does $30$ count as PR? What about $10$?
$endgroup$
– Mark Bennet
Mar 25 at 6:59












$begingroup$
'30' is a PR number as gcd (0,3) = 3 and and 30 is divisible by '3' :-)
$endgroup$
– Firex secred
Mar 25 at 7:25




$begingroup$
'30' is a PR number as gcd (0,3) = 3 and and 30 is divisible by '3' :-)
$endgroup$
– Firex secred
Mar 25 at 7:25












$begingroup$
10 is not as its gcd=1
$endgroup$
– Firex secred
Mar 25 at 7:25




$begingroup$
10 is not as its gcd=1
$endgroup$
– Firex secred
Mar 25 at 7:25












$begingroup$
Note that this question is cross-posted on SO.
$endgroup$
– user202729
Mar 26 at 15:10




$begingroup$
Note that this question is cross-posted on SO.
$endgroup$
– user202729
Mar 26 at 15:10










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3161455%2fhow-many-pr-numbers-exist-in-a-given-range%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3161455%2fhow-many-pr-numbers-exist-in-a-given-range%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Moe incest case Sentencing See also References Navigation menu"'Australian Josef Fritzl' fathered four children by daughter""Small town recoils in horror at 'Australian Fritzl' incest case""Victorian rape allegations echo Fritzl case - Just In (Australian Broadcasting Corporation)""Incest father jailed for 22 years""'Australian Fritzl' sentenced to 22 years in prison for abusing daughter for three decades""RSJ v The Queen"

Who is our nearest planetary neighbor, on average?Santa Claus flies to the South PoleSeven Spheres of Unequal Mass, a weighing problem with a twistDescribe a large integerFast Mental Calculation of $7.5^7$Math in Space (without the help of celebrities)Find the value of $bigstar$: Puzzle 8 - InequalityWho drinks beer while running anyway?A Crucial DeliveryRanking And AverageHow long will my money last at roulette?

Daza language Contents Vocabulary Phonology References External links Navigation menudaza1242Daza"Dazaga"eeee178086576