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;
        }
    }
}
相关推荐
晨非辰44 分钟前
#C语言——刷题攻略:牛客编程入门训练(十一):攻克 循环控制(三),轻松拿捏!
c语言·开发语言·经验分享·学习·visual studio
励志码农3 小时前
JavaWeb 30 天入门:第二十三天 —— 监听器(Listener)
java·开发语言·spring boot·学习·servlet
天高云淡ylz3 小时前
子网掩码的隐形陷阱:为何能ping通却无法HTTPS访问
开发语言·php
汉克老师5 小时前
第十四届蓝桥杯青少组C++选拔赛[2023.2.12]第二部分编程题(5、机甲战士)
c++·算法·蓝桥杯·01背包·蓝桥杯c++·c++蓝桥杯
希望20175 小时前
Golang Panic & Throw & Map/Channel 并发笔记
开发语言·golang
朗迹 - 张伟5 小时前
Golang安装笔记
开发语言·笔记·golang
yzx9910135 小时前
生活在数字世界:一份人人都能看懂的网络安全生存指南
运维·开发语言·网络·人工智能·自动化
小周同学@5 小时前
谈谈对this的理解
开发语言·前端·javascript
Mr_Xuhhh6 小时前
项目需求分析(2)
c++·算法·leetcode·log4j
橙*^O^*安6 小时前
Go 语言基础:变量与常量
运维·开发语言·后端·golang·kubernetes