1 22 333 4444 55555的方程式序列? [英] Equation of 1 22 333 4444 55555 sequence?

查看:180
本文介绍了1 22 333 4444 55555的方程式序列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到1 22 333序列公式/等式.

i need to find 1 22 333 sequence formula/equation.

我写这段代码是为了得到这样的数字,但是我需要找到这个序列的方程式

I write this code for getting number like that but i need to find equation of this sequence

代码:

for (int i = 1; i <= 9; i++)
{
    for (int j = 0; j < i; j++)
    {
        Console.Write(i);
    }

    Console.Write("\n");
}

使用此代码,我得到的结果

With this code I get this results

1
22
333
4444
55555
666666
7777777
88888888
999999999

乳胶代码行也应该对我有用.

Also Latex code line should works for me to.

我的意思是等式,例如:

I mean equation somethings like this for example:

推荐答案

几何级数的总和来看,第(n)项的值是

From the sum of a geometric progression, the value of the (n)th term is

n*(power(10, n) - 1)/9

其中power(a, b)a提高到b次方.

这篇关于1 22 333 4444 55555的方程式序列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆