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;
        }
    }
}
相关推荐
我是一颗柠檬1 分钟前
【Java项目技术亮点】Outbox事件驱动模式:解决分布式事务的终极方案
java·开发语言·分布式·后端·中间件·kafka
醉颜凉2 分钟前
Scala自定义Monad实战:从理论到应用的完整指南
大数据·算法·scala
那晚的她2 分钟前
Scala中Set集合
开发语言·后端·scala
右耳朵猫AI5 分钟前
Go周刊2026W21 | Fiber 3.3、errcheck 1.20、Jet 2.15、Sarama 1.49
开发语言·后端·golang
STY_fish_20126 分钟前
KMP-前缀函数
算法
Clf丶忆笙7 分钟前
搭建支持多语言开发的Quarkus环境:Java、Kotlin与Scala全栈指南
java·开发语言·云原生·kotlin·scala·quarkus
IvanCodes8 分钟前
四、Scala深入面向对象:类、对象与伴生关系
开发语言·后端·scala
嗯.~8 分钟前
scala的泛型应用场景
开发语言·后端·scala
SoftLipaRZC9 分钟前
C语言动态内存:内存管理完全指南
c语言·开发语言
java1234_小锋9 分钟前
LangChain4j 开发Java Agent智能体- 对话与提示词工程(Prompt)
java·开发语言·prompt·langchain4j