调和级数求和

级数 p级数 q级数 调和级数为什么叫做“调和”级数 等比数列求和公式和等差数列求和 斜率: 目录 调和级数为什么叫做“调和”级数 等比数列求和公式和等差数列求和 斜率: 调和级数为什么叫做“调和”级数 形如1/1+1/2+1/3+…+1/n+…的级数称为调和级数,它是 p=1 的p级数。 调和级数是发散级数。在zhin趋于无穷时其部分dao和没有极限(或部分和为无穷大)。 1 +1/2+1/3 +1/4 + 1/5+ 1/6+1/7+1/8 +... 1/2+1/2+(1/4+1/4)+(1/8+1/8+1/8+1/8)+...调和级数是一个发散的无穷级数。 这个级... 阅读详情

文章由 流星蝴蝶没有剑 提供

题目:

已知:Sn= 1+1/2+1/3+…+1/n。显然对于任意一个整数K,当n足够大的时候,Sn大于K。
现给出一个整数K(1<=k<=15),要求计算出一个最小的n;使得Sn>K。

输入:

k

输出;

n

打表AC

#include<stdio.h>
int main() {
	int n;
	int a[]= {1,2,4,11,31,83,227,616,1674,4550,12367,33617,91380,248397,675214,1835421};
	scanf("%d",&n);
	printf("%d\n",a[n]);
	return 0;
}

等效替代:
Sn ≈ ln(n+1) + r
Euler近似地计算了r的值,约为0.5772156649。

#include<stdio.h>
#include<math.h>
const double gamma_ = 0.5772156649;
int k, n;
int main(){
    scanf("%d", &k);
    n = exp(k - gamma_) + 0.5;
    printf("%d\n", n);
    return 0;
}

学习

基于 openEuler 24.03 LTS 源码编译安装 Zabbix 7.4 Zabbix是一款开源的企业级分布式监控系统,支持网络、服务器、应用等多种IT资源的监控。核心功能包括数据采集、告警通知、可视化展示等,采用Server/Agent架构,支持多种操作系统。本文详细介绍了在openEuler 24.03系统上部署Zabbix 7.4.2的完整流程,包括环境准备、MySQL配置、PHP/Apache安装、Zabbix编译安装等步骤,为构建企业级监控系统提供了实践指导。 阅读详情

相关推荐

Deep Reinforcement Learning - 1. DDPG原理和算法

Deep Reinforcement Learning - 1. DDPG原理和算法 背景描述 DDPG的定义和应用场景 DDPG算法相关基本概念定义 DDPG实现框架和算法 DDPG对于DPG的关键改进 下一篇 以下用RL作为Reinforcement Learning 的简称。背景描述概括来说,RL要解决的问

kenneth_yu的博客 14万+

调和级数近似求和公式推导

调和级数是一个非常著名的级数,对于调和级数我们有一个近似的求和公式: ∑i=1n1i=ln⁡(n+1)+γ(γ为欧拉常数,limn→∞γ=∫1n1⌊x⌋−1x约等于0.57721566490153286060651209,)\sum_{i=1}^n\frac{1}{i}=\ln(n+1)+\gamma(\gamma为欧拉常数,lim_{n\rightarrow\infty}\gamma=\int_...

一个蒟蒻的博客 2万+

cocos creator接入微信登陆sdk ios篇

cocos creator接入微信登陆sdk ios篇 背景已经在Android篇里面交代过了,有兴趣的朋友可以再看看Android篇 步骤 去微信开放平台下载ios平台所需要的sdk 在“info”标签栏的“URL type“添加“URL scheme”为你所注册的应用程序id 在“info”标签栏的“LSApplicationQueriesSchemes“添加weixin 将SDK文件中...

凤小鹿的博客 6364

调和级数求和(打表/欧拉常数) - Harmonic Number LightOJ - 1234

调和级数求和(打表/欧拉常数) - Harmonic Number LightOJ - 1234 题意: 计算调和级数前n项的和:计算调和级数前n项的和:计算调和级数前n项的和: Hn=1+12+13+...+1n=∑i=1n1iH_n=1+\frac{1}{2}+\frac{1}{3}+...+\frac{1}{n}=\sum_{i=1}^n\frac{1}{i}Hn​=1+21​+31​+...+n1​=i=1∑n​i1​ Input Input starts with an integer T (≤

njuptACMcxk的博客 3318

国密套件ECC-SM2-SM4-CBC-SM3和ECDHE-SM2-WITH-SM4-SM3

双方交换各自的公钥,最后A计算点(x1,y1) = d1Q2,B计算点(x2,y2) = d2Q1,由于椭圆曲线上是可以满足乘法交换和结合律,所以 d1Q2 = d1d2G = d2d1G = d2Q1 ,因此双方的 x 坐标是一样的,所以它是共享密钥,也就是会话密钥。4、客户端和服务端分别使用工作密钥,计算主密钥,客户端随机数,服务端随机数,字符串常量"key expansion",经PRF计算生成工作密钥。工作密钥包括加密密钥和校验密钥,具体密钥长度由选择的密码算法决定。客户端支持的压缩算法列表。

Java学习笔记 3795

华为手机连接Win11失败?内核隔离与驱动签名冲突的终极解决指南

在Windows操作系统中,驱动程序是硬件与系统通信的桥梁,其数字签名机制是保障系统内核安全的核心防线。基于虚拟化的安全技术通过强制验证驱动签名,能有效隔离恶意代码,提升系统抵御高级威胁的能力。然而,严格的签名策略有时会与部分硬件驱动产生兼容性问题,导致设备无法识别,直接影响文件传输、应用调试等核心工作流。本文聚焦于华为手机在开启Windows 11内核隔离功能时出现的连接故障,深入剖析驱动签名验证与Hypervisor保护的代码完整性原理,并提供从驱动更新、策略调整到无线替代方案的完整解决路径,帮助用户在

weixin_31309419的博客 363

【调和级数求和公式】【欧拉常数】I - Harmonic Number

题意:    求1+1/2+1/3+…+1/n 欧拉常数值:C≈0.57721566490153286060651209 求和公式:S(n)=ln(n)+C+1/(2*n) 公式只对n值很大的数有效 ( C++ cmath库中log(n)就是ln(n) ) #include<bits/stdc++.h> #include<iostream> #include&...

ZangWhe 5607

计算机组成原理实验二 运算器组成实验

事实上,ALU的设计是在全加器的基础上,对全加器功能的扩展来实现符合要求的多种算术/逻辑运算的功能。为了实现多种功能的运算,An、Bn数据是不能直接与全加器相连接的,它们受到功能变量F3—F1的制约,因此,可由An、Bn数据和功能变量F3-F1组合成新的函数Xn 、Yn,然后,再将Xn 、Yn和下一位进位Cn-1通过全加器进行全加运算以实现所需的运算功能。AC寄存器可用来存储ALU的输入以实现两个操作数的运算操作,也可以用来存储来自ALU的结果,以将这些结果反馈给ALU以进行更多的处理。

qq_63574533的博客 1454

初等数学 调和级数求和 精确计算

初等数学 调和级数求和 精确计算

rowangame的博客 946

基于深度学习YOLOv8的花卉检测与识别系统(附完整资源+PySide6界面+训练代码)

通过本项目,我们成功实现了基于YOLOv8的花卉检测与识别系统,涵盖了数据预处理、模型训练、推理与实时检测、以及GUI界面的实现。YOLOv8在花卉检测中的高效性和准确性为实际应用提供了强有力的支持。

斌擎科技 721

下采样优化实战:用ADown显著提升YOLOv11的多尺度特征保持能力

ADown 以“可编程梯度信息+多分支特征融合”打破了传统下采样的性能壁垒,为 YOLOv11 带来了多尺度特征的精准传递能力。从原理到代码集成,本教程已为你铺就了一条“小目标检测精度跃升”的实战路径。现在就动手尝试吧——当你看到模型对极小目标也能精准识别,且特征图细节完整时,你会明白这份技术探索的价值。我很乐意在你实践过程中帮你解决任何问题,让我们一起推动目标检测在下采样领域的边界。

FJN110的博客 425

C++做调和级数求和

C++做调和级数求和

Thj20232024的博客 1697

图解电动汽车:电动汽车主要参数

动力性指标 汽车的动力性指标主要有最高车速、加速时间、最大爬坡等,体现了汽车在行驶过程中能达到的极限运动水平。对于电动汽车,其动力性由搭载的驱动电动机决定,主要的参数包括最大扭矩、额定功率、最大功率、最大转速等。 功率是指物体在单位时间内所做的功的多少,是描述做功快慢的物理量,单位是 kW。 扭矩是指机械元件转动的力矩,也称转矩,表示转动力量的大小,单位是 N·m。 转速是指发动机/电动机的转速,的单位是 rpm,即转每分钟。额定转速是指在额定功率下电动机的转速,最大转速则是在最大功率下电动机的转速。

程序员「阿基米东」的编程之旅 2万+

18991 实验1.2 调和级数求和

求调和级数前k项之和(1+1/2+1/3+...+1/k),输入整数k>0,输出两种调和级数前k项和,前一种是从左到右求和;x1(实数,k1项调和级数从左到右求和) y1(实数,k1项调和级数从右到左求和)x2(实数,k2项调和级数从左到右求和) y2(实数,k2项调和级数从右到左求和)xm(实数,km项调和级数从左到右求和) ym(实数,km项调和级数从右到左求和)k1(整数,调和级数项数)k2(整数,调和级数项数)km(整数,调和级数项数)m(整数,实验数据总数)

Garson的博客 897

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

探索Java编程:计算调和级数、求和公式及奇数和

在这篇博客中,我们介绍了三个简单的Java程序,分别用于计算调和级数、求和公式和奇数和。通过这些实例,我们学习了如何使用Java编写程序,以及如何从控制台读取数据、使用循环结构和条件语句。在我们的第一个Java程序中,我们将计算调和级数。通过这三个实例,我们将深入了解Java编程的基本概念和技巧,包括数据输入、循环结构和条件语句。在我们的第二个Java程序中,我们将计算一个简单的求和公式。在我们的第三个Java程序中,我们将计算奇数和。然后,我们使用一个for循环计算求和公式的和。在这个程序中,我们使用。

2301_80292632的博客 790

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

编程练习:调和级数求和

计算调和级数前N项和,结果是一个准确的分数A/B形式 思路:前n-1项和化简为最简分数,再跟第n项进行求和 //计算调和级数1/p前N项和,结果是一个准确的A/B的形式 //求和过程中求最小公倍数 最大公约数,化简求和 #include<stdio.h> #define N 5 int main(){ int a,b;//a是sumb,b是p int m,n;//m最大公...

一颗胡萝卜的秘密基地 7716

LightOJ1234调和级数求和公式

1234 - Harmonic Number     PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB In mathematics, the nth harmonic number is the sum of the

Uniontake 4003

LightOJ 1234(调和级数、有通项公式的发散数列求和)

调和级数求和(1/1+1/2+1/3+……..+1/n) 可用于大数有通项公式的求和计算利用分组来平衡内存和时间

tick_tock97的博客 2033

Light OJ-1234-调和级数求和(just处理)

哇,这个题在紫书上有一个公式,但是只有n很大的时候才能满足精度,于是看了题解。 题解乍一看,哇,好高端,调和级数!仔细一看就是处理了下打表.... #include #include #include #include #include #include using namespace std; const int mod=100;//每100个分成一组,存在一个数组元素里,根

alusang的博客 978

LightOj 1234(调和级数求和)

lightoj 1234题目大意:调和级数求和,即:ans=∑i=1n1ians = \displaystyle \sum_{i = 1}^n{1 \over i}思路:分段打标分别求出1∼100,101∼200,…1e8100−99∼1e81001 \sim 100, 101 \sim 200, \dots \displaystyle{{1e8} \over 100} -99 \sim {{1e8

伪伪的喵喵。。 1034

Harmonic Number 调和级数求和

链接 题意:多次询问求Hn 解法:当n>1e6时 使用求和公式: C≈0.57721566490153286060651209 当n<=1e6 时,预处理求。 #include<bits/stdc++.h> using namespace std; int t; int n; double mp[1000004]; int main() { double hh=0; for(int i=1;i<=1000000;i++) { hh+=(doubl...

郭源潮 4549

LightOJ - 1234 Harmonic Number【调和级数求和】

In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem, you are given n, you have to find Hn. Input Input starts with an integer T

哇-WA 的博客 604
上一篇: 是个有趣的实验(10 interesting experiments)
下一篇: Java递归遍历文件夹
文+轩
博客等级 码龄8年 5854粉丝 154原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

文+轩

篮球弹弹弹

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值