Wednesday, 30 October 2024

Multipurpose Algorithm using SageMath

Given the recent problems with Numbers Aplenty (see blog post Trouble with Numbers Aplenty), I've continued developing a SageMath program that will generate information about a number in a manner similar to Numbers Aplenty. At the moment, for any number that is input, the following output is generated:

  • factorisation of the number or declaration that it is prime
  • number of divisors
  • list of divisors
  • sum of divisors and factorisation of the sum
  • sum of proper divisors and factorisation of the sum
  • determination of whether a number is deficient, perfect or abundant
  • if abundant, determination of whether the number is pseudoperfect or weird
  • if abundant, determination of whether the number is a Zumkeller number
  • if abundant, determination of whether the number is practical
  • determination of whether number is Duffinian
  • totient and its factorisation
  • cototient and its factorisation
  • determination of whether number is cyclic
  • sum of squares of digits and factorisation of the sum
  • sum of cubes of digits and factorisation of the sum
  • determination of whether the number is admirable
  • determination of whether the number is an interprime number
  • determination of whether the number is a Bogota number
  • determination of whether the number is a Curzon number
  • determination of whether the number is a plaindrome in any base from 2 to 16
  • determination of whether the number is metadrome in any base from 2 to 16
  • determination of whether the number is a nialpdrome in any base from 2 to 16
  • determination of whether the number is a katadrome in any base from 2 to 16
  • determination of whether the number is a xenodrome in any base from 2 to 16
  • determination of whether the number is an additive Fibonacci-like number of the second type in any base from 2 to 16
  • Gray Code equivalent of the number and its factorisation
  • absolute difference between the number and its Gray Code and factorisation of this difference
  • determination of whether the number is an Ulam number and, if so, display the two numbers that add together to form it
  • binary complement of the number and its factorisation
  • absolute difference between the number and its binary complement and factorisation of this difference
  • determination of whether the number is energetic
  • number expressed as a sum of two squares if possible
  • number expressed as a sum of two cubes if possible
  • sum of digits (SOD) and product of digits (POD)
  • number + SOD and factorisation of this sum
  • number - SOD and factorisation of this sum
  • number + POD and factorisation of this sum
  • number - POD and factorisation of this sum
  • sequence generated by repetition of Number + SOD - POD
  • sequence generated by repetition of Number + SOD - POD but with zeros ignored
  • Collatz trajectory of the number
  • aliquot sequence determined up to a maximum of 101 steps
  • antidivisors of the number
  • arithmetic derivative of the number
  • determination as to whether number is a D-number
  • determination as to whether number is a de Polignac number
  • sequence produced by Maximum-Minimum recursive algorithm
  • Minimum Goldbach Decomposition
  • sequence generated by Reverse and Add 
  • Home Prime calculated to a maximum of 50 steps
  • Additive Persistence
  • Multiplicative Persistence taking zeros into account
  • Multiplicative Persistence NOT taking zeros into account
  • sequence generated by repetition of Number + Sum of Odd Digits - Sum of Even Digits
  • Circulant Matrix
  • Determinant of Circulant Matrix and its factorisation
  • absolute difference between the numbers and the determinant and factorisation of this difference
I'll keep adding to this program over time using my Jupyter notebook. The program will run in SageMathCell although the creation of a Permalink in not possible. Here's a link to a Google Doc bookmark however:


The code located at this bookmark can be copied into SageMathCell and run.

POSTSCRIPT: 31st October 2024

The day after I made this post the Numbers A Plenty website was down again so all the more reason to keep refining my SageMath algorithm.

No comments:

Post a Comment