1 Star 0 Fork 65

欢喜派 / C-Sharp

forked from 编程语言算法集 / C-Sharp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CubesSequence.cs 841 Bytes
一键复制 编辑 原始数据 按行查看 历史
OleksiiHe 提交于 2022-01-26 23:06 . Add A000578 Cubes sequence (#282)
using System.Collections.Generic;
using System.Numerics;
namespace Algorithms.Sequences
{
/// <summary>
/// <para>
/// Sequence of cube numbers.
/// </para>
/// <para>
/// Wikipedia: https://en.wikipedia.org/wiki/Cube_(algebra).
/// </para>
/// <para>
/// OEIS: https://oeis.org/A000578.
/// </para>
/// </summary>
public class CubesSequence : ISequence
{
/// <summary>
/// Gets sequence of cube numbers.
/// </summary>
public IEnumerable<BigInteger> Sequence
{
get
{
var n = BigInteger.Zero;
while (true)
{
yield return n * n * n;
n++;
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/Joypai/C-Sharp.git
git@gitee.com:Joypai/C-Sharp.git
Joypai
C-Sharp
C-Sharp
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891