当前位置: 首页 > news >正文

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;}}
}

http://www.lryc.cn/news/297245.html

相关文章:

  • Vue3快速上手(一)使用vite创建项目
  • 使用navicat导出mysql离线数据后,再导入doris的方案
  • re:从0开始的CSS学习之路 1. CSS语法规则
  • npm install express -g报错或一直卡着,亲测可解决
  • 机器学习11-前馈神经网络识别手写数字1.0
  • vscode wsl远程连接 权限问题
  • VED-eBPF:一款基于eBPF的内核利用和Rootkit检测工具
  • 配置ARM交叉编译工具的通用步骤
  • 相机图像质量研究(5)常见问题总结:光学结构对成像的影响--景深
  • 使用django构建一个多级评论功能
  • 测试管理_利用python连接禅道数据库并自动统计bug数据到钉钉群
  • Python 小白的 Leetcode Daily Challenge 刷题计划 - 20240209(除夕)
  • BFS——双向广搜+A—star
  • LLM之LangChain(七)| 使用LangChain,LangSmith实现Prompt工程ToT
  • 新零售的升维体验,摸索华为云GaussDB如何实现数据赋能
  • vscode +git +gitee 文件管理
  • 【力扣】用栈判断有效的括号
  • 【目录】CSAPP的实验简介与解法总结(已包含Attack/Link/Architecture/Cache)
  • 【机器学习】数据清洗之识别缺失点
  • 【Vue】Vue基础入门
  • 正点原子-STM32通用定时器学习笔记(1)
  • Redis篇之redis是单线程
  • 随机MM引流源码PHP开源版
  • 【C++修行之道】(引用、函数提高)
  • 从零开始手写mmo游戏从框架到爆炸(十一)— 注册与登录
  • 【SpringBoot】Redis集中管理Session和自定义用户参数解决登录状态及校验问题
  • 【0256】揭晓pg内核中MyBackendId的分配机制(后端进程Id,BackendId)(二)
  • eclipse4.28.0版本如何安装FatJar插件
  • 查大数据检测到风险等级太高是怎么回事?
  • Leetcode 30天高效刷数据结构和算法 Day1 两数之和 —— 无序数组