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;
        }
    }
}
相关推荐
千金裘换酒21 分钟前
LeetCode 移动零元素 快慢指针
算法·leetcode·职场和发展
方璧30 分钟前
限流的算法
java·开发语言
wm104341 分钟前
机器学习第二讲 KNN算法
人工智能·算法·机器学习
NAGNIP43 分钟前
一文搞懂机器学习线性代数基础知识!
算法
NAGNIP1 小时前
机器学习入门概述一览
算法
Hi_kenyon1 小时前
VUE3套用组件库快速开发(以Element Plus为例)二
开发语言·前端·javascript·vue.js
曲莫终1 小时前
Java VarHandle全面详解:从入门到精通
java·开发语言
一心赚狗粮的宇叔1 小时前
中级软件开发工程师2025年度总结
java·大数据·oracle·c#
iuu_star1 小时前
C语言数据结构-顺序查找、折半查找
c语言·数据结构·算法