How to resolve the algorithm Deceptive numbers step by step in the Quackery programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Deceptive numbers step by step in the Quackery programming language
Table of Contents
Problem Statement
Repunits are numbers that consist entirely of repetitions of the digit one (unity). The notation Rn symbolizes the repunit made up of n ones. Every prime p larger than 5, evenly divides the repunit Rp-1.
The repunit R6 is evenly divisible by 7. 111111 / 7 = 15873 The repunit R42 is evenly divisible by 43. 111111111111111111111111111111111111111111 / 43 = 2583979328165374677002583979328165374677 And so on.
There are composite numbers that also have this same property. They are often referred to as deceptive non-primes or deceptive numbers.
The repunit R90 is evenly divisible by the composite number 91 (=7*13).
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Deceptive numbers step by step in the Quackery programming language
Source code in the quackery programming language
[ 10 swap ** 1 - 9 / ] is rep ( n --> n )
[] 0
[ 2 + dup 1+ isprime if again
dup rep over 1+ mod if again
tuck 1+ join
tuck size 20 = until ]
drop echo
You may also check:How to resolve the algorithm Sort three variables step by step in the Lua programming language
You may also check:How to resolve the algorithm Quad-power prime seeds step by step in the Java programming language
You may also check:How to resolve the algorithm MD5/Implementation step by step in the Haskell programming language
You may also check:How to resolve the algorithm Sieve of Eratosthenes step by step in the Befunge programming language
You may also check:How to resolve the algorithm Execute a system command step by step in the Locomotive Basic programming language