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 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.

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 代码格式

cs 复制代码
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;
        }
    }
}
相关推荐
emplace_back15 分钟前
C# 集合表达式和展开运算符 (..) 详解
开发语言·windows·c#
jz_ddk22 分钟前
[学习] C语言数学库函数背后的故事:`double erf(double x)`
c语言·开发语言·学习
萧曵 丶32 分钟前
Rust 所有权系统:深入浅出指南
开发语言·后端·rust
xiaolang_8616_wjl36 分钟前
c++文字游戏_闯关打怪2.0(开源)
开发语言·c++·开源
收破烂的小熊猫~44 分钟前
《Java修仙传:从凡胎到码帝》第四章:设计模式破万法
java·开发语言·设计模式
nananaij1 小时前
【Python进阶篇 面向对象程序设计(3) 继承】
开发语言·python·神经网络·pycharm
qqxhb1 小时前
零基础数据结构与算法——第四章:基础算法-排序(上)
java·数据结构·算法·冒泡·插入·选择
阿蒙Amon1 小时前
为什么 12 版仍封神?《C# 高级编程》:从.NET 5 到实战架构,进阶者绕不开的必修课
开发语言·c#
无小道1 小时前
c++-引用(包括完美转发,移动构造,万能引用)
c语言·开发语言·汇编·c++