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

Home > Numbers
Arithmetic Derivative (Posted on 2022-06-10) Difficulty: 4 of 5
Consider the following (simplified) definition of the "Arithmetic Derivative" for n in positive integers:
D(0) = D(1) = 0
D(prime) = 1
D(ab) = D(a)*b + D(b)*a

Examples:
D(7) = 1 because 7 is prime.
D(30) = D(5*6) = D(5)*6 + 5*D(6) = 1*6 + 5*D(2*3)
= 6 + 5*[D(2)*3+2*D(3)] = 6 + 5*5 = 31, so ...
D(30) = 31
D(58) = 31 (More than one integer can have the same Arithmetic Derivative.)

(1). Find n and D(n) (n up to 5 digits) such that D(n) is the largest.
(2). Find n and D(n) (n up to 5 digits and not prime) such that the ratio D(n)/n is the largest.
(3). Which 4-digit Palindrome is the Arithmetic Derivative of the most 4-digit positive integers, and list them.
(4). For what set of n is n = D(n)

No Solution Yet Submitted by Larry    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
bits and pieces | Comment 6 of 7 |
Note that part (3) asks for the entire list of integers for which D(i) = "abba", for the 4 digit Palindrome which is the arithmetic derivative of the most integers.

And, for reference, here are the Python functions I wrote to get prime factors and to check if an integer is prime.

def prime_factor(n): 
    """  for integer n, return a list of all the prime factors """
    top = n // 2
    factors = []
    
    for i in range(2,top+1):
        while n/i % 1 == 0:
            factors.append(int(i))
            n = n/i
            if n == 1:
                return factors
    if n != 1:
        factors.append(int(n))
    return factors

def isprime(n):
    '''check if integer n is a prime'''
    n = abs(int(n))
    if n < 2:
        return False
    if n == 2: 
        return True    
    if not n & 1: 
        return False
    for x in range(3, int(n**0.5)+1, 2):
        if n % x == 0:
            return False
    return True

  Posted by Larry on 2022-06-10 15:05:44
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 (8)
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