How to resolve the algorithm Deceptive numbers step by step in the J programming language

Published on 12 May 2024 09:40 PM
#J

How to resolve the algorithm Deceptive numbers step by step in the J 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 J programming language

Source code in the j programming language

wheel=. 4 6 2 6 4 2 4 2
fermat=. {{1 = 10 (y&|@^) <: y}}"0

_10 ]\ (#~ fermat) (#~ 0&p:) +/\ 49 , 15e4 $ wheel


  

You may also check:How to resolve the algorithm Include a file step by step in the Arturo programming language
You may also check:How to resolve the algorithm Conway's Game of Life step by step in the Go programming language
You may also check:How to resolve the algorithm Sierpinski triangle/Graphical step by step in the Logo programming language
You may also check:How to resolve the algorithm Get system command output step by step in the Icon and Unicon programming language
You may also check:How to resolve the algorithm Function definition step by step in the Raven programming language