C#,十进制展开数(Decimal Expansion Number)的算法与源代码

1 十进制展开数

十进制展开数(Decimal Expansion Number)的计算公式:

DEN = n^3 - n - 1

The decimal expansion of a number is its representation in base -10 (i.e., in the decimal system). In this systemeach "decimal placeconsists of a digit 0-9 arranged such that each digit is multiplied by a power of 10, decreasing from left to rightand with a decimal place indicating the s place.

2 计算结果

3 源程序

using System;

namespace Legalsoft.Truffer.Algorithm
{
    public static partial class Number_Sequence
    {
        public static int Decimal_Expansion_Number(int n)
        {
            return n * n * n - n - 1;
        }
    }
}
 

The decimal expansion of a number is its representation in base-10 (i.e., in the decimal system). In this system, each "decimal place" consists of a digit 0-9 arranged such that each digit is multiplied by a power of 10, decreasing from left to right, and with a decimal place indicating the s place. For example, the number with decimal expansion 1234.56 is defined as

Expressions written in this form  (where negative  are allowed as exemplified above but usually not considered in elementary education contexts) are said to be in expanded notation.

Other examples include the decimal expansion of  given by 625, of  given by 3.14159..., and of  given by 0.1111.... The decimal expansion of a number can be found in the Wolfram Language using the command RealDigits[n], or equivalently, RealDigits[n, 10].

The decimal expansion of a number may terminate (in which case the number is called a regular number or finite decimal, e.g., ), eventually become periodic (in which case the number is called a repeating decimal, e.g., ), or continue infinitely without repeating (in which case the number is called irrational).

The following table summarizes the decimal expansions of the first few unit fractions. As usual, the repeating portion of a decimal expansion is conventionally denoted with a vinculum.

4 代码格式


using System;

namespace Legalsoft.Truffer.Algorithm
{
    public static partial class Number_Sequence
    {
        public static int Decimal_Expansion_Number(int n)
        {
            return n * n * n - n - 1;
        }
    }
}

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-10 21:32:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-10 21:32:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-02-10 21:32:01       87 阅读
  4. Python语言-面向对象

    2024-02-10 21:32:01       96 阅读

热门阅读

  1. 单调队列优化DP,LeetCode1696. 跳跃游戏 VI

    2024-02-10 21:32:01       60 阅读
  2. 掌握XGBoost:特征工程与数据预处理

    2024-02-10 21:32:01       49 阅读
  3. c# 加密解密帮助类

    2024-02-10 21:32:01       51 阅读
  4. 通过神经网络模拟人类大脑的学习过程

    2024-02-10 21:32:01       55 阅读
  5. 利用python调用ChatGPT API示例

    2024-02-10 21:32:01       46 阅读
  6. 公司大数据展示模板【大屏可视化项目案例-23】

    2024-02-10 21:32:01       49 阅读
  7. 代码随想录算法——数组

    2024-02-10 21:32:01       49 阅读
  8. 2.1 Binance_interface APP 现货交易账户

    2024-02-10 21:32:01       46 阅读
  9. Python爬虫下载小说

    2024-02-10 21:32:01       51 阅读