偶数不定方程解组数函数.docx

上传人:b****8 文档编号:9008089 上传时间:2023-05-16 格式:DOCX 页数:19 大小:67.20KB
下载 相关 举报
偶数不定方程解组数函数.docx_第1页
第1页 / 共19页
偶数不定方程解组数函数.docx_第2页
第2页 / 共19页
偶数不定方程解组数函数.docx_第3页
第3页 / 共19页
偶数不定方程解组数函数.docx_第4页
第4页 / 共19页
偶数不定方程解组数函数.docx_第5页
第5页 / 共19页
偶数不定方程解组数函数.docx_第6页
第6页 / 共19页
偶数不定方程解组数函数.docx_第7页
第7页 / 共19页
偶数不定方程解组数函数.docx_第8页
第8页 / 共19页
偶数不定方程解组数函数.docx_第9页
第9页 / 共19页
偶数不定方程解组数函数.docx_第10页
第10页 / 共19页
偶数不定方程解组数函数.docx_第11页
第11页 / 共19页
偶数不定方程解组数函数.docx_第12页
第12页 / 共19页
偶数不定方程解组数函数.docx_第13页
第13页 / 共19页
偶数不定方程解组数函数.docx_第14页
第14页 / 共19页
偶数不定方程解组数函数.docx_第15页
第15页 / 共19页
偶数不定方程解组数函数.docx_第16页
第16页 / 共19页
偶数不定方程解组数函数.docx_第17页
第17页 / 共19页
偶数不定方程解组数函数.docx_第18页
第18页 / 共19页
偶数不定方程解组数函数.docx_第19页
第19页 / 共19页
亲,该文档总共19页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

偶数不定方程解组数函数.docx

《偶数不定方程解组数函数.docx》由会员分享,可在线阅读,更多相关《偶数不定方程解组数函数.docx(19页珍藏版)》请在冰点文库上搜索。

偶数不定方程解组数函数.docx

偶数不定方程解组数函数

偶数不定方程的图解

Autocad数组解点集图2n=p1+p2

方程解组数函数

毎一个偶数都存在几组点集解,对于任意偶数它的解有几组,下面函数就是,但是原函数

无法用一般的公式表达,我们采用函数逼近法,来大致了解它的增减性,方程解数组函数,大致可以用一下公式确定。

上图是890内所有偶数的解函数图像,更多需要超级计算机才可以运行程序。

以下是excelvba方程解程序

本程序可解950万内偶数不定方程,但是每次不可数量太多,对于小数可以把qp()函数中s值去掉一部分,运算速度可以快以些,但是也不会太快,因为运算次数成几何级递增。

难度比素数筛选难得太多。

以上方程解函数也是通过程序求解后归纳出来的,下面函数QZ(N)就是求方程解中有几个合条件的素数个数。

解得组数为

,这是解函数的原函数。

SZU(N,i)是2n内第i个素数。

SZ(2n)是2n内所有素数个数,BK(N,i)是解中第i个素数,同时2n-BK(N,i)也是方程的解。

FunctionSZU(NAsVariant,KAsVariant)AsVariant

DimMyArray()AsVariant

DimArr()AsString

DimTemp()AsString

DimiAsVariant

DimrAsVariant

DimjAsVariant

DimmAsVariant

DimdAsVariant

m=N/2

ReDimMyArray(m)

Fori=1Tom

MyArray(i)=pm(2*i)

Nexti

OnErrorResumeNext

Forj=1Tom

Temp=Filter(Arr,MyArray(j))

IfUBound(Temp)<0Then

r=r+1

ReDimPreserveArr(1Tor)

Arr(r)=MyArray(j)

EndIf

Next

SZU=Arr(K)

EndFunction

Functionpm(yAsVariant)AsVariant

DimdAsVariant

DimfAsVariant

d=3.14159265358979

f=nk(y)-2

Iff=-1Then

pm=1:

GoTobb

EndIf

Iff=0Then

pm=3:

GoTobb

EndIf

Iff>=1Then

f=f:

pm=3*f+3*(Sin(0.5*d*f))^2+(-1)^f:

GoToAA

Else

GoTobb

EndIf

AA:

pm=pm

Ifqp(pm)=0Then

f=f-1:

pm=3*f+3*(Sin(0.5*d*f))^2+(-1)^f:

GoTocc

Else

f=f:

pm=3*f+3*(Sin(0.5*d*f))^2+(-1)^f:

GoTobb

EndIf

cc:

pm=pm

Ifqp(pm)=0Then

f=f-1:

pm=3*f+3*(Sin(0.5*d*f))^2+(-1)^f:

GoToAA

Else

f=f:

pm=3*f+3*(Sin(0.5*d*f))^2+(-1)^f:

GoTobb

EndIf

bb:

pm=pm

Iff=-1Then

pm=1

EndIf

Iff=0Then

pm=3

EndIf

Iff>=1Then

pm=pm

EndIf

Ifpm=0Then

pm=1

Else

pm=pm

EndIf

pm=pm

EndFunction

Functionnk(NAsVariant)AsVariant

DimdkAsVariant

DimckAsVariant

dk=N-1

IfdkMod6=5Then

ck=1+2*Int((dk+1)/6)

EndIf

IfdkMod6<>5Then

ck=2+2*Int((dk-1)/6)

EndIf

ck=ck

IfN=2Then

ck=1

Else

ck=ck

EndIf

nk=ck

EndFunction

FunctionSZ(NAsVariant)AsVariant

DimMyArray()AsVariant

DimArr()AsString

DimTemp()AsString

DimiAsVariant

DimAAsVariant

DimrAsVariant

DimjAsVariant

DimmAsVariant

DimdAsVariant

A=N/2

ReDimMyArray(A)

Fori=1ToA

MyArray(i)=pm(2*i)

Nexti

OnErrorResumeNext

Forj=1ToA

Temp=Filter(Arr,MyArray(j))

IfUBound(Temp)<0Then

r=r+1

ReDimPreserveArr(1Tor)

Arr(r)=MyArray(j)

EndIf

Next

SZ=UBound(Arr)

EndFunction

Functionqf(NAsVariant,iAsVariant)AsVariant

Ifi<=SZ(N)Then

i=i

Else

i=SZ(N)

EndIf

i=i

qf=i

EndFunction

FunctionBk(BAsVariant,KAsVariant)AsVariant

IfK<=SZ(B)Then

K=K

Else

K=SZ(B)

EndIf

K=K

Bk=B-SZU(B,SZ(B)-K+1)

Ifqp(Bk)>0Then

Bk=Bk

Else

Bk=""

EndIf

Bk=Bk

EndFunction

FunctionQZU(NAsVariant,KAsVariant)AsVariant

DimMyArray()AsVariant

DimArr()AsString

DimTemp()AsString

DimiAsVariant

DimrAsVariant

DimjAsVariant

DimmAsVariant

DimdAsVariant

m=SZ(N)

ReDimMyArray(m)

Fori=1Tom

MyArray(i)=Bk(N,i)

Nexti

OnErrorResumeNext

Forj=1Tom

Temp=Filter(Arr,MyArray(j))

IfUBound(Temp)<0Then

r=r+1

ReDimPreserveArr(1Tor)

Arr(r)=MyArray(j)

EndIf

Next

QZU=Arr(K)

EndFunction

FunctionQZ(NAsVariant)AsVariant

DimMyArray()AsVariant

DimArr()AsString

DimTemp()AsString

DimiAsVariant

DimrAsVariant

DimjAsVariant

DimmAsVariant

DimmHAsVariant

DimdAsVariant

m=SZ(N)

ReDimMyArray(m)

Fori=1Tom

MyArray(i)=Bk(N,i)

Nexti

OnErrorResumeNext

Forj=1Tom

Temp=Filter(Arr,MyArray(j))

IfUBound(Temp)<0Then

r=r+1

ReDimPreserveArr(1Tor)

Arr(r)=MyArray(j)

EndIf

Next

QZ=UBound(Arr)

IfN=4Then

mH=3

Else

mH=QZ

EndIf

mH=mH

QZ=mH

EndFunctionFunctionp(mAsVariant,NAsVariant)AsVariant

IfN>=mThen

p=1

EndIf

Ifm/N=Int(m/N)AndN

p=0

Else

p=1

EndIf

EndFunction

Functionqp(mAsVariant)AsVariant

DimsyAsLong

DimsAsLong,s1AsLong,s2AsLong,s3AsLong,s4AsLong,s5AsLong,s6AsLong

Dims7AsLong,s8AsLong,s9AsLong,s10AsLong,s11AsLong,s12AsLong,s13AsLong

Dims14AsLong,s15AsLong,s16AsLong,s17AsLong,s18AsLong,s19AsLong

Dims20AsLong,s21AsLong,s22AsLong,s23AsLong,s24AsLong,s25AsLong

Dims26AsLong,s27AsLong,s28AsLong,s29AsLong,s30AsLong,s31AsLong

s=p(m,61)*p(m,67)*p(m,71)*p(m,73)*p(m,79)*p(m,83)*p(m,89)*p(m,97)

s1=p(m,101)*p(m,103)*p(m,107)*p(m,109)*p(m,113)*p(m,127)*p(m,131)*p(m,137)*p(m,139)*p(m,149)*p(m,151)*p(m,157)*p(m,163)*p(m,167)*p(m,173)*p(m,179)*p(m,181)*p(m,191)

s2=p(m,193)*p(m,197)*p(m,199)*p(m,211)*p(m,223)*p(m,227)*p(m,229)*p(m,233)*p(m,239)*p(m,241)*p(m,251)*p(m,257)*p(m,263)*p(m,269)*p(m,271)*p(m,277)*p(m,281)*p(m,283)

s3=p(m,293)*p(m,307)*p(m,311)*p(m,313)*p(m,317)*p(m,331)*p(m,337)*p(m,347)*p(m,349)*p(m,353)*p(m,359)*p(m,367)*p(m,373)*p(m,379)*p(m,383)*p(m,389)*p(m,397)*p(m,401)

s4=p(m,409)*p(m,419)*p(m,421)*p(m,431)*p(m,433)*p(m,439)*p(m,443)*p(m,449)*p(m,457)*p(m,461)*p(m,463)*p(m,467)*p(m,479)*p(m,487)*p(m,491)*p(m,499)*p(m,503)*p(m,509)

s5=p(m,521)*p(m,523)*p(m,541)*p(m,547)*p(m,557)*p(m,563)*p(m,569)*p(m,571)*p(m,577)*p(m,587)*p(m,593)*p(m,599)*p(m,601)*p(m,607)*p(m,613)*p(m,617)*p(m,619)*p(m,631)

s6=p(m,641)*p(m,643)*p(m,647)*p(m,653)*p(m,659)*p(m,661)*p(m,673)*p(m,677)*p(m,683)*p(m,691)*p(m,701)*p(m,709)*p(m,719)*p(m,727)*p(m,733)*p(m,739)*p(m,743)*p(m,751)

s7=p(m,757)*p(m,761)*p(m,769)*p(m,773)*p(m,787)*p(m,797)*p(m,809)*p(m,811)*p(m,821)*p(m,823)*p(m,827)*p(m,829)*p(m,839)*p(m,853)*p(m,857)*p(m,881)*p(m,883)*p(m,857)

s8=p(m,859)*p(m,863)*p(m,877)*p(m,907)*p(m,911)*p(m,919)*p(m,929)*p(m,937)*p(m,941)*p(m,947)*p(m,953)*p(m,967)*p(m,971)*p(m,977)*p(m,983)*p(m,991)*p(m,997)*p(m,1009)

s9=p(m,1013)*p(m,1019)*p(m,1021)*p(m,1031)*p(m,1033)*p(m,1039)*p(m,1049)*p(m,1051)*p(m,1061)*p(m,1063)*p(m,1069)*p(m,1087)*p(m,1091)*p(m,1093)*p(m,1097)*p(m,1103)*p(m,1109)

s10=p(m,1303)*p(m,1307)*p(m,1217)*p(m,1223)*p(m,1117)*p(m,1123)*p(m,1129)*p(m,1151)*p(m,1153)*p(m,1163)*p(m,1171)*p(m,1181)*p(m,1187)*p(m,1193)*p(m,1201)*p(m,1213)*p(m,1229)

s11=p(m,1231)*p(m,1237)*p(m,1249)*p(m,1259)*p(m,1277)*p(m,1279)*p(m,1283)*p(m,1289)*p(m,1291)*p(m,1297)*p(m,1301)*p(m,1319)*p(m,1321)*p(m,1327)*p(m,1361)*p(m,1367)*p(m,1373)

s12=p(m,1381)*p(m,1399)*p(m,1409)*p(m,1423)*p(m,1427)*p(m,1429)*p(m,1433)*p(m,1439)*p(m,1447)*p(m,1451)*p(m,1453)*p(m,1459)*p(m,1471)*p(m,1481)*p(m,1483)*p(m,1487)*p(m,1489)

s13=p(m,1493)*p(m,1499)*p(m,1511)*p(m,1523)*p(m,1531)*p(m,1543)*p(m,1549)*p(m,1553)*p(m,1559)*p(m,1567)*p(m,1571)*p(m,1579)*p(m,1583)*p(m,1597)*p(m,1601)*p(m,1607)*p(m,1609)

s14=p(m,1613)*p(m,1619)*p(m,1621)*p(m,1627)*p(m,1637)*p(m,1657)*p(m,1663)*p(m,1667)*p(m,1669)*p(m,1693)*p(m,1697)*p(m,1699)*p(m,1709)*p(m,1721)*p(m,1723)*p(m,1733)*p(m,1741)

s15=p(m,1747)*p(m,1753)*p(m,1759)*p(m,1777)*p(m,1783)*p(m,1787)*p(m,1789)*p(m,1801)*p(m,1811)*p(m,1823)*p(m,1831)*p(m,1847)*p(m,1861)*p(m,1867)*p(m,1871)*p(m,1873)*p(m,1877)

s16=p(m,1879)*p(m,1889)*p(m,1901)*p(m,1907)*p(m,1913)*p(m,1931)*p(m,1933)*p(m,1949)*p(m,1951)*p(m,1973)*p(m,1979)*p(m,1987)*p(m,1993)*p(m,1997)*p(m,1999)*p(m,2003)*p(m,2011)

s17=p(m,2017)*p(m,2027)*p(m,2029)*p(m,2039)*p(m,2053)*p(m,2063)*p(m,2069)*p(m,2081)*p(m,2083)*p(m,2087)*p(m,2089)*p(m,2099)*p(m,2111)*p(m,2113)*p(m,2129)*p(m,2131)*p(m,2137)

s18=p(m,2141)*p(m,2143)*p(m,2153)*p(m,2161)*p(m,2179)*p(m,2203)*p(m,2207)*p(m,2213)*p(m,2221)*p(m,2237)*p(m,2239)*p(m,2243)*p(m,2251)*p(m,2267)*p(m,2269)*p(m,2273)*p(m,2281)

s19=p(m,2287)*p(m,2293)*p(m,2297)*p(m,2309)*p(m,2311)*p(m,2333)*p(m,2339)*p(m,2341)*p(m,2347)*p(m,2351)*p(m,2357)*p(m,2371)*p(m,2377)*p(m,2381)*p(m,2383)*p(m,2389)*p(m,2393)

s20=p(m,2399)*p(m,2411)*p(m,2417)*p(m,2423)*p(m,2437)*p(m,2441)*p(m,2447)*p(m,2459)*p(m,2467)*p(m,2473)*p(m,2477)*p(m,2503)*p(m,2521)*p(m,2531)*p(m,2539)*p(m,2543)*p(m,2549)

s21=p(m,2551)*p(m,2557)*p(m,2579)*p(m,2591)*p(m,2593)*p(m,2609)*p(m,2617)*p(m,2621)*p(m,2633)*p(m,2647)*p(m,2657)*p(m,2659)*p(m,2663)*p(m,2671)*p(m,2677)*p(m,2683)*p(m,2687)

s22=p(m,2689)*p(m,2693)*p(m,2699)*p(m,2707)*p(m,2711)*p(m,2713)*p(m,2719)*p(m,2729)*p(m,2731)*p(m,2741)*p(m,2749)*p(m,2753)*p(m,2767)*p(m,2777)*p(m,2789)*p(m,2791)*p(m,2797)

s23=p(m,2801)*p(m,2803)*p(m,2819)*p(m,2833)*p(m,2837)*p(m,2843)*p(m,2851)*p(m,2857)*p(m,2861)*p(m,2879)*p(m,2887)*p(m,2897)*p(m,2

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2