欧拉函数

宝塔面板一键部署Z-Blog博客 - 内网穿透实现公网访问 Ubuntu系统作为Linux系统的一个重要分支,既有Linux系统的轻量化、高扩展性和长时间稳定运行,也拥有Windows一样的友好图形界面,因此可以作为熟悉服务器系统的良好选择。对于笔者来说,ubuntu系统最大的用处,就是可以让家里老旧的电脑重焕生机,让本已退居二线的电脑与cpolar内网穿透软件搭配,成为私人服务器,搭建自己喜欢的各种网站。今天,笔者就为大家介绍,如何使用cpolar内网穿透+Z-blog搭建私人博客网站。 阅读详情

这里面有详细的解释

/*线性筛O(n)时间复杂度内筛出maxn内欧拉函数值*/
int m[maxn],phi[maxn],p[maxn],pt;//m[i]是i的最小素因数,p是素数表,pt是素数个数,phi[i]是i的欧拉函数
int make()
{
    phi[1]=1;
    int k;
    for(int i=2;i<maxn;i++)
    {
        if(!m[i])//i是素数
            p[pt++]=m[i]=i,phi[i]=i-1;
        for(int j=0;j<pt&&(k=p[j]*i)<maxn;j++)
        {
            m[k]=p[j];
            if(m[i]==p[j])//为了保证以后的数不被再筛,要break
            {
                phi[k]=phi[i]*p[j];
/*这里的phi[k]与phi[i]后面的∏(p[i]-1)/p[i]都一样(m[i]==p[j])只差一个p[j],就可以保证∏(p[i]-1)/p[i]前面也一样了*/
                break;
            }
            else
                phi[k]=phi[i]*(p[j]-1);//积性函数性质,f(i*k)=f(i)*f(k)
        }
    }
}

单个数的欧拉值

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
LL get_eular(LL n)
{
    LL ans=n;
    for(int i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            ans-=ans/i;
            while(n%i==0)
                n/=i;
        }
    }
    if(n>1) ans-=ans/n;
    return ans;
}
int main()
{
    LL n;
    while(~scanf("%lld",&n))
    {
        printf("%lld\n",get_eular(n));
    }
}
Android功耗系列专题理论之十三:MTK平台待机功耗问题分析方法 摘要:本文详细分析了MTK平台待机功耗问题的调试方法,重点介绍了SPM电源管理机制、26M时钟控制逻辑以及系统深睡眠状态的判断标准。文章提供了完整的Debug流程,包括日志抓取、唤醒源分析、SCP睡眠状态检查以及时钟/LDO状态排查等实用技巧,并给出硬件漏电点和软件配置异常的排查方案。针对不同模块(Modem/Conn/SSPM等)提供了具体的电源管理绕过命令,适用于功耗问题调试和低功耗模式验证场景。 阅读详情

相关推荐

CANOCO5.0实现冗余分析(RDA)最详细步骤

在地理及生态领域会常使用RDA分析,RDA的实现路径也有很多,今天介绍一下CANOCO软件的实现方法。1.不同样点和环境因子之间夹角是锐角 是正相关,是钝角是负相关。2.夹角越大 说明相关性较小,夹角越小,相关性越大。得有不同的物种或者样点数值,再加上环境因子数据。3.箭头越长 相关性越大。时间调整到2010年。

Along6的博客 1万+

欧拉函数总结

欧拉函数可以直接打表,时间复杂度为O(nlognlogn); int euler(int n) { int ret=1; for(int i=2;i*i<=n;i++) { if(n%i==0) { n/=i;ret*=i-1; while(n%i==0) {n/=i;ret*=i;}

qq_33901573的博客 460

HDMI 2.1超高清传输背后的“隐形功臣”:深入浅出图解VESA DSC压缩核心流程

本文深入解析HDMI 2.1超高清传输中的VESA DSC压缩技术,揭示其如何在不损失画质的前提下实现带宽减半。通过切片并行处理和智能算法,DSC技术有效解决了8K/4K高帧率视频的传输瓶颈,成为现代显示设备不可或缺的“隐形功臣”。

weixin_30615767的博客 423

欧拉函数算法的实现

×pk−1pkϕ(n)=n×p1−1p1×p2−1p2×…所以 φ(pass)φ(psas) = passpsas - psas−1=pass∗(1−1ps)psas−1=psas∗(1−1ps)×pk−1pkϕ(n)=n×p1−1p1×p2−1p2×…算法的瓶颈主要在分解质因数上,分解质因数的时间复杂度为O(a√)O(a),但由于有n组数据,所以时间复杂度为O(a√∗n)O(a∗n)首先, 欧拉函数是一个积性函数,当m,nm,n互质时,φ(mn)=φ(m)∗φ(n)φ(mn)=φ(m)∗φ(n)

m0_63185171的博客 1289

Android Termux 安装Kali Linux 或 kali Nethunter史诗级详细教程

Termux 安装kali

风云小虾米的博客 6万+

酒店前台pms管理系统

对于酒店经营者来说,选择一款优秀的管理系统,是提升运营效率、优化客人体验的关键。PMS酒店管理系统凭借其强大的房态管理、实时数据监控、OTA直联、无人值守等功能,已经成为许多酒店提升管理水平的得力助手。无论是大中型酒店,还是小型民宿,PMS系统都能根据不同需求提供量身定制的解决方案,帮助酒店实现精细化管理、提高运营效率。如果你也在为酒店管理中的繁琐琐事而困扰,不妨尝试一下PMS酒店管理系统,感受科技带来的便利与高效,让你的酒店运营更上一层楼!

2409_89897808的博客 2482

欧拉函数算法

学习欧拉函数值和求欧拉函数表的个人笔记

释怀°Believe的博客 3391

Scratch离线版部署指南:解决资源缺失与页面显示异常问题

本文提供了一份详尽的Scratch离线版部署指南,旨在解决网络依赖导致的资源缺失与页面显示异常问题。通过从基础文件获取、自动化资源抓取到生产环境部署的完整流程,帮助教育工作者和开发者在无网络环境下搭建功能完整的本地Scratch编辑器,确保编程教学的顺利进行。

wine的专栏 1260

线性筛(时间复杂度o(n))+欧拉函数

用vector容易TLE。

qq_61594973的博客 249

2026年全国青少年信息素养大赛复赛真题(算法应用主题赛C++初中组:带解析)(7月4日试卷一)【文末附答案和解析】

2026年全国青少年信息素养大赛复赛真题(算法应用主题赛C++初中组:带解析)(7月4日试卷一)【文末附答案和解析】

王老师青少年编程 1732

【目标追踪】python背景模型减除法原理及其实现

python基于背景模型差法的视频目标追踪帧差法的问题:背景模型差法目标追踪原理1. 基本思路:2. 图例讲解:3. 存在的问题&如何解决:4. 最终效果预览第一步——调用摄像头:1. 使用opencv打开视频or摄像头:2. 读取逐帧图片:第二步——处理图片:1. 转换成灰度图:3. 累加权重重构背景:3. 计算像素差:3. 使用中值滤波和膨胀腐蚀去噪:3.1 中值滤波:3.2 图像腐蚀...

梁瑛平的博客 1947

欧拉函数求法与应用

欧拉函数在OI中是个非常重要的东西,不知道的话会吃大亏的. 欧拉函数用希腊字母φ表示,φ(N)表示N的欧拉函数. 对φ(N)的值,我们可以通俗地理解为小于N且与N互质的数的个数(包含1).

sentimental_dog的博客 3万+

使用 MATLAB/Simulink 构建一个基于FOC控制的PMSM矢量控制仿真模型

本教程详细介绍了基于Simulink的永磁同步电机(PMSM)磁场定向控制(FOC)仿真建模过程。主要内容包括:PMSM电机参数设置、Clarke/Park变换模块设计、电流环PID控制器构建、SVPWM调制实现等关键步骤。教程提供了完整的建模流程、参数配置建议和仿真调试方法,并给出了PID整定技巧和进阶优化方向。通过该模型,可深入理解PMSM矢量控制原理,掌握高性能电机控制系统的建模技术,为伺服系统、电动汽车驱动等应用领域提供仿真基础。教程还推荐了使用PIDTuner工具进行参数优化,并提出了加入负载扰动

amy_mhd的博客 643

欧拉函数最全总结

文章目录欧拉函数的内容一、欧拉函数的引入二、欧拉函数的定义三、欧拉函数的性质四、欧拉函数的计算方法(一)素数分解法(二)编程思维1.求n以内的所有素数2.求φ(n)3.格式化输出0-100欧拉函数表(“x?”代表十位数,“x”代表个位数)五、欧拉函数相关定理以及证明(一)定理1:缩系与欧拉函数的关系(二)定理2:缩系的充要条件(三)定理3:缩系拓展1. 简单证明:(a,m)=1,(x,m)=1,故(ax,m)=1。(四)定理4:设m>1,(a,m)=1,则aφ(m)≡1(mod m).1. **若ac≡bc

jiet07的博客 5万+

深度学习工具包 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")

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

【欧拉函数】 欧拉函数计算及打表

文章目录一.欧拉函数简介二.欧拉函数计算三.欧拉函数值打表 一.欧拉函数简介 在数论中,对正整数n,欧拉函数是小于或等于n的正整数中与n互质的数的数目(因此φ(1)=1)。此函数以其首名研究者欧拉命名(Euler’s totient function),它又称为Euler’s totient function、φ函数、欧拉商数等。 例如φ(8)=4,因为1,3,5,7均和8互质。 注:a,b互质即gcd(a,b)=1 二.欧拉函数计算 计算公式φ(n)=n⋅∏i=1k(1−1pi)φ(n)=n\cdot

Qiuker_jl的博客 1万+

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

数论 —— 欧拉函数

数论算法,欧拉函数公式推导 + 代码

qq_62018762的博客 3760

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

欧拉函数与筛法求欧拉函数

欧拉函数[欧拉函数的定义 欧拉函数的公式 欧拉函数的公式推导 欧拉定理] 筛法求欧拉函数

咸鱼势力登场 1749

Acwing 欧拉函数

欧拉函数,纯数学问题?

qq_43060884的博客 719

【数论】—— 欧拉函数

对于任意正整数nnn,欧拉函数φn\varphi(n)φn表示在不大于nnn的正整数中与nnn互素的数的个数。φ11φ11,即111。φ62φ62,即111555。φ124φ124,即111555777111111。怎样求出一个数的欧拉函数呢?公式呈上:对于任意正整数nnn,若nP1k1×P2k2×⋯×PmkmnP1k1​​×P2k2​​×⋯×Pmkm​。

Popandsoss2022的博客 1899

欧拉函数详解

欧拉函数详解 对一个正整数N,欧拉函数是小于N且与N互质的数的个数.。 例如φ(24)=8,因为1, 5, 7, 11, 13, 17, 19, 23均和 24 互质。 φ(n) = n*(1-1/p1)*(1-1/p2)*......(1-1/pn)   其中(p1.....pn)为N的素因子 欧拉函数的基本性质: ① N是不为0的整数。euler(1)=1(唯一和

大太阳 2万+
上一篇: Miller-Rabin随机性素数测试算法
下一篇: pollard_rho(大数质因子分解)
acmer_zp
博客等级 码龄11年 18粉丝 110原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值