How to resolve the algorithm Arithmetic derivative step by step in the J programming language

Published on 12 May 2024 09:40 PM
#J

How to resolve the algorithm Arithmetic derivative step by step in the J programming language

Table of Contents

Problem Statement

The arithmetic derivative of an integer (more specifically, the Lagarias arithmetic derivative) is a function defined for integers, based on prime factorization, by analogy with the product rule for the derivative of a function that is used in mathematical analysis. Accordingly, for natural numbers n, the arithmetic derivative D(n) is defined as follows: Additionally, for negative integers the arithmetic derivative may be defined as -D(-n) (n < 0). D(2) = 1 and D(3) = 1 (both are prime) so if mn = 2 * 3, D(6) = (1)(3) + (1)(2) = 5. D(9) = D(3)(3) + D(3)(3) = 6 D(27) = D(3)*9 + D(9)*3 = 9 + 18 = 27 D(30) = D(5)(6) + D(6)(5) = 6 + 5 * 5 = 31. Find and show the arithmetic derivatives for -99 through 100. Find (the arithmetic derivative of 10^m) then divided by 7, where m is from 1 to 20.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Arithmetic derivative step by step in the J programming language

Source code in the j programming language

D=: {{ +/y%q:1>.|y }}"0


   D _99+i.20 10
_75  _77  _1 _272 _24  _49 _34  _96  _20 _123
 _1 _140 _32  _45 _22 _124  _1  _43 _108 _176
 _1  _71 _18  _80 _55  _39  _1 _156   _1  _59
_26  _72  _1  _61 _18 _192 _51  _33   _1  _92
 _1  _31 _22  _92 _16  _81  _1  _56  _20  _45
_14 _112  _1  _25 _39  _48  _1  _41   _1  _68
_16  _21  _1  _60 _12  _19 _14  _80   _1  _31
 _1  _32 _27  _15 _10  _44  _1  _13  _10  _24
 _1  _21  _1  _32  _8   _9  _1  _16   _1   _7
 _6  _12  _1   _5  _1   _4  _1   _1    0    0
  0    1   1    4   1    5   1   12    6    7
  1   16   1    9   8   32   1   21    1   24
 10   13   1   44  10   15  27   32    1   31
  1   80  14   19  12   60   1   21   16   68
  1   41   1   48  39   25   1  112   14   45
 20   56   1   81  16   92  22   31    1   92
  1   33  51  192  18   61   1   72   26   59
  1  156   1   39  55   80  18   71    1  176
108   43   1  124  22   45  32  140    1  123
 20   96  34   49  24  272   1   77   75  140


   15 10 6 + 2 3 5 * D 15 10 6
31 31 31


   (D 10x^1+i.4 5)%7
                1                 20                 300                 4000                 50000
           600000            7000000            80000000            900000000           10000000000
     110000000000      1200000000000      13000000000000      140000000000000      1500000000000000
16000000000000000 170000000000000000 1800000000000000000 19000000000000000000 200000000000000000000


  

You may also check:How to resolve the algorithm Ordered words step by step in the Lang5 programming language
You may also check:How to resolve the algorithm Find duplicate files step by step in the PicoLisp programming language
You may also check:How to resolve the algorithm Idoneal numbers step by step in the Perl programming language
You may also check:How to resolve the algorithm Hailstone sequence step by step in the Oforth programming language
You may also check:How to resolve the algorithm Polymorphism step by step in the Golo programming language