/*****************************************************************************/ /* http://www.research.att.com/~njas/sequences/primestats.c.txt */ /* */ /* Coded by Antti Karttunen (Antti.Karttunen(-AT-)iki.fi), May-June 2004, */ /* except the prime sieve part (functions compute_primes and assorted */ /* clear_one_mask_bit and test_one_mask_bit in the end of this source file) */ /* which are copyright 1999-2004 by John Moyer, (jrm(-AT-)rsok.com), */ /* http://www.rsok.com/~jrm/ */ /* */ /* This program computes the sequences A095005 - A95024 & A095051 - A095095 */ /* that are found in */ /* Neil Sloane's On-Line Encyclopedia of Integer Sequences (OEIS) */ /* available at */y/*http://www.研究/Atj./Njas/Stords/*/y/**/*/*:如果我们想计算比33高或大于*/y/*,我们应该实现一些概率质检算法,*/y/*,可能要慢一些,但几乎不需要RAM。*/y/**/y/*如果你添加了自己的添加,请将改进的源发送回*/y/*MeangT.Karttunen(-AT)IK.Fi,这样我就可以在NJAS(-AT)研究中向Neil Sloane发送更新的版本*/y/*。*/y/*//*编辑第二次6月4日2004,由Antti Karttunen:*/y/*计算44个新序列,在范围*/y/*A095280-A09598,A095312A095336&A095353-A095354。*/y/**/y/*编辑了第三次6月12日2004,由Antti Karttunen。在范围A09530A9760范围内*/y/*序列。*//*/*/*/******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************#包括#包括#包括#包括Antti Karttunen的这一部分。收集某些*/y/* OEIS序列的统计数据。*//*/*/**/**/*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/y.TyPulf未签名的long int uli;/*纯32,没有Frices。*/ /* Pointer to function that accepts an ULLI and returns an ULLI. */ typedef ULLI (*ULLIFUN)(ULLI); int glob_dyckness_checked_only_up_to_n = 16; #define power_of_2(i) (((ULLI)1) << (i)) /* See the section "Number Conversion" at the end of the excerpt: http://www.iki.fi/kartturi/matikka/kl10exmp.txt */ int fprint_ulli(FILE *fp,ULLI x) { int s = 0; if(x >= 10) { s = fprint_ulli(fp,(x/((ULLI)10))); } fputc(('0' + (x%((ULLI)10))),fp); return(s+1); } /* Max exp-value 63 is surely enough. Nobody will compute up to that many terms in the foreseeable future. */ #define vec65zeros { 0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0 }; #define vec128zeros { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; /* Like above, but we have prefilled the position 1 of the vector with the first prime 2, so that the prime_found continues filling it from the position 2. (Because out starting point is 3, as to avoid handling of the unique even prime 2. */ #define vec128_with_initial_2 \ { 1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; /* (fibo 93) = 12200160415121876738 is the last Fibonacci less than 18446744073709551616 as (fibo 94) = 19740274219868223167. */ #define COMPUTE_FIBOS_UP_TO 93 ULLI vecA000045[128] = vec128zeros; /* Fibonacci numbers. 预先计算它们!*/y]定义A000(45)(n)(VECA000)[V](128)=VEC128Z0OS;/* Fibbinary数。计算一个样本。*/ULLI VECA037 88[ 128 ]=VEEC128ZOLOS;/*也适用于此。**,这应该叫第一!CuffTeTi FibasytoTo-向量(ULL*VEC,int UtotoSn){V}(0)=0;VEC(1)=1;(i=2;i<= UtotoSn;i++){VEC[i]=VEC[I-1 ] +VEC[I-2 ];} } */空预裂*/y*·/*注意到,当n=0时,当In=0时,循环结束,作为A00 00 45(0)=0 */*;(n<A000)({N00);}返回(In);{} ULLI A000 314(ULI Orthin){{ULLIN=OrgIn n;= 0) { int i = index_of_largest_fibo_present(n); n -= A000045(i); if(i > (63+2)) { /* We are interested only about the three least significant fibits, thus we can safely ignore the higher fibits, especially if they would corrupt the result because of index wrap-over: */ fprintf(stderr,"A003714("); fprint_ulli(stderr,n); fprintf(stderr,") resulted a fib-index %u > 65, ignored.\n",i); } else { z |= power_of_2(i-2); } } return(z); } void fill_vector_with_fun(ULLI *vec,int upto_n,ULLIFUN fun) { int i; for(i=0; i <= upto_n; i++) { vec[i] = (fun)((ULLI)i); } } ULLI vecA036378[65] = vec65zeros; /* Here are the 20 A-numbers you requested: 95005 --- 95024. 这里是你所要求的60个A数字:95052—95111。这里是你所要求的30个A数字:95269—95298。这里是你所要求的25个A数字:95312—95336。这里是你所要求的12个A数字:95353—95364。这里是你所要求的37个A数字:95730—95766。*/ui Vula09500 5〔65〕=VEC65 0;*/uuli vECA09566〔65〕=VEC65零点;/**的邪恶素数(A027 699)。*/ui VICA026697〔128〕=VEC128Ia;*/ULLI VECA026699〔128〕=VEC128ZOLOS;/*邪恶素数。*/U.L.Vula09507〔65〕=VEC65零;/*素数为4K+1。*/ULLI VECA09500 8〔65〕=VEC65零;/*素数为4K+3。*/uiLi VECA09500 9〔65〕=VEC65零;/*素数为8K+1形式。*/ULLI VECA095010〔65〕=VEC65零;/*素数为8K+3形式。*/ULLI VECA095011〔65〕=VEC65零;/*素数为8K+5形式。*/ULLI VECA095012〔65〕=VEC65零;/*素数为8K+7形式。*/uiLi VECA095013〔65〕=VEC65零;/*素数为8k+- 1。*/ULLI VECA095014〔65〕=VEC65零;/*素数为8k+- 3。*/uiLi VECA095015〔65〕=VEC65零;/*素数为6K+1。*/ULLI VECA095016〔65〕=VEC65零;/*素数为6K+5。*/U.L.VECA095017[ 65 ]=VEC65零点;/*较小孪生素数(小于A095016)。*/U.L.VECA095018〔65〕=VEC65零;/*二元平衡素数(A066 196)。*/U.L.VECA095052〔65〕=VEC65零;;*/ULLI VECA095053〔65〕=VEC65零;/**素数,比0位多一个1。*/U.L.Vula095056〔65〕=VEC65零;/*素数为三个1位(A081091)。*/ULLI VECA095057〔65〕=VEC65零;/*素数为四个1位(A095077)。*/ui Vula095058〔65〕=VEC65零;(A095078)*// ULLI VECA095059〔65〕=VEC65零;/**素数,只有2个0位。(A095079)*/YLI ULLI VECA095060〔65〕=VEC65零;/*αFiBeEn素数(A095080)。*/ULLI VECA095080〔128〕=VEC128Ia,I/FiBEVEN素数。*/ui Vula095061〔65〕=VEC65零点;/** FiBODD素数(A095081A)。*/ULLI VECA095081[ 128 ]=VEC128Z0OS;/*FIBOD素数。*/U.L.VECA095062〔65〕=VEC65 0;*/ULLI VECA095082[ 128 ]=VEC128Ne0OS;/*FiB00素数。*/U.L.VECA095063〔65〕=VEC65零点;/*πFibdiy素数(A095083])。*/ULLI VECA095083[ 128 ]=VEC128II-α起始;*/U.L.VECA095064〔65〕=VEC65 0;*/ULLI VECA095084[ 128 ]=VEC128NeLOS;/*FiBevIL素数。*/U.L.VECA095065〔65〕=VEC65零;/*αFiB000素数(A095085)。*/ULLI VECA095085〔128〕=VEC128Ne0OS;/*FiB000素数。*/U.L.VECA095066〔65〕=VEC65 0;*/ULLI VECA095086[ 128 ]=VEC128NeLOS;/*FiB01素数。*/U.L.VECA095067〔65〕=VEC65 0;*/ULLI VECA09508[ 128 ]=VEC128NeLOS;/*FiB010素数。*/U.L.VECA095068〔65〕=VEC65零;/*αFiB100素数(A095088)。*/ULLI VECA095088〔128〕=VEC128ZOLOS;/*FIB100素数。*/Ui LIVICA095069[ 65 ]=VEC65零;/** FIb101素数(A095089]。*/ULLI VECA095089[ 128 ]=VEC128NeLOS;/*FiB101素数。*/μi Vula095021〔65〕=VEC65零;/*形式为5k+ 1的素数。*/ULLI VECA095022〔65〕=VEC65零;/*形式为5K+ 2的素数。*/ULLI VECA095023〔65〕=VEC65零;/*形式为5K+ 3的素数。*/ULLI VECA095024〔65〕=VEC65零;/*形式为5K+ 4的素数。*/U.L.Vula095072〔128〕=VEC128ZeNOS;/*素数为0比1位。*/ULLI VECA095073[ 128 ]=VEEC128ZOLOS;/*素数,比0位多一个1。*/U.L.Vula095077〔128〕=VEC128Ne0OS;/*素数为四个1位。*/ULLI VECA095078 [ 128 ]=VEC128Ia,带有初始0位;/*素数,具有单个0位。*/ULLI VECA095079〔128〕=VEC128Ne0OS;/*素数,具有两个0位。ULLI VECA095090〔65〕=4K+3个NUs,具有Motzkin路径*/ULLI VECA095100〔128〕=VEC128ZOLOS;/*4K+ 3 N W/雅可比VEC=MoTZKIN路径*//ULLI VECA095091〔65〕=VEC65零;/*数为4K+3 N W/OUT Motzkin路径*// ULLI VECA095101[128 ]=VEEC128ZOLOS;/*4K+3 N W/Jacobi vec!*= MoTZKIN路径*//ULLI VECA095109〔65〕=VEC65零;/*和A095269*/YULIVECA0951 10〔65〕=VEC65零;/*和A095270*/OLLI VECA095269〔128〕=VEC128NeNOS;/*潜水指数为4N+1。*/ULLI VECA095270〔128〕=VEEC128ZOLOS;/* Max Motzkin路径前缀为4N+ 1。*/ULLI VECA095171〔128〕=VEC128NeNOS;/*第N A095101潜水指数。*/U.L.VECA095222〔128〕=VEC128Ne0OS;/*(A095102(n)- 3)/ 4。*/ULLI VECA095263〔128〕=VEC128Ne0OS;/*(A095103(n)- 3)/ 4。*/ULLI VECA095244〔128〕=VEC128Ne0OS;/*(A095100(n)- 3)/ 4。*/ULLI VECA095255〔128〕=VEC128Ne0OS;/*(A095101(n)- 3)/ 4。*/ui Vula095092〔65〕=VEC65零点;/*数A095102素数。*/ULLI VECA095102〔128〕=VEC128NeNOS;/*4K+ 3 Pr。W/勒让德VEC=Dyk PATH*//Yuli VECA095093[ 65 ]=VEC65零;/*数A095103素数。*/ULLI VECA095103〔128〕=VEC128Ne0OS;/*4K+ 3 PR.W/勒让德VEC!=Dyk Prime*//ULLI VECA095104〔128〕=VEC128ZOLOS;/*第n次潜水指数(A00 2145)。*/ULLI VECA095105〔128〕=VEC128Z0OS;/* Max Dyck路径前缀为第N A000 2145。*/ULLI VECA095106〔65〕=VEC65零点;/*和A095104。*/ULLI VECA095107〔65〕=VEC65零点;/*和A095105。*/ULLI VECA095108〔128〕=VEC128NeNOS;/*第N A095103潜水指数。*/ui VICA095094[ 65 ]=VEC65零点;/*数A080114素数。*/ULLI VECA080114〔128〕=VEEC128ZOLOS;/*素数为有效Dyk路径。*/ui Vula095095〔65〕=VEC65零点;/*数A080115素数。*/ULLI VECA080115〔128〕=VEC128Ia,而不是A080114。*/uiLi VECA095280〔128〕=VEC128Z0OS;/*素数在A000 0201中。*/ULLI VECA095290〔65〕=VEC65 0;*/ULLI VECA09591[ 65 ]=VEC65零;{ULLI VECA095228〔128〕=VEC128IY为x起始Al2;;ULLI VECA09529 2〔65〕=VEC65 0;;ULLIVECA09523[ 128 ]=VEC128Ne0SO;/*素数在A079523中。*/ ULLI vecA095293[65] = vec65zeros; ULLI vecA095320[128] = vec128_with_initial_2; /* #1-bits > #0-bits - 3 */ ULLI vecA095330[65] = vec65zeros; ULLI vecA095321[128] = vec128zeros; /* #1-bits <= #0-bits - 3 */ ULLI vecA095331[65] = vec65zeros; ULLI vecA095316[128] = vec128_with_initial_2; /* #1-bits > #0-bits - 2 */ ULLI vecA095326[65] = vec65zeros; ULLI vecA095317[128] = vec128zeros; /* with #1-bits <= #0-bits - 2 */ ULLI vecA095327[65] = vec65zeros; ULLI vecA095074[128] = vec128_with_initial_2; /* #1-bits > #0-bits - 1 */ ULLI vecA095054[65] = vec65zeros; /* # Primes that are not zero-dominant. */ui VICA095071[ 128 ]=VEC128Ne0OS;/** 1比特<=0 0比特- 1。*/ULLI VECA095019〔65〕=VEC65零点;/**零位显性素数(A095071)。*/Ui LIVLIVCA095070〔128〕=VEC128Ne0OS;/** 1位>0位。1位占优。*/ULLI VECA095020〔65〕=VEC65零点;/*1位显性素数(A095070)。*/ui Vula095075〔128〕=VEC128Ia为起始起始2;/*非1位显性素数。*/ULLI VECA095055〔65〕=VEC65零;*/ ULLI vecA095286[128] = vec128zeros; /* Primes with #1-bits > #0-bits + 1 */ ULLI vecA095296[65] = vec65zeros; ULLI vecA095287[128] = vec128_with_initial_2; /* with #1-bits <= #0-bits + 1 */ ULLI vecA095297[65] = vec65zeros; ULLI vecA095314[128] = vec128zeros; /* Primes with #1-bits > #0-bits + 2 */ ULLI vecA095334[65] = vec65zeros; ULLI vecA095315[128] = vec128_with_initial_2; /* with #1-bits <= #0-bits + 2 */ ULLI vecA095335[65] = vec65zeros; ULLI vecA095318[128] = vec128zeros; /* Primes with #1-bits > #0-bits + 3 */ ULLI vecA095328[65] = vec65zeros; ULLI vecA095319[128] = vec128_with_initial_2; /* with #1-bits <= #0-bits + 3 */ ULLI vecA095329[65] = vec65zeros; ULLI vecA095322[128] = vec128zeros; /* Primes with #1-bits > #0-bits + 4 */ ULLI vecA095324[65] = vec65zeros; ULLI vecA095323[128] = vec128_with_initial_2; /* with #1-bits <= #0-bits + 4 */ ULLI vecA095325[65] = vec65zeros; ULLI vecA095284[128] = vec128zeros; /* Primes with #1-bits > #0-bits + 5 */ ULLI vecA095294[65] = vec65zeros; ULLI vecA095285[128] = vec128_with_initial_2; /* with #1-bits <= #0-bits + 5 */ ULLI vecA095295[65] = vec65zeros; ULLI vecA095312[128] = vec128zeros; /* Primes with #1-bits > #0-bits + 6 */ ULLI vecA095332[65] = vec65zeros; ULLI vecA095313[128] = vec128_with_initial_2; /* with #1-bits <= #0-bits + 6 */ ULLI vecA095333[65] = vec65zeros; ULLI vecA095298[65] = vec65zeros; ULLI vecA095336[65] = vec65zeros; /* Sum 1-fibits in odd primes in ]2^n,2^n] */ ULLI vecA095353[128] = vec128zeros; /* Sum of 1-fibits in odd primes in range [F(n+1),F(n+2)[ */ ULLI vecA095354[128] = vec128zeros; /* Occurrences of primes in that range. */μl Vula080165〔128〕=VEC128Ia,初始值为2;/*“10…”素数。*/ULLIVCA095665〔128〕=VEC65零;/*及其计数。*/U.L.VECA080166〔128〕=VEC128NeNOS;/*“11…”素数。*/ULLI VECA0957 66〔128〕=VEC65零点;/*及其计数。*/ui Vula016041〔128〕=VEC128Z0OS;/*二元回文素数。*/ULLI VECA09571[ 65 ]=VEC65零;/*及其计数。*/ULLI VECA09572[ 65 ]=VEC65零点;/*和。*/ui VICA09573[ 128 ]=VEC128Ia,初始起始2;/*A037 88(P)=1素数。*/ULLI VECA09553〔65〕=VEC65零点;/*及其计数。*/U.L.VECA09574[ 128 ]=VEC128NeLOS;/*A037 88(P)=2素数。*/ULLI VECA09575 4〔65〕=VEC65零点;/*及其计数。*/U.L.VECA09575[ 128 ]=VEC128NeLOS;/*A037 88(P)=3素数。*/ULLI VECA09575 5〔65〕=VEC65零;/*及其计数。*/U.L.VECA09576[ 128 ]=VEC128NeLOS;/*A037 88(P)=4素数。*/ULLI VECA09575 6〔65〕=VEC65零;/*及其计数。*(/奇数素数可为):*/ULLI VECA09577[ 128 ]=VEC128Z0OS;/*A037 88(P)=((宽度(p)- 2)>1)素数。*/ULLI VECA095707〔65〕=VEC65零;/*及其计数。*/ui VICA09578[ 128 ]=VEC128Ne0OS;/*A037 88(P)=((宽度(p)- 4)>1)素数。*/ULLI VECA09575 8〔65〕=VEC65零点;/*及其计数。*/y/y/*a09579是素数本身的三角形,在每一个数为2 ^ n,2 ^(n+1)]范围内。Zeck /回文=VEC128NoLs;(*,A.994202)素数*/ULLI VECA095331 [128 ]=VEC128Ne0OS;/*及其在[f(n+1),f(n+2)]中的计数。*/ULLI VECA09532〔128〕=VEC128Ne0OS;/*ZE E-非对称性指数。*/ /* A095733(n) = A014417(A095730(n)) = A007088(A003714(A095730(n))) */ /* A095734(n) = A037888(A003714(n)) */ void fprint_ULLI_vector(FILE *fp,ULLI *vec,int start,int end) { int i; for(i=start; i <= end; i++) { if(i>start) { fprintf(fp,","); } fprint_ulli(fp,*(vec+i)); } } /* Returns the number of terms printed if finished because no more fits, zero otherwise, when everything has been printed. */ int fprint_ULLI_vector_in_pieces(FILE *fp,ULLI *vec, int start,int end,int max_linelen,int islast) { int i=start; /* Number of terms printed this time. */iint PL=0;/*打印长度。FPrimtTyuli(FP,VEC[i++]);IF(i>结束){Read(0);}/*完成向量*/IF(ISStand &((PL + 1)> = Max OnLeLeNEN)){{Read(i-Stand);} /}没有%u行*/ffPrTFF(FP,“”)上的尾逗号;πPL=1;如果(PL> = Max OnLelEN){Read(i-Stand);} /*返回非零,以指示应该打印更多的术语。*(/){{ PL+=*/y}{} int 1ultheFixFixPosithOF1,St1GraseRealthTythOne(ULL*VEC,INT VECLLN){{INT POSSYOFY 1StTyMtGeTyE2=1;/*为一个基SEQ。只有*(PosifOF1,Tyth-TyMyGtEy2<=VECLLN)和&(VEC[PasyOfMy1StTyMgGeTy2]<2){PasyOFF1STSTEMTMGGTEY2++;}(PasyOfF1 1StTyMtGTEY2> VECLLN){POSSYOFF1 STSTTYMGGTEY2=1;} /*未找到,使用1。*/π返回(PasyOfGy1StTyMyGtEy2);这个用于最大32位数字。*/In JSuuli(ULI P,ULI Q){ ULI S=0;/* 0在BIT-2中代表+2=1, 1,为-1。*/uuli NexPo.;循环:If(0=p){返回(p);} IF(1=p){返回(1 -(s和2));}/*将BIT-1中的1转换为-1, 0至+1。*/π(p和1)/*,如果p和q均为3 mod 4,则有奇数p*/{{/*,则符号改变,否则保持相同:*/^ s^=(p & q);/*只有比特-1是重要的,其他被忽略。*/NexPoP=q%p;/*我们能在这里有一个简单的减法吗?和Euclid一样吗?*/yq=p;p=Nex.p;Goto环;{}/Tor,*,我们有一个均匀的P.SO(2k/q)=(2/q)*(k/q)*/{{/*,其中(2/q)=1,如果q是+-1 mod 8,如果q是+-3 mod 8,则为1。*/y/*,仅当q的低位为(011)或(101),即如果比特-1和比特-2 xOffice产生1时,符号变化。*/^ s^=(q^(q>>1));*/π>=1;{ Goto Loop;}}{***/*使用,如果你实现,即Soloway Strassen素数测试,即,这是64位整数。* */In JSuuli(ULLI P,ULLI Q){ ULLI S=0;/* 0在BIT-2中代表+2=1, 1=-1。*/uull NexPoP;γ循环:IF(0=p){返回(p);}如果(1=p){返回(1 -(s和2));}/*将BIT-1中的1转换为-1, 0到+1。*/π(p和1)/*,如果p和q均为3 mod 4,则有奇数p*/{{/*,则符号改变,否则保持相同:*/^ s^=(p & q);/*只有比特-1是重要的,其他被忽略。*/NexPoP=q%p;/*我们能在这里有一个简单的减法吗?和Euclid一样吗?*/yq=p;p=Nex.p;Goto环;{}/Tor,*,我们有一个均匀的P.SO(2k/q)=(2/q)*(k/q)*/{{/*,其中(2/q)=1,如果q是+-1 mod 8,如果q是+-3 mod 8,则为1。*/y/*,仅当q的低位为(011)或(101),即如果比特-1和比特-2 xOffice产生1时,符号变化。*/^ s^=(q^(q>>1));*/yp>>=1;Goto循环;{}{},它在麻省理工学院/GNU计划中:;;我希望编译器足够聪明地看到它是;;要求p和q是固定数,并且不编译任何;;不必要的。(定义(Fix:雅可比符号p q)”(如果(不)(Fix:FixnUm)?(Fix:FixNum)?q)(Fix:=1(Fix::Q 1)))(错误):FIX:雅可比符号:ARG必须是FixNoMs,和2。ARG应该是奇数:“p p q”)(让环((p))(q(q))(s 0);0的比特-2代表+2在比特-2中为-1。p)0)((Fix:= 1 p)(Fix:- 1(Fix:and Ss 2)))((Fix:= 1(FIX和P 1));奇数p? (loop (fix:remainder q p) p (fix:xor s (fix:and p q))) ) (else ;; It's even. (loop (fix:lsh p -1) q (fix:xor s (fix:xor q (fix:lsh q -1)))) ) ) ) ) ) */ /* Returns the index i of the first point where Sum_{j=1..i} JS(i,n) goes negative, and zero if it doesn't go when checked up to i=k. */ int js_diving_index(ULI n,ULI k) { ULI i; long int s; for(s=0,i=1; i <= k; i++) { s += js_ULI(i,n); /* printf("js_diving_index(%lu,%lu): i=%lu,s=%ld\n",n,k,i,s); */ if(s < 0) { return(i); } } if((0 !=S)& &(i=n)){ ffPrTf(SdDr),“JSyDigiang-St指标:j(1,%Lu)…j(n-1,%Lu))不是零:%LD“,n,n,s”;= n) { i++; n >>= 1; } return(i); } /* Compute the "Binary asymmetricity index", which is 0 if n is a binary palindrome, i.e. in A006995. */ ULLI A037888(ULLI n) { int j=binwidth(n)-1; ULLI s=0; while(j > 0) { s += (((n >> j)^n)&1); n >>= 1; j -= 2; } return(s); } #define A095734(n) A037888(A003714(n)) int A000120(ULLI n) { int i=0; while(0 !=n){i+=(n和1);n>>1;}返回(i);{} /*,这是A000 00 9的特征函数,即A000 0120(n)mod 2*/iint a010060(ULLi n){iint i=0;(0)!{i=n){i^=(n和1);n>>1;}返回(i);{} /*aa77814(n)给出尾随零点的α,a00 7814(n+1)给出了后面的一个。* */Iint A000 7814(ULLI n){iint i=0;(1)(0=(n和1))&(0)!= n)) { i++; n >>= 1; } return(i); } char *w6d(char *tb,int n) { sprintf(tb,"%06u",n); return(tb); } void vec_sum_checker(FILE *fp,int veclen,int offset, int Anum_sum,ULLI *sumvec, int Anum1summand,ULLI *summand1vec, int Anum2summand,ULLI *summand2vec) { int i,matched; char tb1[81] = { 'A' }, tb2[81] = { 'A' }, tb3[81] = { 'A' }; char *Astr1summand = (w6d(tb1+1,Anum1summand)-1); char *Astr2summand = (w6d(tb2+1,Anum2summand)-1); char *Astr_sum = (w6d(tb3+1,Anum_sum)-1); for(i=offset, matched=0; i <= veclen; i++) { if((summand1vec[i] + summand2vec[i]) == sumvec[i]) { matched++; } else { fprintf(fp,"%s[%u] !=(%s[%u] +%s[%u]),即“,”StasySand,I,iSt1,and,i,iSt2Sand,i);fftpTyuli(FP,SUMVEC [i]);,“+”;“fPrimtTyuli(FP,SUMMAND2VEC[i]);ffPrTfF(FP,))n;{fpTrf(FP),%s匹配%%s+%s在%u位置。\n,“AssithSum,Assi1Sand,AsS2Teand,匹配);{} /*将向量VEC〔1…VECLEN〕就位。=(“”);ffpTrpululi(FP,SUMMAND1VEC[i]);-1,2,2,4,…=1:取奇定位项:1,3,5,7,…> 1,2,3,4,……** /虚空二分(ULL*VEC,int VECLLN,int奇偶){{int I,偏移=1;/*现在必须总是1,因为我现在很懒。*/ for(i=offset; i <= veclen; i++) { if(parity == (i&1)) { vec[parity+(i>>1)] = vec[i]; } } } #define OEIS_S_T_U_LINE_MAXLEN 64 void output_OEIS_sequence(FILE *fp,int Anum, ULLI *vec,int veclen, int offset_printed, char *name, char *author_info, char *datestr, char *Y_line, char *extra_H_link) { char tb[81] = { 'A' }; char *Astr = (w6d(tb+1,Anum)-1); int pos_of_1st_term_gte_2 = ULLIvec_find_pos_of_1st_larger_than_one(vec,veclen); int printed_only_up_to_nth_term = 0; int sec_printed_only_up_to_nth_term = 0; int upto_n = veclen; int offset = 1; fprintf(fp,"%%I %s\n",Astr); /* Old way: all the terms to %S-line: { fprintf(fp,"%%S %s ",Astr); fprint_ULLI_vector(fp,vec,offset,veclen); } */ { fprintf(fp,“%%s%s”,ASTC);PrPrdIdLyUpth-toNthHythType=fPrimtULLIVIVIORITION(FP,VEC,Office,VECLLN,OEISSH St.UyLyn-Max LeN,0);{Upth-TuthNthialType=fPrtutULILIVIVITIONS(FP,VEC+PRITENDION-YUPUTION TH NTHYNEL项,π偏移,πUntoTyn nPrPithdOnLyUpth-TuthNthiLeType,O'SeSysStUuLixMax LeMn,0);ffPrTf(FP,\n));*/{{fPrtutf(FP,%%t%s),ASTC);*/ { printed_only_up_to_nth_term += sec_printed_only_up_to_nth_term ; fprintf(fp,"%%U %s ",Astr); fprint_ULLI_vector_in_pieces(fp,vec+printed_only_up_to_nth_term,offset, upto_n-printed_only_up_to_nth_term, OEIS_S_T_U_LINE_MAXLEN,1); fprintf(fp,"\n"); } fprintf(fp,"%%N %s %s\n",Astr,name); /* Name should end with period. */f} fPrimtf(FP,%%Y%S%S\N),ASTR,YYLYN);ffPrTFF(FP),%%H%S A. Karttunen,J. Moyer:计算序列的初始项的C程序“n”、“ε”;= extra_H_link) { fprintf(fp,"%%H %s %s\n",Astr,extra_H_link); } fprintf(fp,"%%K %s nonn\n",Astr); fprintf(fp,"%%O %s %u,%u\n",Astr,offset_printed,pos_of_1st_term_gte_2); fprintf(fp,"%%A %s %s, %s\n", Astr, author_info, datestr); fprintf(fp,"\n"); fflush(fp); } /**********************************************************************/ /* main follows. */**************************************************************************************************************************************************************************************************************************************************************************************************************************************************在可预见的将来,没有人会计算到许多术语。与“2”n,2 ^(n+1)范围内素数的不同子集“发生”有关的序列的索引条目然后,我们应该有一个索引条目,比如:素数,范围内的各种子集)2 ^ n,2 ^(n+1),与(开始)相关的序列:
*/y/y/*可能会奇怪为什么I(AK)不使用GOOPT作为JRM做,但是原因是我从来没有……*/ARGyLoop:=(s=*++ARGV){{if(′-`==*s)〉{开关(*(S+1)){{情况〉D′:〉情况E’:{{if(′e==*(s+1)){nnLy4k3z扩展=1;} if()!*(S+ 2)){{++ARGV;IF(!)(*ARGV)!IsDigy(**(ARGV)){{数字}:ffPrTfF(STDRR),“%s:选项-%c需要一个数字参数!\“,”PrimNeX,*(S+ 1));Goto用法;{{GuffyDycNeSyCythKeDd}-OnLyUpth-ToNn= ATOI(*ARGV);}{}/TeRe/**直接跟随-d*/{{if(!)IsDigy(*(S+2)){Goto Nig.CythCube;} GuffyDycNexSycKeKdDyOnLyUpth-ToNn= ATOI(S+1);{} Goto AgulLoopy;{}默认值:{{fPrtutf(STDRR),%s:未知选项%s!(如果(1)>(ExpI>63)){FuffTf:ffPrTfF(STDRR,“使用:%s[-d num ]指数,其中指数在[1,63] \n”,“PrimNeX”);{出口(1);}}=3;;/*停止=PoopyOF2(ExpI+ 1)-1;*/*停止=PoopyOF2(ExpI+1)+1;/*,因为我们也搜索孪生素数。n“,PrimeNo.S”;Goto用法;*/ } else { goto usage; } precompute_fibos_to_vector(vecA000045,COMPUTE_FIBOS_UP_TO); fill_vector_with_fun(vecA003714,127,A003714); fill_vector_with_fun(vecA037888,127,A037888); max_terms_collected = 101; if(only_4k3_extension) { iterate_over_4k_plus3(glob_dyckness_checked_only_up_to_n, max_terms_collected); output_OEIS_sequence(stdout, 95090,vecA095090, glob_dyckness_checked_only_up_to_n, 1, "Number of 4k+3 integers in range ]2^n,2^(n+1)]" " whose Jacobi-vector is a Motzkin-path (A095100).", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = (2^(n-2))-A095091(n) for n > 1. Cf. A095092.", NULL ); output_OEIS_sequence(stdout, 95100,vecA095100,vecA095100[0], 1, "Integers n of the form 4k+3 for which all sums Sum_{i=1..u} J(i/n)" " (with u ranging from 1 to (n-1)) are nonnegative," " where J(i/n) is Jacobi symbol of i and n." "\n%C A095100 Integers whose Jacobi-vector forms" " a valid Motzkin-path.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = 4*A095274(n)+3." " Subset: A095102." " Complement of A095101 in A004767. A095091,GuffyDycKysKyKeKdDyOnLyUpth-ToN,1,“4k+1个数的整数在范围内”2 ^ n,2 ^(n+1)]“雅可比”向量不是一个有效的MysTKIN路径(A095101).“,”ANTI KARTUUNEN(他的第一个名字.他的姓(AT)IKi.Fi””,“Jun 01 2004”,“A(n)=(2 ^(N-2))-A095090(n)n> 1 . C.A095090.“,{NULLY”);{OutPuthOOISSH序列(STDUT,95091)Cf. A095093.", NULL ); output_OEIS_sequence(stdout, 95101,vecA095101,vecA095101[0], 1, "Integers n of the form 4k+3 for which some of the sums" " Sum_{i=1..u} J(i/n) (with u ranging from 1 to (n-1)) is negative," " where J(i/n) is Jacobi symbol of i and n." "\n%C A095100 Integers whose Jacobi-vector does not form" " a valid Motzkin-path.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "A095271 gives the diving indices. A(n)=4*A095255(n)+3。Cf. A095091.", NULL ); output_OEIS_sequence(stdout, 95109,vecA095109, glob_dyckness_checked_only_up_to_n, 1, "Sum of diving indices of all 4k+3 integers in range ]2^n,2^(n+1)]." "\n%C A095109 Diving index is explained at A095269.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095110.", NULL ); output_OEIS_sequence(stdout, 95110,vecA095110, glob_dyckness_checked_only_up_to_n, 1, "Sum of max. Motzkin path prefix-lengths of all 4k+3 integers" " in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095270, A095109.", NULL ); output_OEIS_sequence(stdout, 95269,vecA095269,vecA095269[0], 0, "Diving index of 4n+3." "\n%C A095269 Diving index of an odd number n is the first integer u > 1" " where Sum_{i=1..u} J(i/n) results -1, and zero if never." " Here J(i/n) is Jacobi symbol of i and n, which reduces to" " a Legendre symbol L(i/n) when n is a prime.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n)=A095270(n)+1 modulo A004767(n)." " Cf. A095109, A095271 (same sequence with zeros removed).", NULL ); output_OEIS_sequence(stdout, 95270,vecA095270,vecA095270[0], 1, "Length of max. Motzkin path prefix in the Jacobi-vector of 4n+3.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n)=A095269(n)-1 modulo A004767(n)." " Cf. A095110, A095105.", NULL ); output_OEIS_sequence(stdout, 95271,vecA095271,vecA095271[0], 1,“潜水指数A095101(N)”,“\\ N%F A09527 1 A(n)=A095269(A095255(n))。“军01 2004”,“F A095108.”,NULL);ωOUTSUPO OEISSH序列(STDUT,95274,VECA09527 4,VECCA09527 4[ 0 ],0”,“A(n)=(A095100(n)-3)/4),“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 01 2004”,“A095255的补充”。见A095269的评论,“,”安蒂卡特努恩(他的第一个名字,他的姓(AT)iki-Fi”。子集:A095222.“OutoPo.OEISSO序列”(STDUT,95275,VECCA095255,VECA095255〔0〕,0〕,“A(n)=(A095101(n)-3)/4”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI)”,“Jun 01 2004”,“A09527 4的补充”。Subset: A095273.", NULL ); exit(1); } compute_primes(start,stop,max_terms_collected); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95005,vecA095005,95006,vecA095006); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95007,vecA095007,95008,vecA095008); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95013,vecA095013,95014,vecA095014); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95015,vecA095015,95016,vecA095016); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95019,vecA095019,95054,vecA095054); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95020,vecA095020,95055,vecA095055); vec_sum_checker(stdout,expi,1, 95013,vecA095013,95009,vecA095009,95012,vecA095012); vec_sum_checker(stdout,expi,1, 95014,vecA095014,95010,vecA095010,95011,vecA095011); vec_sum_checker(stdout,expi,1, 95054,vecA095054,95018,vecA095018,95020,vecA095020); vec_sum_checker(stdout,expi,1, 95055,vecA095055,95018,vecA095018,95019,vecA095019); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95063,vecA095063,95064,vecA095064); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95060,vecA095060,95061,vecA095061); vec_sum_checker(stdout,expi,1, 95060,vecA095060,95062,vecA095062,95067,vecA095067); vec_sum_checker(stdout,expi,1, 95061,vecA095061,95066,vecA095066,95069,vecA095069); vec_sum_checker(stdout,expi,1, 95062,vecA095062,95065,vecA095065,95068,vecA095068); vec_sum_checker(stdout,expi,1, 95008,vecA095008,95092,vecA095092,95093,vecA095093); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95094,vecA095094,95095,vecA095095); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95290,vecA095290,95291,vecA095291); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95292,vecA095292,95293,vecA095293); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95294,vecA095294,95295,vecA095295); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95296,vecA095296,95297,vecA095297); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95332,vecA095332,95333,vecA095333); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95334,vecA095334,95335,vecA095335); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95326,vecA095326,95327,vecA095327); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95328,vecA095328,95329,vecA095329); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95330,vecA095330,95331,vecA095331); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95324,vecA095324,95325,vecA095325); vec_sum_checker(stdout,expi,1, 36378,vecA036378,95765,vecA095765,95766,VoA0957 66);(45),VECA000,45,(1),“Fibonacci数:F(n)=f(n-1)+f(n-2),f(0)=0,f(1)=1,f(2)=1,…,”,“njas”,“,”,“这里”只是为了检查!,OUTUPO OEISSH序列(STDUT,3714,VECA031414,Max),1,“Fib二进制数”,“NJAS”,“,”,“这里只是为了检查!”,OUTPUTHOEISSH序列(STDUT,37888,VECA037),克拉克,KMBELLIN(CK6(AT)EvsSaviel.EDU),“,”“这里只是为了检查!”, NULL ); output_OEIS_sequence(stdout, 36378,vecA036378, expi, 1, "Number of primes p such that 2^n < p < 2^(n+1).", "Labos E. (labos(AT)ana1.sote.hu)", "May 13 2004", "a(n) = A095005(n)+A095006(n) = A095007(n) + A095008(n)" " = A095013(n) + A095014(n)" " = A095015(n) + A095016(n) (for n > 1)" " = A095021(n)+A095022(n)+A095023(n)+A095024(n)" /* " = A095019(n)+A095020(n) + (if n is odd) A095018((n+1)/2)" */ " = A095019(n)+A095054(n)" " = A095020(n)+A095055(n)" " = A095060(n)+A095061(n)" " = A095063(n)+A095064(n)" " = A095094(n)+A095095(n). Cf. A095354.", extra_H_link ); output_OEIS_sequence(stdout, 95005,vecA095005, expi, 1, "Number of odious primes (A027697) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095006(n).", extra_H_link ); output_OEIS_sequence(stdout, 95006,vecA095006, expi, 1, "Number of evil primes (A027699) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095005(n).", extra_H_link ); output_OEIS_sequence(stdout, 27697,vecA027697,vecA027697[0], 1, "Odious primes: primes with odd number of 1's in binary expansion.", "njas", "", "Complement of A027699 in A000040." " Union of A091206\{3} and odious members of A091209." " Cf. A095005.", NULL ); output_OEIS_sequence(stdout, 27699,vecA027699,vecA027699[0], 1, "Evil primes: primes with even number of 1's in binary expansion.", "njas", "", "Complement of A027697 in A000040." " Cf. A095006.", NULL ); output_OEIS_sequence(stdout, 95007,vecA095007, expi, 1, "Number of 4k+1 primes (A002144) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095008(n) = A095009(n)+A095011(n).", extra_H_link ); output_OEIS_sequence(stdout, 95008,vecA095008, expi, 1, "Number of 4k+3 primes (A002145) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095007(n) = A095010(n)+A095012(n)" " = A095092(n)+,A095093(n).", extra_H_link ); /* Cf. A091126, A091127, A091128, A091129. ECA09509,πExpI,1,“8k+1素数(A00 719)在范围内)2 ^,n(2)(n+1)],“LabOS(AT)ANA1. SoT.Hu)和“Antti Karttunen”(他的第一个名字,他的姓(AT)IKi.Fi”,“Jun 01 2004”,“A”(n)=A095013(n)-A095012(n)=A09507(n)-A095011(n)。*/O{OutPuthOEISSH序列(STDUT,95009,V.)ECA095010,πExpI,1,“8k+3素数(a00)在范围内)(2 ^,n(2)(n+1)]。“,”LabOS E.(LabOS(AT)ANA1. SoT.Hu)和“Antti Karttunen”(他的第一个名字,他的姓氏(AT)IKi.Fi),“Jun 01 2004”,“A”(n)=A095014(n)-A095011(n)=A09500 8(n)-A095012(n)。〔F〕A091126,“ExtExoH-Link Lo.*”;{OutPuthOOISSH序列(StdOUT,95010,V.)OutPuthOeISSH序列(STDUT,95011,VECA095011,πExpI,1),“8k+5素数(范围A00),2 ^,2 ^(n+1)]。“,”LabOS E.(LabOS(AT)ANA1. SoT.Hu)和“Antti Karttunen”(他的第一个名字,他的姓(AT)IKi.Fi),“01”2004“,”A(n)=A095014(n)-A095010(n)。“参见A091127”,(ExtA HyLink Li);OutPuthOeISSH序列(STDUT,95012,VECA095012,πExpI,1),“8k+7素数(范围A00),2 ^,n(2)(n+1)]。“,”LabOS E.(LabOS(AT)ANA1. SoT.Hu)和“Antti Karttunen”(他的第一个名字,他的姓(AT)IKi.Fi),“军01 01 2004”,“A”(n)=A095013(n)-A09500 9(n)。C. A091128.“,ExtOXH-Link Link”Cf. A091129.", extra_H_link ); output_OEIS_sequence(stdout, 95013,vecA095013, expi, 1, "Number of 8k+-1 primes (A001132) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095014(n) = A095009(n)+A095012(n).", extra_H_link ); output_OEIS_sequence(stdout, 95014,vecA095014, expi, 1, "Number of 8k+-3 primes (A003629) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095013(n) = A095010(n)+A095011(n).", extra_H_link ); output_OEIS_sequence(stdout, 95015,vecA095015, expi, 1, "Number of 6k+1 primes (A002476) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095016(n) (apart the initial term).", extra_H_link ); output_OEIS_sequence(stdout, 95016,vecA095016, expi, 1, "Number of 6k+5 primes (A007528) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095015(n) (apart the initial term).", extra_H_link ); output_OEIS_sequence(stdout, 95017,vecA095017, expi, 1, "Number of lesser twin primes (A001359) in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095016, A036378.", extra_H_link ); output_OEIS_sequence(stdout, 95021,vecA095021, expi, 1, "Number of 5k+1 primes (A030430) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A036378.", extra_H_link ); output_OEIS_sequence(stdout, 95022,vecA095022, expi, 1, "Number of 5k+2 primes (A030432) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A036378.", extra_H_link ); output_OEIS_sequence(stdout, 95023,vecA095023, expi, 1, "Number of 5k+3 primes (A030431) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A036378.", extra_H_link ); output_OEIS_sequence(stdout, 95024,vecA095024, expi, 1, "Number of 5k+4 primes (A030433) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A036378.", extra_H_link ); /* Neil doesn't like aerated sequences too much, so we bisect the sequence, by taking the odd-positioned terms and instead of: %S A095018 0,0,0,0,2,0,4,0,17,0,28,0,189,0,531,0,1990,0,5747,0,23902,0,76658, we should get: %S A095018 0,0,2,4,17,28,189,531,1990,5747,23902,76658,291478,,982793, %T A095018 3677580,13214719,49161612 */ bisect(vecA095018,expi,1); output_OEIS_sequence(stdout, 95018,vecA095018, ((expi+1)>>1), 1, "Number of binarily balanced primes (A066196) in range ]2^(2n-1),2^2n]." "\n%e A095018 Only primes in range ]2^5,2^6] with equal numbers of" " ones and zeros in their binary expansion are" " 37 (in binary 100101) and 41 (in binary 101011)" " thus a(3)=2.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095005-A095006, A095052-A095053.", extra_H_link ); /* He we bisect the sequence, by taking the even-positioned terms and instead of: %S A095052 0,0,0,1,0,3,0,10,0,25,0,78,0,283,0,906,0,3044,0,10920,0,37920,0, we should get: %S A095052 0,1,3,10,25,78,283,906,3044,10920,37920,135182,487555,1764216,πt A095052 641590223585285×*/2平分(VECA095052,ExpI,0);ωOutPuthOOISSH序列(STDUT,第95052,VECCA095052,(ExpI> 1)),/*现在序列只有一半长。2n,2 ^(2n+1)]。“n”\n %A095052在范围内(2 ^ 4,2 ^ 5)17(二进制中的10001)仅是这样的素数“ω”,因此A(2)=1。“,”ANTI KARTUUNEN(他的第一个名字,他的姓(AT)IKI.Fi””,“Jun 01 2004”,“C.A095018.”,外加HLink L*);π(VECA095053,ExpI,0);/*对此进行同样的处理。*/* 1,“数为0位的素数等于1加1位的数”〉(“A095072”)“在范围内”2 ^*/OutOutoOEISSH序列(STDUT,95053,VECA095053,(Exp>>1),/*现在序列只有一半长。*/ 1, "Number of primes with number of 1-bits equal to one plus number 0-bits" " (A095073)" " in range ]2^2n,2^(2n+1)]." "\n%e A095053 In range ]2^2,2^3] 5 (101 in binary) is only such prime" " thus a(1)=1, and similarly, in range ]2^4,2^5] 19 (10011 in binary)" " is also unique in that respect, thus a(2)=1 as well.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095018.", extra_H_link ); output_OEIS_sequence(stdout, 95056,vecA095056, expi, 1, "Number of primes with exactly three 1-bits (A081091)" " in range ]2^n,2^(n+1)].", "Labos E. (labos(AT)ana1.sote.hu) & " "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095018.", extra_H_link ); output_OEIS_sequence(stdout, 95057,vecA095057, expi, 1, "Number of primes with four 1-bits (A095077) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095018.", extra_H_link ); output_OEIS_sequence(stdout, 95058,vecA095058, expi, 1, "Number of primes with a single 0-bit (A095078) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095018.", extra_H_link ); output_OEIS_sequence(stdout, 95059,vecA095059, expi, 1, "Number of primes with two 0-bits (A095079) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095018.", extra_H_link ); /* Then a few prime-sequences themselves: */ output_OEIS_sequence(stdout, 95072,vecA095072, VECA095072(0),/*包含所收集的素数的计数。*(1),“二元扩张中的素数,0位的数目比1位的数目多一个”,“,”ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKi.Fi),“军01,2004”,“A000 000和A031444的交集”。A095071.子集A.995052,“0. 0552”,O.OutPuthOOISSH序列(STDUT,95073,VECA095073A,VECA095073[3],/*)包含所收集的素数的计数。*/* 1,“素数”,其二进制扩展中,1位的数目比0位的数目多1“,”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKi.Fi””,“Jun 01,2004”,“AA000 40/A031448的交集”。A095070的子集。“^”见图A095053。“,{NULLY”);{OutPuthOOISSH序列(STDUT,95077,VECA095077,VECA095077(0),/*)包含所收集的素数。*(1),“素数在其二进制扩展中有四个1位”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 01,2004”,“A027 699的子集”。“”不同于A08408在n=19时的第一次,其中A(n)=337,“y”,而A085 44 8从那里继续311,其二进制扩展“*”具有六个1位,而不是四。“A095057”,“O{NULL”);OutOutoOEISSH序列(STDUT,95078,VECA095078,VECCA095078(0),/*)包含所收集的素数。*(1),“二元扩张中有一个0位的素数”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 01,2004”,“A000 000和A030130的交集”。“A095058.”,“Oxnull”,“OutPuthOEISSH序列”(STDUT,95079,VECA095079,VECCA095079(0),/*)包含所收集的素数。*(1),“二元扩张中有两个0位的素数”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKi.Fi””,“Jun 01,2004”,“/*”A000 000和A0XXXXX的交集。*/ "Cf. A095059.", NULL ); output_OEIS_sequence(stdout, 95060,vecA095060, expi, 1, "Number of fibeven primes (A095080) in range ]2^n,2^(n+1)]." "\n%C A095060 As expected, the ratio of a(n)/A036378(n) seems to approach" " (sqrt(5)-1)/2 (= 0.6180339887...): 1, 1, 1, 0.6, 0.42857, 0.69231, 0.69565," " 0.5814, 0.66667, 0.60584, 0.58824, 0.61638, 0.61927, 0.60484, 0.61551," " 0.61569, 0.61289, 0.61893, 0.61693, 0.61813, 0.61859, 0.61824, 0.61858," " 0.61727, 0.6178, 0.61829, 0.61795, 0.61816, 0.61804, 0.61808, 0.61804," " 0.61803, 0.61805", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095061(n) = A095062(n)+A095067(n).", extra_H_link ); output_OEIS_sequence(stdout, 95080,vecA095080,vecA095080[0], 1, "Fibeven primes, i.e. primes p whose Zeckendorf-expansion A014417(p)" " ends with “,”“安蒂卡特努恩(他的第一个名字,他的姓(AT)IKi.Fi””,“军01 2004”,“”A000 000和A0223 42的交集。Union of A095082 & A095087." " Cf. A095060, A095081.", NULL ); output_OEIS_sequence(stdout, 95061,vecA095061, expi, 1, "Number of fibodd primes (A095081) in range ]2^n,2^(n+1)]." "\n%C A095061 As expected, the ratio of a(n)/A036378(n) seems to approach" " 1-((sqrt(5)-1)/2) (= 0.381966011250...): 0, 0, 0, 0.4, 0.57143, 0.30769," " 0.30435, 0.4186, 0.33333, 0.39416, 0.41176, 0.38362, 0.38073, 0.39516," " 0.38449, 0.38431, 0.38711, 0.38107, 0.38307, 0.38187, 0.38141, 0.38176," " 0.38142, 0.38273, 0.3822, 0.38171, 0.38205, 0.38184, 0.38196, 0.38192," " 0.38196, 0.38197, 0.38195", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095060(n) = A095066(n)+A095069(n).", extra_H_link ); output_OEIS_sequence(stdout, 95081,vecA095081,vecA095081[0], 1, "Fibodd primes, 即素数p,其Zekkordf扩张A014417(p)“一”结束,“,”“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“军01 2004”,“AA000 40/AA36362的交集”。Union of A095086 & A095089." " Cf. A095061, A095080, A095281.", NULL ); output_OEIS_sequence(stdout, 95062,vecA095062, expi, 1, "Number of fib00 primes (A095082) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A095060(n)-A095067(n) = A095065(n)+A095068(n).", extra_H_link ); output_OEIS_sequence(stdout, 95082,vecA095082,vecA095082[0], 1, "Fib00 primes, i.e. primes p whose Zeckendorf-expansion A014417(p)" " ends with two zeros.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095062. A000 000和A02627的交叉点。{ 0}8},[OxOpthoOeSi]序列(STDUT,95065,VECCA095065,πExpI,1),“FiB000素数(A095085)在范围内)2 ^ n,2 ^(n+1)],“,”ANTI KARTUUNEN(他的第一个名字,他的姓(AT)IKI.FI),“Jun 01 2004”,“A”(n)=A095062(n)-A095068(n)。A095085与A0联合会,“ExtUpH-Link Link”;OutOpthoOeSiz序列(STDUT,95085,VECA095085,VECA095085(0),1”,“FiB000素数,即Primes p,其Zekkordf展开A014417(p)”,“三零点结束”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 01 2004”,“A000 000和A095097的交集”。A095066A095067“{0}”;“{ OutpU-OEISSH序列”(STDUT,95066,VECA095066,ExpI,1),“FiB01素数(A095088-)在范围内)2 ^ n,2 ^(n+1)],“,”ANTI KARTUUNEN(他的第一个名字,他的姓(AT)IKI.FI),“Jun 01 2004”,“A”(n)=A095061(n)-A095059(n)。A09Oututh-HyLinkα);OutuxOEISSY序列(STDUT,95086,VECCA095086/VECA095086[8],1),“FiB01素数,即Primes p,其Zekkordf扩张A014417(p)”,“两端有两个零,最后1”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 01 2004”,“AO90040和A095098的交集”。参见A095065和A095067。Cf. A095066.", NULL ); output_OEIS_sequence(stdout, 95067,vecA095067, expi, 1, "Number of fib010 primes (A095087) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A095060(n)-A095062(n).", extra_H_link ); output_OEIS_sequence(stdout, 95087,vecA095087,vecA095087[0], 1, "Fib010 primes, i.e. primes p whose Zeckendorf-expansion A014417(p)" " ends with zero, one and zero.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Intersection of A000040 & A035336. Cf. A095067.", NULL ); output_OEIS_sequence(stdout, 95068,vecA095068, expi, 1, "Number of fib100 primes (A095088) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A095062(n)-A095065(n).", extra_H_link ); output_OEIS_sequence(stdout, 95088,vecA095088,vecA095088[0], 1, "Fib100 primes, i.e. primes p whose Zeckendorf-expansion A014417(p)" " ends with one and two final zeros.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Intersection of A000040 & A035337. Cf. A095068.", NULL ); output_OEIS_sequence(stdout, 95069,vecA095069, expi, 1, "Number of fib101 primes (A095089) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A095061(n)-A095066(n).", extra_H_link ); output_OEIS_sequence(stdout, 95089,vecA095089,vecA095089[0], 1, "Fib101 primes, i.e. primes p whose Zeckendorf-expansion A014417(p)" " ends as one, zero, one.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Intersection of A000040 & A095099. Cf. A095069.", NULL ); output_OEIS_sequence(stdout, 95063,vecA095063, expi, 1, "Number of fibodious primes (A095083) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095064(n).", extra_H_link ); output_OEIS_sequence(stdout, 95083,vecA095083,vecA095083[0], 1, "Fibodious primes, i.e. primes p whose Zeckendorf-expansion A014417(p)" " contains an odd number of 1-fibits.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Intersection of A000040 & A020899. Cf. A095084, A095063.", NULL ); output_OEIS_sequence(stdout, 95064,vecA095064, expi, 1, "Number of fibevil primes (A095084) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095063(n).", extra_H_link ); output_OEIS_sequence(stdout, 95084,vecA095084,vecA095084[0], 1, "Fibevil primes, i.e. primes p whose Zeckendorf-expansion A014417(p)" " contains an even number of 1-fibits.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Intersection of A000040 & A095096. ,95092,VECA095092,GyrdyDycNeSyCykKeDyOnLyUpth-ToN,1,“4k+3个素数,其勒让德矢量为Dyk路径(A095102)”,“范围内”2 ^,2(n+1)],“,”ANTI KARTUUNEN(他的第一个名字,他的姓(AT)IKi.Fi),“Jun 01 2004”,“A”(n)=A09500 8(n)-A095093(n)。CF.A095083A095064,“,nnull”;Cf. A095090.", extra_H_link ); output_OEIS_sequence(stdout, 95102,vecA095102,vecA095102[0], 1, "Odd primes p for which all sums Sum_{i=1..u} L(i/p) (with u ranging from 1" " to (p-1)) are nonnegative, where L(i/p) is Legendre symbol of i and p," " defined to be 1 if i is a quadratic residue (mod p) and -1" " if i is a quadratic non-residue (mod p)." "\n%C A095102 All 4k+3 primes whose Legendre-vector (cf. A055094) forms" " a valid Dyck-path (cf. A014486).", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Intersection of A000040 & A095100. A080114的子集(见注释)。A(n)=4×A09522(n)+3。Cf. A095092.", NULL ); output_OEIS_sequence(stdout, 95093,vecA095093, glob_dyckness_checked_only_up_to_n, 1, "Number of 4k+3 primes whose Legendre-vector is not Dyck-path (A095103)" " in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A095008(n)-A095092(n).", extra_H_link ); output_OEIS_sequence(stdout, 95103,vecA095103,vecA095103[0], 1, "4k+3 primes whose Legendre-vector is not valid Dyck-path.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Intersection of A000040 & A095101." " Complement of A095102 in A002145. Diving indices: A095108." " a(n) = 4*A095273(n)+3." " Cf. also A095093.", NULL ); output_OEIS_sequence(stdout, 95094,vecA095094, glob_dyckness_checked_only_up_to_n, 1, "Number of A080114-primes in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095095(n).", extra_H_link ); output_OEIS_sequence(stdout, 80114,vecA080114,vecA080114[0], 1, "Odd primes p for which all sums Sum_{i=1..u} L(i/p) (with u ranging from 1" " to (p-1)/2) are nonnegative, where L(i/p) is Legendre symbol of i and p," " which is defined to be 1 if i is a quadratic residue (mod p) and -1" " if i is a quadratic non-residue (mod p).", /* "Primes whose Legendre-vector's first half is a valid Dyck-path.", */ "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Feb 11 2003",“A000 000和A0XXXXX的交叉口”。A095102. A080115在A000 0 40中的补充。Cf. A095094.", NULL ); output_OEIS_sequence(stdout, 95095,vecA095095, glob_dyckness_checked_only_up_to_n, 1, "Number of A080115-primes in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A036378(n)-A095094(n).", extra_H_link ); output_OEIS_sequence(stdout, 80115,vecA080115,vecA080115[0], 1, "Primes not in A080114.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Feb 11 2003", /* "Intersection of A000040 & A0xxxxx." */ " Complement of A080114 in A000040. Cf. A095095.", NULL ); output_OEIS_sequence(stdout, 95104,vecA095104,vecA095104[0], 1, "Diving index of the nth 4k+3 prime (A002145(n))." "\n%C A095104 Diving index of an odd number n is the first integer u > 1" " where Sum_{i=1..u} J(i/n) results -1, and zero if never." " Here J(i/n) is Jacobi symbol of i and n, which reduces to" " a Legendre symbol L(i/n) when n is a prime.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n)=A095105(n)+1 modulo A002145(n)." " Cf. A095106, A095108 (same sequence with zeros removed), A095269.", NULL ); output_OEIS_sequence(stdout, 95108,vecA095108,vecA095108[0], 1, "Diving index of the nth diving 4k+3 prime (A095103(n)).", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Non-zero terms of A095104. Cf. A095271.", NULL ); output_OEIS_sequence(stdout, 95105,vecA095105,vecA095105[0], 1, "Length of max. Dyck path prefix in the Legendre-vector of" " the nth 4k+3 prime (A002145(n)).", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n)=A095104(n)-1 modulo A002145(n)." " Cf. A095107, A095270.", NULL ); output_OEIS_sequence(stdout, 95106,vecA095106, glob_dyckness_checked_only_up_to_n, 1, "Sum of diving indices of all 4k+3 primes in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095104, A095107, A095109.", NULL ); output_OEIS_sequence(stdout, 95107,vecA095107, glob_dyckness_checked_only_up_to_n, 1, "Sum of max Dyck path prefix lengths of all 4k+3 primes" " in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095105, A095106, A095110.", NULL ); output_OEIS_sequence(stdout, 95272,vecA095272,vecA095272[0], 1, "a(n) = (A095102(n)-3)/4.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Complement of A095273 in A095278, subset of A095274.", NULL ); output_OEIS_sequence(stdout, 95273,vecA095273,vecA095273[0], 1, "a(n) = (A095103(n)-3)/4.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Complement of A095272 in A095278, subset of A095275.", NULL ); /* Some new ones June 3 2004. 95280,VECA095280,VECA095280[ 0 ],1,“下Wythop-Primes,即A000 0201中的素数”。“\N%C A095280包含所有的素数p,其Zekkordf展开”,“A014417(p)以偶数为0的结尾。”,“ANTI KARTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03 2004”,“A000 000和A000 0201的交集”。*/u{OutPuthOEISSH序列(STDUT),Complement of A095281 in A000040." " Cf. A095080, A095083, A095084, A095290.", NULL ); output_OEIS_sequence(stdout, 95290,vecA095290, expi, 1, "Number of Lower Wythoff Primes (A095280) in range ]2^n,2^(n+1)]." "\n%C A095090 As expected, the ratio of a(n)/A036378(n) seems to approach" " (sqrt(5)-1)/2 (= 0.6180339887...): 1, 0, 0.5, 0.6, 0.714286, 0.615385," " 0.608696, 0.697674, 0.533333, 0.627737, 0.635294, 0.622845, 0.620413," " 0.630893, 0.620792, 0.617796, 0.618848, 0.619961, 0.617445, 0.617713," " 0.618181, 0.618323, 0.617789, 0.618717, 0.618428, 0.618142, 0.618057," " 0.617987, 0.618105, 0.617965, 0.618065, 0.618053, 0.618047", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "a(n) = A036378(n)-A095291(n). STDUT,95281,VECA0952181,VECA095218[1],0,1,“上Wythop-Primes,即A00 1950年的素数”,“\N%C A09581包含所有的素数P,其Zekkordf展开”,“A014417(p)以奇数为0结束”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03 2004”,“AO90040和A00 1950”的交集。C.A095060,A09591.“,ExtOXH-Link Link”;Complement of A095280 in A000040." " Cf. A095081, A095083, A095084, A095290.", NULL ); output_OEIS_sequence(stdout, 95291,vecA095291, expi, 1, "Number of Upper Wythoff Primes (A095281) in range ]2^n,2^(n+1)]." "\n%C A095291 As expected, the ratio of a(n)/A036378(n) seems to approach" " 1-((sqrt(5)-1)/2) (= 0.381966011250...): 0, 1, 0.5, 0.4, 0.285714," " 0.384615, 0.391304, 0.302326, 0.466667, 0.372263, 0.364706, 0.377155," " 0.379587, 0.369107, 0.379208, 0.382204, 0.381152, 0.380039, 0.382555," " 0.382287, 0.381819, 0.381677, 0.382211, 0.381283, 0.381572, 0.381858," " 0.381943, 0.382013, 0.381895, 0.382035, 0.381935, 0.381947, 0.381953" "\n%C A095291 Also expected, the ratio a(n)/A095061(n) seems to approach 1:" " 1, 0, 0, 1, 0.5, 1.25, 1.28571, 0.72222, 1.4, 0.94444, 0.88571, 0.98315," " 0.99699, 0.93407, 0.98627, 0.99453, 0.98462, 0.9973, 0.99865, 1.0011," " 1.00108, 0.99979, 1.00208, 0.99622, 0.99835, 1.00039, 0.99973、1.00046、“0.99983”、“1.00031”、“0.99994”、“0.99994”、“1.00001”、“1.00031”、“第1个名字(AT)IK.FI”、“Jun 03 2004”、“A”(n)=A036788(n)-A095290(n)。Cf. A095061, A095290.", extra_H_link ); output_OEIS_sequence(stdout, 95282,vecA095282,vecA095282[0], 1, "Primes whose binary-expansion ends with an even number of 1's.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "Intersection of A000040 & (complement of A079523)." " Complement of A095283 in A000040." " Cf. A027699, A095292.", NULL ); output_OEIS_sequence(stdout, 95292,vecA095292, expi, 1, "Number of A095282-primes in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "a(n) = A036378(n)-A095293(n). Cf. A095006.", extra_H_link ); output_OEIS_sequence(stdout, 95283,vecA095283,vecA095282[0], 1, "Primes whose binary-expansion ends with an odd number of 1's.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "Intersection of A000040 & A079523." " Complement of A095282 in A000040." " Cf. A027697, A095293.", NULL ); output_OEIS_sequence(stdout, 95293,vecA095293, expi, 1, "Number of A095283-primes in range ]2^n,2^(n+1)]." "\n%C A095293 As expected, the ratio a(n)/A095292(n) seems to approach 2:" " 0, 0, 1, 4, 1.33333, 2.25, 1.55556, 2.07143, 2.26087, 1.91489, 1.89773," " 2.05263, 1.95593, 1.98519, 2.01793, 1.95344, 2.00924, 1.99633, 1.99287," " 2.0083, 2.00075, 1.99746, 1.99841, 1.99971, 2.00034, 2.00001, 2.00018," " 1.99977, 1.99971, 1.99997, 2.00004, 1.99995, 2.00003",“Antti Karttunen(他的第一个名字,他的姓(AT)IKi.Fi””,“Jun 03 2004”,“A(n)=A036788(n)-A09592(n))。C.A09500,“,ExtHyLink Link”;α-/*/*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ 1, "Primes in whose binary expansion" " the number of 1-bits is > number of 0-bits minus 3." "\n%C A095320 Differs from primes (A000040) first time at n=55," " where a(55)=263, while A000040(55)=257, as 257 whose binary" " expansion is 100000001, with 2 1-bits and 7 0-bits is the first" " prime excluded from this sequence." " Note that 129 (10000001 in binary, 2 1-bits and 6 0-bits) is" " not prime.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "Complement of A095321 in A000040. Subset: A095316." "A095330.", NULL ); output_OEIS_sequence(stdout, 95330,vecA095330, expi, 1, "Number of A095320-primes in range ]2^n,2^(n+1)]." "\n%C A095330 Ratios a(n)/A036378(n) converge as: 1, 1, 1, 1, 1, 1, 1," " 0.976744, 0.946667, 0.890511, 0.945098, 0.887931, 0.904817, 0.876551," " 0.914191, 0.851112, 0.88799, 0.831535, 0.881041, 0.82195, 0.863934," " 0.808416, 0.858898, 0.797191, 0.84356, 0.786657, 0.835979, 0.777517," " 0.825576, 0.769947, 0.819026, 0.76292, 0.81036", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "a(n) = A036378(n)-A095331(n).", extra_H_link ); output_OEIS_sequence(stdout, 95321,vecA095321, vecA095321[0], /* Contains the count of collected primes. */* 1,“二进制扩展中的素数”,“1位的数目是<0位减去3的数”,“ANTI KATTUUNEN(他的第一个名字,他的姓氏(AT)IKI.FI)”,“Jun 03,2004”,“A0900520中的A095320的补充”。Subset of A095317." " Cf. also A095331.", NULL ); output_OEIS_sequence(stdout, 95331,vecA095331, expi, 1, "Number of A095321-primes in range ]2^n,2^(n+1)]." "\n%C A095331 Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0, 0, 0, 0," " 0.023256, 0.053333, 0.109489, 0.054902, 0.112069, 0.095183, 0.123449," " 0.085809, 0.148888, 0.11201, 0.168465, 0.118959, 0.17805, 0.136066," " 0.191584, 0.141102, 0.202809, 0.15644, 0.213343, 0.164021, 0.222483," " 0.174424, 0.230053, 0.180974, 0.23708, 0.18964", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "a(n) = A036378(n)-A095330(n).", extra_H_link ); /******************************/ output_OEIS_sequence(stdout, 95316,vecA095316, vecA095316[0], /* Contains the count of collected primes. 0-位减去2的数目。“ω”\n%c a095316在n=32时与素数(a00 000)不同,“a”(a)(32)=139,而A000(40)(32)=131,131,其二进制“i”展开为10000011,3位1和5 0位是该序列中排除的第一个“i”素数。*/* 1,“二进制扩展中的素数”,“1位的数目是>A095320的子集。Subset: A095074." " Cf. also A095326.", NULL ); output_OEIS_sequence(stdout, 95326,vecA095326, expi, 1, "Number of A095316-primes in range ]2^n,2^(n+1)]." "\n%C A095326 Ratios a(n)/A036378(n) converge as: 1, 1, 1, 1, 1, 1," " 0.869565, 0.976744, 0.866667, 0.890511, 0.796078, 0.887931, 0.823394," " 0.876551, 0.785809, 0.851112, 0.769002, 0.831535, 0.750485, 0.82195," " 0.751938, 0.808416, 0.73382, 0.797191, 0.730306, 0.786657, 0.717911," " 0.777517, 0.713512, 0.769947, 0.706327, 0.76292, 0.701421", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "a(n) = A036378(n)-A095327(n).", extra_H_link ); output_OEIS_sequence(stdout, 95317,vecA095317, vecA095317[0], /* Contains the count of collected primes. */* 1,“二进制扩展中的素数”,“1位的数目是<0位减去2的数”,“ANTI KATTUUNEN(他的第一个名字,他的姓氏(AT)IKI.FI)”,“Jun 03,2004”,“A0900516中的A095316的补充”。子集:A095321。Subset of A095071." " Cf. also A095327.", NULL ); output_OEIS_sequence(stdout, 95327,vecA095327, expi, 1, "Number of A095317-primes in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)" "\n%C A095327 Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0, 0, 0," " 0.130435, 0.023256, 0.133333, 0.109489, 0.203922, 0.112069, 0.176606," " 0.123449, 0.214191, 0.148888, 0.230998, 0.168465, 0.249515, 0.17805," " 0.248062, 0.191584, 0.26618, 0.202809, 0.269694, 0.213343, 0.282089," " 0.222483, 0.286488, 0.230053, 0.293673, 0.23708, 0.298579", "Jun 03 2004", "a(n) = A036378(n)-A095326(n).", extra_H_link ); /******************************/ output_OEIS_sequence(stdout, 95074,vecA095074, vecA095074[0], /* Contains the count of collected primes. N%C A095074在n=7时,与素数(A000 0 0 40)不同,“A”在A(7)=19,而A000 0 0 40(7)=17,17的二元“γ”展开为10001,2位1和3 0位是该序列中排除的第一个“ω”素数。*(1),“素数”,在其二进制扩展中,0位的数目小于“ω”或等于1位的数目。Subset: A095070." " Differs from A057447 first time at n=18, where a(n)=71," " while A057447(18)=67." " Cf. A095054.", NULL ); output_OEIS_sequence(stdout, 95054,vecA095054, expi, 1, "Number of primes with #0-bits <= #1-bits (A095074) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A095020(n) + (if n is odd) A095018((n+1)/2)." "\n%C A095054 Ratios a(n)/A036378(n) converge as: 1, 1, 1, 0.8, 1," " 0.769231, 0.869565, 0.744186, 0.866667, 0.708029, 0.796078, 0.719828," " 0.823394, 0.700993, 0.785809, 0.692415, 0.769002, 0.682246, 0.750485," " 0.673552, 0.751938, 0.667037, 0.73382, 0.660064, 0.730306, 0.652924," " 0.717911, 0.647431, 0.713512, 0.643394, 0.706327, 0.639006, 0.701421", extra_H_link ); output_OEIS_sequence(stdout, 95071,vecA095071, vecA095071[0], /*包含收集的素数的计数。*(1),“零位显性素数,即二元展开的素数包含”“大于0比1”,“ANTI KATTUUNEN(他的姓,AT)IKI.FI),“军01 01”,“A095074在A000 000中的补充。”子集:A095317,A095072。A095075的子集。Cf. also A095019.", NULL ); output_OEIS_sequence(stdout, 95019,vecA095019, expi, 1, "Number of zero-bit dominant primes (A095071) in range ]2^n,2^(n+1)].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095018." "\n%C A095019 Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0.2, 0," " 0.230769, 0.130435, 0.255814, 0.133333, 0.291971, 0.203922, 0.280172," " 0.176606, 0.299007, 0.214191, 0.307585, 0.230998, 0.317754, 0.249515," " 0.326448, 0.248062, 0.332963, 0.26618, 0.339936, 0.269694, 0.347076," " 0.282089, 0.352569, 0.286488, 0.356606, 0.293673, 0.360994, 0.298579", extra_H_link ); /******************************/ output_OEIS_sequence(stdout, 95070,vecA095070, vecA095070[0], /* Contains the count of collected primes. *(1),“1位显性素数,即二元展开的素数包含“1”大于0的“”,“ANTI KATTUUNEN(他的第一姓,AT)IKI.FI),“军01 01”,“A000 000和A072600的交集”。A094075中的A095075的补充。亚组:A09586A095073.Cf. A095020.", NULL ); output_OEIS_sequence(stdout, 95020,vecA095020, expi, 1, "Number of one-bit dominant primes (A095070) in range ]2^n,2^(n+1)]." "\n%C A095020 Ratios a(n)/A036378(n) converge as: 1, 1, 1, 0.8, 0.714286," " 0.769231, 0.695652, 0.744186, 0.64, 0.708029, 0.686275, 0.719828," " 0.606651, 0.700993, 0.610561, 0.692415, 0.583868, 0.682246, 0.601734," " 0.673552, 0.581618, 0.667037, 0.584595, 0.660064, 0.57642, 0.652924," " 0.578057, 0.647431, 0.573186, 0.643394, 0.571734, 0.639006, 0.568309", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "Cf. A095018.", extra_H_link ); output_OEIS_sequence(stdout, 95075,vecA095075, vecA095075[0], /* Contains the count of collected primes. *(1),“二元扩张中的素数小于1”或等于0位数。“,”安蒂卡特努恩(他的第一姓,他的姓(AT)IKi.Fi””,“Jun 01 01”,“A095070在A000 000中的补充”,“子集:A095071.Subset of A095287." " Cf. A095055.", NULL ); output_OEIS_sequence(stdout, 95055,vecA095055, expi, 1, "Number of primes with #1-bits <= #0-bits (A095075) in range ]2^n,2^(n+1)]." "\n%C A095055 Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0.2, 0.285714," " 0.230769, 0.304348, 0.255814, 0.36, 0.291971, 0.313725, 0.280172," " 0.393349, 0.299007, 0.389439, 0.307585, 0.416132, 0.317754, 0.398266," " 0.326448, 0.418382, 0.332963, 0.415405, 0.339936, 0.42358, 0.347076," " 0.421943, 0.352569, 0.426814, 0.356606, 0.428266, 0.360994, 0.431691", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 01 2004", "a(n) = A095019(n) + (if n is odd) A095018((n+1)/2).", extra_H_link ); /******************************/ output_OEIS_sequence(stdout, 95286,vecA095286, vecA095286[0], /* Contains the count of collected primes. */* 1,“二进制扩展中的素数”,“1位的数目是1 + 0位的数目”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03,2004”,“A09587在A000 000中的补充”。A095070子集。Subset: A095314." " Cf. also A095296.", NULL ); output_OEIS_sequence(stdout, 95296,vecA095296, expi, 1, "Number of A095286-primes in range ]2^n,2^(n+1)]." "\n%C A095296 Ratios a(n)/A036378(n) converge as: 1, 0.5, 1, 0.6," " 0.714286, 0.384615, 0.695652, 0.488372, 0.64, 0.50365, 0.686275," " 0.493534, 0.606651, 0.476427, 0.610561, 0.500963, 0.583868, 0.502795," " 0.601734, 0.496874, 0.581618, 0.498624, 0.584595, 0.498259, 0.57642," " 0.498269, 0.578057, 0.499347, 0.573186, 0.498736, 0.571734, 0.498567," " 0.568309" "\n%C A095296 Ratios a(n)/A095335(n) converge as: 1, 1, 1, 1.5, 1.25," " 0.625, 0.842105, 0.954545, 1.116279, 1.014706, 1.100629, 0.974468," " 0.985102, 0.909953, 0.966562, 1.003861, 0.984008, 1.011245, 1.00445," " 0.987575, 0.991822, 0.994512, 0.988408, 0.993061, 0.99389, 0.9931," " 0.99673, 0.997392, 0.997286, 0.994955, 0.995265, 0.994285, 0.996248",“Antti Karttunen(他的第一个名字,他的姓(AT)IKi.Fi””,“Jun 03 2004”,“A(n)=A036788(n)-A09597(n))。C.A09598.“,ExtOXH-Link Link”;{OutPuthOOISSH序列(STDUT,95287,VECCA09587,VECCA09528 7[ 0 ],/*)包含所收集的素数。*/* 1,“二元扩张中的素数”,“1位的数目是<0=1 + 0位的数目”,“ANTI KATTUUNEN(他的第一姓,AT)IKI.FI),“Jun 03 03”,“A09005A6中的A09528 6的补充”,“子集:A095075”。Subset of A095315." " Cf. also A095297.", NULL ); output_OEIS_sequence(stdout, 95297,vecA095297, expi, 1, "Number of A095287-primes in range ]2^n,2^(n+1)]." "\n%C A095297 Ratios a(n)/A036378(n) converge as: 0, 0.5, 0, 0.4," " 0.285714, 0.615385, 0.304348, 0.511628, 0.36, 0.49635, 0.313725," " 0.506466, 0.393349, 0.523573, 0.389439, 0.499037, 0.416132, 0.497205," " 0.398266, 0.503126, 0.418382, 0.501376, 0.415405, 0.501741, 0.42358," " 0.501731, 0.421943, 0.500653, 0.426814, 0.501264, 0.428266, 0.501433," " 0.431691" "\n%C A095297 Ratios a(n)/A095334(n) converge as: 1, 1, 1, 0.666667," " 0.666667, 1.6, 1.75, 1.047619, 0.84375, 0.985507, 0.833333, 1.026201," "1.023881, 1.098958, 1.057348, 0.996154, 1.023336, 0.98888, 0.993351," "1.012581, 1.011595, 1.005518, 1.016781, 1.006987, 1.008436, 1.006948," "1.004514, 1.002615, 1.003668, 1.00507, 1.006392, 1.005748, 1.004982",“Antti Karttunen(他的第一个名字,他的姓(AT)IKI.Fi””,“Jun 03 2004”,“A”(n)=A036388(n)-A09596(n)。C.A09598.“,ExtHyLink Link”;{/***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/* 1,“二进制扩展中的素数”,“1位的数目是2 + 0位的数目”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03,2004”,“A095315在A000 000中的补充”。A09528 6的子集。Subset: A095318." " Cf. also A095334.", NULL ); output_OEIS_sequence(stdout, 95334,vecA095334, expi, 1, "Number of A095314-primes in range ]2^n,2^(n+1)]." "\n%C A095334 Ratios a(n)/A036378(n) converge as: 0, 0.5, 0, 0.6," " 0.428571, 0.384615, 0.173913, 0.488372, 0.426667, 0.50365, 0.376471," " 0.493534, 0.384174, 0.476427, 0.368317, 0.500963, 0.406642, 0.502795," " 0.400932, 0.496874, 0.413586, 0.498624, 0.408549, 0.498259, 0.420036," " 0.498269, 0.420047, 0.499347, 0.425255, 0.498736, 0.425546, 0.498567," " 0.429551" "\n%C A095334 Ratios a(n)/A095297(n) converge as: 1, 1, 1, 1.5, 1.5," " 0.625, 0.571429, 0.954545, 1.185185, 1.014706, 1.2, 0.974468," " 0.976676, 0.909953, 0.945763, 1.003861, 0.977197, 1.011245, 1.006694," " 0.987575, 0.988538, 0.994512, 0.983496, 0.993061, 0.991634, 0.9931," " 0.995506, 0.997392, 0.996345, 0.994955, 0.993649, 0.994285, 0.995042",“Antti Karttunen(他的第一个名字,他的姓(AT)IKI.Fi””,“Jun 03 2004”,“A”(n)=A036388(n)-A095335(n)。C.A09598.“,ExtOXH-Link Link”;{OutPuthOOISSH序列(STDUT,95315,VECA095315,VECA095315[ 0),/*)包含所收集的素数。*/* 1,“二元扩张中的素数”,“1位的数目是<0=2 + 0位的数目”,“ANTI KATTUUNEN(他的第一姓,AT)IKI.FI),“Jun 03 03”,“A0900514中的A095314的补充”,“子集:A095228”。Subset of A095319." " Cf. also A095335.", NULL ); output_OEIS_sequence(stdout, 95335,vecA095335, expi, 1, "Number of A09515-primes in range ]2^n,2^(n+1)]." "\n%C A095335 Ratios a(n)/A036378(n) converge as: 1, 0.5, 1, 0.4," " 0.571429, 0.615385, 0.826087, 0.511628, 0.573333, 0.49635, 0.623529," " 0.506466, 0.615826, 0.523573, 0.631683, 0.499037, 0.593358, 0.497205," " 0.599068, 0.503126, 0.586414, 0.501376, 0.591451, 0.501741, 0.579964," " 0.501731, 0.579953, 0.500653, 0.574745, 0.501264, 0.574454, 0.501433," " 0.570449" "\n%C A095335 Ratios a(n)/A095296(n) converge as: 1, 1, 1, 0.666667, 0.8," "1.6, 1.1875, 1.047619, 0.895833, 0.985507, 0.908571, 1.026201," "1.015123, 1.098958, 1.034595, 0.996154, 1.016252, 0.98888, 0.99557," "1.012581, 1.008245, 1.005518, 1.011728, 1.006987, 1.006148, 1.006948," "1.00328, 1.002615, 1.002721, 1.00507, 1.004757, 1.005748, 1.003766",“Antti Karttunen(他的姓氏,他的姓(AT)IKi.Fi””,“Jun 03 2004”,“A”(n)=A036388(n)-A095334(n)。γ*/* 1,“二进制扩展中的素数”,“1位的数目是3 + 0位的数目”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03,2004”,“A095319在A000 000中的补充”。A095314的子集。Subset: A095322." " Cf. also A095328.", NULL ); output_OEIS_sequence(stdout, 95328,vecA095328, expi, 1, "Number of A095318-primes in range ]2^n,2^(n+1)]." "\n%C A095328 Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0.2, 0.428571," " 0.076923, 0.173913, 0.302326, 0.426667, 0.255474, 0.376471, 0.267241," " 0.384174, 0.289082, 0.368317, 0.300753, 0.406642, 0.312898, 0.400932," " 0.324844, 0.413586, 0.328839, 0.408549, 0.336542, 0.420036, 0.345166," " 0.420047, 0.349607, 0.425255, 0.354353, 0.425546, 0.359213, 0.429551" "\n%C A095328 Ratios a(n)/A095055(n) converge as: 1, 1, 1, 1, 1.5," " 0.333333, 0.571429, 1.181818, 1.185185, 0.875, 1.2, 0.953846," " 0.976676, 0.966805, 0.945763, 0.97779, 0.977197, 0.98472, 1.006694," " 0.995088, 0.988538, 0.987616, 0.983496, 0.990015, 0.991634, 0.994496," " 0.995506, 0.991599, 0.996345, 0.993681, 0.993649, 0.995067, 0.995042",“Antti Karttunen(他的姓氏,他的姓(AT)IKi.Fi””,“Jun 03 2004”,“A”(n)=A036388(n)-A095329(n),“ExtHuxHyLink”);(i)OutPuthoOeSih序列(STDUT,95319,VECCA095319,VECA095319[0),/*包含所收集的素数的计数。=“3”+ 0位的数目。“,”“TANTI KARTUUNN”(他的姓氏(AT)IKi.Fi)“\\ %%C A095319”在n=11时与素数(A000 000)第一次不同,“a”(a)(11)=37,而A000(40)(11)=31,作为31,其二元“i”展开为11111,5个1位,0个0位是排除在该序列之外的第一个“i”素数。*/* 1,“二进制扩展中的素数”,“1位的数目是<Subset of A095323, subset: A095315." " A095329.", NULL ); output_OEIS_sequence(stdout, 95329,vecA095329, expi, 1, "Number of A095319-primes in range ]2^n,2^(n+1)]." "\n%C A095329 Ratios a(n)/A036378(n) converge as: 1, 1, 1, 0.8, 0.571429," " 0.923077, 0.826087, 0.697674, 0.573333, 0.744526, 0.623529, 0.732759," " 0.615826, 0.710918, 0.631683, 0.699247, 0.593358, 0.687102, 0.599068," " 0.675156, 0.586414, 0.671161, 0.591451, 0.663458, 0.579964, 0.654834," " 0.579953, 0.650393, 0.574745, 0.645647, 0.574454, 0.640787, 0.570449" "\n%C A095329 Ratios a(n)/A095020(n) converge as: 1, 1, 1, 1, 0.8, 1.2," "1.1875, 0.9375, 0.895833, 1.051546, 0.908571, 1.017964, 1.015123," "1.014159, 1.034595, 1.009866, 1.016252, 1.007117, 0.99557, 1.002381," "1.008245, 1.006182, 1.011728, 1.005142, 1.006148, 1.002926, 1.00328," "1.004575, 1.002721, 1.003502, 1.004757, 1.002787, 1.003766",Antti Karttunen(他的姓氏,姓(AT)IKi.Fi),“俊03 2004”,“A”(n)=A036388(n)-A095328(n)。“”*/* 1,“二进制扩展中的素数”,“1位的数目是4 + 0位的数目”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03,2004”,“A0900523中的A095323的补充”。A095318的子集。Subset: A095284." " Cf. also A095324.", NULL ); output_OEIS_sequence(stdout, 95324,vecA095324, expi, 1, "Number of A095322-primes in range ]2^n,2^(n+1)]." "\n%C A095324 Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0.2, 0," " 0.076923, 0.173913, 0.302326, 0.106667, 0.255474, 0.172549, 0.267241," " 0.172018, 0.289082, 0.231353, 0.300753, 0.216392, 0.312898, 0.242112," " 0.324844, 0.245432, 0.328839, 0.262367, 0.336542, 0.268304, 0.345166," " 0.278603, 0.349607, 0.283298, 0.354353, 0.29269, 0.359213, 0.296876" "\n%C A095324 Ratios a(n)/A095019(n) converge as: 1, 1, 1, 1, 1," " 0.333333, 1.333333, 1.181818, 0.8, 0.875, 0.846154, 0.953846," " 0.974026, 0.966805, 1.080123, 0.97779, 0.93677, 0.98472, 0.970332," " 0.995088, 0.9894, 0.987616, 0.985673, 0.990015, 0.994846, 0.994496," " 0.987642, 0.991599, 0.988865, 0.993681, 0.996653, 0.995067, 0.994296", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", “Jun 03 2004”,“A(n)=A03678N(n)-A095325(n)”,“ExtHuth-HyLink”);{OutPuthOOISSH序列(STDUT,95323,VECCA095323,VECA095323 [0),/*)包含所收集的素数。A095323第一次在n=11时不同于“素数”(A000),其中A(11)=37,而A000 0 40(11)=31,31为二进制,“5”膨胀为11111,5位1,0 0位是排除在该序列之外的第一个“ω”素数。*/* 1,“二进制扩展中的素数”,“1位的数目是<0 4 + 0位的数目”。A095228的子集。subset: A095319." " A095325.", NULL ); output_OEIS_sequence(stdout, 95325,vecA095325, expi, 1, "Number of A095323-primes in range ]2^n,2^(n+1)]." "\n%C A095325 Ratios a(n)/A036378(n) converge as: 1, 1, 1, 0.8, 1," " 0.923077, 0.826087, 0.697674, 0.893333, 0.744526, 0.827451, 0.732759," " 0.827982, 0.710918, 0.768647, 0.699247, 0.783608, 0.687102, 0.757888," " 0.675156, 0.754568, 0.671161, 0.737633, 0.663458, 0.731696, 0.654834," " 0.721397, 0.650393, 0.716702, 0.645647, 0.70731, 0.640787, 0.703124" "\n%C A095325 Ratios a(n)/A095054(n) converge as: 1, 1, 1, 1, 1, 1.2," " 0.95, 0.9375, 1.030769, 1.051546, 1.039409, 1.017964, 1.005571," "1.014159, 0.97816, 1.009866, 1.018993, 1.007117, 1.009864, 1.002381," "1.003497, 1.006182, 1.005197, 1.005142, 1.001903, 1.002926, 1.004856," "1.004575, 1.004471, 1.003502, 1.001392, 1.002787, 1.002428", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)",“俊03 2004”、“A(n)=A03678N(n)-A095324(n)”、“/ / ***************************OutsIOEISA序列(STDUT,95284,VECCA095244,VECCA09584[4]),/*包含所收集的素数。*/* 1,“二进制扩展中的素数”,“1位的数目是5 + 0位的数目”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03,2004”,“A09005A5中的A095255的补充”。A095322的子集。Subset: A095312." "Cf. also A095286, A095294.", NULL ); output_OEIS_sequence(stdout, 95294,vecA095294, expi, 1, "Number of A095284-primes in range ]2^n,2^(n+1)]." "\n%C A095294 Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0, 0," " 0.076923, 0.173913, 0.093023, 0.106667, 0.109489, 0.172549, 0.101293," " 0.172018, 0.146402, 0.231353, 0.151165, 0.216392, 0.161746, 0.242112," " 0.175754, 0.245432, 0.191264, 0.262367, 0.202279, 0.268304, 0.210966," " 0.278603, 0.219599, 0.283298, 0.228618, 0.29269, 0.235729, 0.296876" "\n%C A095294 Ratios a(n)/A095327(n) converge as: 1, 1, 1, 1, 1, 0," "1.333333, 4., 0.8, 1, 0.846154, 0.903846, 0.974026, 1.18593, 1.080123," "1.015294, 0.93677, 0.960116, 0.970332, 0.987101, 0.9894, 0.998326," " 0.985673, 0.997384, 0.994846, 0.988856, 0.987642, 0.987035, 0.988865," " 0.993762, 0.996653, 0.994302, 0.994296", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)",“俊03 2004”,“a(n)=a03678n(n)-a09595(n))。另外,A095329、A095052、A095053、“ExtUx HLink Lyn”等;{OutPuthOOISSY序列(STDUT,95285,VECA095255,VECA0952255〔0〕,/*)包含所收集的素数。*“/”1,“二进制扩展中的素数”,“1位的数目是<0 5 + 0位的数目”。“\n %C A09528 5在n=31时第一次与素数(A000 0 0 40)不同,”“A”(31)=131,而A000 0 40(31)=127,其127的“2”膨胀为1111111,7位1位,0位0是从该序列中排除的第一个“I”素数。注意,63(111111的二进制)“不”不是素数。“,”“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03,2004”,“A095244在A000 000中的补充”。Subset: A095323." " Subset of A095313, from which it differs first time at n=42," " where a(42)=193 (11000001 in binary) while" " A095313(42)=191 (10111111 in binary)." " Cf. also A095286, A095295.", NULL ); output_OEIS_sequence(stdout, 95295,vecA095295, expi, 1, "Number of A095285-primes in range ]2^n,2^(n+1)]." "\n%C A095295 Ratios a(n)/A036378(n) converge as: 1, 1, 1, 1, 1," " 0.923077, 0.826087, 0.906977, 0.893333, 0.890511, 0.827451, 0.898707," " 0.827982, 0.853598, 0.768647, 0.848835, 0.783608, 0.838254, 0.757888," " 0.824246, 0.754568, 0.808736, 0.737633, 0.797721, 0.731696, 0.789034," " 0.721397, 0.780401, 0.716702, 0.771382, 0.70731, 0.764271, 0.703124" "\n%C A095295 Ratios a(n)/A095326(n) converge as: 1, 1, 1, 1, 1," " 0.923077, 0.95, 0.928571, 1.030769, 1, 1.039409, 1.012136, 1.005571," " 0.973815, 0.97816, 0.997325, 1.018993, 1.00808, 1.009864, 1.002794," "1.003497, 1.000397, 1.005197、1.000665、1.001903、1.003022、1.004856、“1.00371”、1.004471、1.001864、1.001392、1.001771、1.002428、“ANTI KARTUUNEN(他的第一个名字,他的姓(AT)IKI.Fi””、“Jun 03盎司”、“/*”A(n)=A09528 6(n)+(如果n是CF.A095052、A095053)*/*“A(n)=A036788(n)-A09594(n))。A095052,A095053,“ExtExoH-Link Link”);*/* 1,“二进制扩展中的素数”,“1位的数目是6 + 0位的数目”,“ANTI KATTUUNEN(他的第一个名字,他的姓(AT)IKI.FI””,“Jun 03,2004”,“A095313在A000 000中的补充”。Subset of A095284." " Cf. also A095332.", NULL ); output_OEIS_sequence(stdout, 95332,vecA095332, expi, 1, "Number of A095312-primes in range ]2^n,2^(n+1)]." "\n%C A095332 Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0, 0," " 0.076923, 0, 0.093023, 0.04, 0.109489, 0.035294, 0.101293, 0.083716," " 0.146402, 0.082838, 0.151165, 0.109778, 0.161746, 0.110884, 0.175754," " 0.132525, 0.191264, 0.142826, 0.202279, 0.154244, 0.210966, 0.161036," " 0.219599, 0.172971, 0.228618, 0.179496, 0.235729, 0.188283" "\n%C A095332 Ratios a(n)/A095331(n) converge as: 1, 1, 1, 1, 1, 0, 1," "4, 0.75, 1, 0.642857, 0.903846, 0.879518, 1.18593, 0.965385," "1.015294, 0.980066, 0.960116, 0.932115, 0.987101, 0.973972, 0.998326," "1.012223, 0.997384, 0.985958, 0.988856, 0.981798, 0.987035, 0.991666," " 0.993762, 0.991831, 0.994302, 0.992846", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "a(n)=A036388(n)-A095333(n)。*/ 1, "Primes in whose binary expansion" " the number of 1-bits is <= 6 + number of 0-bits." "\n%C A095313 Differs from primes (A000040) first time at n=31," " where a(31)=131, while A000040(31)=127, as 127 whose binary" " expansion is 1111111, with 7 1-bits and no 0-bits is the first" " prime excluded from this sequence.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "Complement of A095312 in A000040." " Subset: A095285, from which it differs first time at n=42," " where a(42)=191 (10111111 in binary), while A095285(42)=193" " (11000001 in binary)." "Cf. also A095333.", NULL ); output_OEIS_sequence(stdout, 95333,vecA095333, expi, 1, "Number of A095313-primes in range ]2^n,2^(n+1)]." "\n%C A095333 Ratios a(n)/A036378(n) converge as: 1, 1, 1, 1, 1," " 0.923077, 1, 0.906977, 0.96, 0.890511, 0.964706, 0.898707, 0.916284," " 0.853598, 0.917162, 0.848835, 0.890222, 0.838254, 0.889116, 0.824246," " 0.867475, 0.808736, 0.857174, 0.797721, 0.845756, 0.789034, 0.838964," " 0.780401, 0.827029, 0.771382, 0.820504, 0.764271, 0.811717" "\n%C A095333 Ratios a(n)/A095330(n) converge as: 1, 1, 1, 1, 1," " 0.923077, 1, 0.928571, 1.014085, 1, 1.020747, 1.012136, 1.012674," " 0.973815, 1.003249, 0.997325, 1.002514, 1.00808, 1.009166, 1.002794," "1.004099, 1.000397, 0.997992, 1.000665, 1.002604, 1.003022, 1.003571," "1.00371, 1.001761, 1.001864, 1.001805, 1.001771, 1.001674", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "a(n) = A036378(n)-A095332(n).", extra_H_link ); /******************************/ /* Compute also for higher bases, and similar seq. for A014580. For all odd numbers as well, but for that we should have a simple formula. */ output_OEIS_sequence(stdout, 95298,vecA095298, expi, 1, "Sum of 1-bits between the most and least significant bits" " summed for all primes in range ]2^n,2^(n+1)]." "\n%e A095298 a(1)=0, as only prime in range ]2,4] is 3, which has " " no space between its most and least significant digits." " a(2)=1, as in that range there are two primes 5 (101 in binary)" " and 7 (111 in binary) and summing their middle bits we get 1." " a(3)=2, as there are again two primes, 11 (1011 in binary), and" " 13 (1101 in binary), and summing the bits in the middle we get total 2.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "Cf. A095297, A095334, A095353.", NULL ); output_OEIS_sequence(stdout, 95336,vecA095336, expi, 1, "Sum of 1-fibits in Zekkordf展开A014417(p)对所有的“ρ”素数在范围[2 ^ n,2 ^(n+1)]求和。“ω”\n%e a095336a(1)=1,因为只有素数在范围[2,4]中是3,其“i”斐波那契表示为100。在下一个范围内,我们有素数5和7,其“斐那契”表示分别为1000和1010,因此,“*”a(2)=3。“,”ANTI KARTUUNEN(他的第一个名字,他的姓氏(AT)IKi.Fi),“Jun 03 2004”,“CF.A09529,A095353”,“null”);PtsioEISISH序列(STDUT,95353,VECA095353,π宽度(A00 7314(停止)),“1”,“Zeckendorf扩展A014417(P)的总和为所有”的“素数P”在范围[FIB(n+1),FIB(n+2)](其中,FIB=A000)。“\”N%E A095353A(1)=A(2)=0,因为在范围“ε”中没有素数[1,2]和[2,3]。**A(3)=1,如[3,5]中有“素数3”,“具有斐波那契表示100”。a(4)=3, as in [5,8[ there are" " primes 5 and 7, whose Fibonacci-representations are 1000 and 1010" " respectively, and we have three 1-fibits in total." " a(5)=2, as in [8,13[ there is only one prime 11, with " " Zeckendorf-representation 10100." "\n** DISCARD THE LAST NON-ZERO ENTRY BEFORE SUBMITTING, IT'S INCORRECT **", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "Cf. A095336.", NULL ); output_OEIS_sequence(stdout, 95354,vecA095354, binwidth(A003714(stop)), 1, "Number of primes p such that Fib(n+1) <= p < Fib(n+2)," " (where Fib = A000045)." "\n%e A095354 I.e. gives the number of primes whose Zeckendorf-expansion" " is n fibits long. A(1)=A(2)=0,因为在范围[^ ]中没有素数[1,2]和[2,3]。A(3)=1,如[3,5]中有“素数3”,“具有斐波那契表示100”。A(4)=2,如[5],[8]中有“素数5和7”。a(5)=1, as in [8,13[ there is only one prime 11," " and a(6)=3 as in [13,21[ there are primes 13,17,19." "\n** DISCARD THE LAST NON-ZERO ENTRY BEFORE SUBMITTING, IT'S INCORRECT **", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 03 2004", "Cf. A095353, A036378.", NULL ); /******************************/ output_OEIS_sequence(stdout, 80165,vecA080165, vecA080165[0], /* Contains the count of collected primes. */* 1,“素数在其二进制扩展中最重要的位开始”,“10”…,“ReNeHeul-Zunkelel[ReNeHur.Zunkelelat(AT)LHStReal.com)”,“FEB 03,2003”,“A080166在A000 000中的补充”。C.A09596.“,{NULL”);{OutPuthOEISSH序列(STDUT,80166,VECA080166,VECA080166〔0〕,/*)包含所收集的素数的计数。*/* 1,“素数在其二进制扩展中最重要的位开始”,“11”…,“ReNeHeul-Zunkelel[ReNeHur.Zunkelelat(AT)LHStReal.com)”,“FEB 03,2003”,“A080165在A000 000中的补充”。Cf. A095766.", NULL ); output_OEIS_sequence(stdout, 95765,vecA095765, expi, 1, "Number of primes whose binary expansion begins as '10'" " (A080165) in range ]2^n,2^(n+1)]." "\n%C A095765 I.e. number of primes p such that" " 2^n < p < (2^n + 2^(n-1))." "\n%C A095765 Ratio a(n)/A036378(n) converges as: 0, 0.5, 0.5, 0.6," " 0.571429, 0.461538, 0.521739, 0.511628, 0.506667, 0.510949, 0.509804," " 0.510776, 0.505734, 0.511787, 0.507921, 0.507444, 0.507303, 0.506866," " 0.506173, 0.506115, 0.505487, 0.505395, 0.505318, 0.504951, 0.504786," " 0.504588, 0.504437, 0.504301, 0.50415, 0.504016, 0.503887, 0.503763," " 0.503654" "\n%C A095765 Ratio a(n)/A095766(n) converges as: 0, 1, 1, 1.5, 1.333333," " 0.857143, 1.090909, 1.047619, 1.027027, 1.044776, 1.04, 1.044053," " 1.023202, 1.048285, 1.032193, 1.030228, 1.029645, 1.027847, 1.025001," " 1.024764, 1.022191, 1.021815, 1.021501, 1.020003, 1.019331, 1.01852," " 1.017908, 1.017353, 1.016737, 1.016195, 1.015669, 1.015164, 1.014723" "\n%C A095765 I think this explains also the bias present in" " ratios shown at A095297, A095298, etc.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "a(n) = A036378(n)-A095766(n).", extra_H_link ); output_OEIS_sequence(stdout, 95766,vecA095766, expi, 1, "Number of primes whose binary expansion begins as '11'" " (A080166) in range ]2^n,2^(n+1)]." "\n%C A095766 I.e. number of primes p such that" " (2^n + 2^(n-1)) < p < 2^(n+1)." "\n%C A095766 Ratio a(n)/A036378(n) converges as: 1, 0.5, 0.5, 0.4," " 0.428571, 0.538462, 0.478261, 0.488372, 0.493333, 0.489051, 0.490196," " 0.489224, 0.494266, 0.488213, “0.495412,0.495214,y,y,x,y,y,y,y,y”,“a,i,is,i,ik.Fi”,“a(n)=a03678n(n)-a09575(n)”,“ExtUpH-Link Link”);0.492079、0.492556、0.492697、0.493134、“0.493827”、“0.493885”、“0.494513”、“0.494605”、“0.494682”、“0.495049”、“0.495214”、“0.495214”。*/* 1,* /现在的名字:“基座2的回文素数”听起来有点误导*/y/*甚至“基数2的回文”感觉更好。*“/”其二进制扩展为回文的素数“,”Robert G. Wilson“V(RGWV(AT)RGWV.com)”,“”,“”的A000 000和A048 701的交集。C.A09571.“,{NULL”);②平分(VECA09571,ExpI,0);/* Bisect。*/ output_OEIS_sequence(stdout, 95741,vecA095741, (expi>>1), 1, "Number of base-2 palindromic primes (A016041)" " in range ]2^2n,2^(2n+1)]." "\n%C A095741 Note that there are no such primes in any" " range ]2^(2n-1),2^2n], as all even-length binary" " palindromes are divisible by three (cf. A048702)." "\n%C A095741 Ratio a(n)/A036378(2n) converges as: 1, 0.4, 0.230769," " 0.069767, 0.051095, 0.025862, 0.014268, 0.007006, 0.00461, 0.00193," " 0.00101, 0.000487, 0.000235, 0.000127, 0.000061, 0.000029", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "Bisection of the first diagonal of triangle A095759." " Cf. also A095731.", extra_H_link ); output_OEIS_sequence(stdout, 95743,vecA095743,VECA09573[ 0 ],/*包含所收集的素数的计数。*/* 1,“素数p,其中A037 888(p)=1,即素数,其二元展开”几乎是对称的,只需要一个位翻转就变成了“回文”。“,”安蒂卡特努恩(他的第一个名字,他的姓(AT)IKi.Fi””,“6月12日2004”,“第二行数组A095799”。Cf. A095753, A095748.", NULL ); output_OEIS_sequence(stdout, 95753,vecA095753, expi, 1, "Number of almost base-2 palindromic primes (A095743)" " in range ]2^n,2^(n+1)]." "\n%C A095753 Ratio a(n)/A036378(n) converges as: 0, 0, 1, 0.6, 0.714286," " 0.307692, 0.652174, 0.418605, 0.426667, 0.240876, 0.247059, 0.174569," " 0.136468, 0.08933, 0.084488, 0.055702, 0.049028, 0.031388, 0.026634," " 0.017408, 0.015933, 0.009567, 0.008318, 0.005488, 0.004361, 0.00291," " 0.0024, 0.001555, 0.001295, 0.00085, 0.000695, 0.000465, 0.000369" "\n%C A095753 Ratio a(n)/A095758(n) converges as: 1, 1, 0, 1.5, 1, 1," " 3.75, 1.2, 2, 1.375, 1.909091, 1.446429, 1.652778, 1.515789, 1.718121," " 1.452055, 1.636646, 1.191806, 1.570992, 1.283567, 1.708174, 1.380312," " 1.534842, 1.392177, 1.547004, 1.311334, 1.573801, 1.302205, 1.521016," " 1.419202, 1.570938, 1.389237, 1.546084",“Antti Karttunen(他的姓氏,他的姓(AT)IKI.Fi””,“6月12日2004”,“第二对角线三角形A09575 9”。C.A09572.“,ExtHyLink Link”;{OutPuthOOISSH序列(STDUT,95744,VECA09574,VECCA095744[4],/*)包含所收集的素数的计数。*(1),“素数p,其中A037 888(p)=2,即素数,其二进制扩展”“需要两个比特的翻转”成为“回文”。“,”ANTI KARTUUNEN(他的第一个名字,他的姓(AT)IKi.Fi””,“6月12日2004”,“第三行数组A095799”。Cf. A095754.", NULL ); output_OEIS_sequence(stdout, 95754,vecA095754, expi, 1, "Number of A095744-primes in range ]2^n,2^(n+1)]." "\n%C A095754 Ratio a(n)/A036378(n) converges as: 0, 0, 0, 0, 0.285714," " 0.461538, 0.173913, 0.348837, 0.266667, 0.459854, 0.243137, 0.290948," " 0.172018, 0.246898, 0.114521, 0.159923, 0.083264, 0.1077, 0.049359," " 0.07, 0.031945, 0.044487, 0.019531, 0.026879, 0.011955, 0.016226," " 0.007111, 0.009588, 0.004131, 0.005591, 0.002382, 0.003185, 0.001364", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "The third diagonal of triangle A095759.", extra_H_link ); output_OEIS_sequence(stdout, 95745,vecA095745, vecA095745[0], /* Contains the count of collected primes. *(1),“素数p,其中A037 888(p)=3,即素数的二进制扩展”,“需要三位的翻转,成为”“回文”。“,”安蒂卡特努恩(他的第一个名字,他的姓(AT)IKi.Fi””,“6月12日2004”,“第四行数组A095799”。Cf. A095755.", NULL ); output_OEIS_sequence(stdout, 95755,vecA095755, expi, 1, "Number of A095745-primes in range ]2^n,2^(n+1)]." "\n%C A095755 Ratio a(n)/A036378(n) converges as: 0, 0, 0, 0, 0, 0," " 0.173913, 0.162791, 0.213333, 0.175182, 0.345098, 0.331897, 0.360092," " 0.297146, 0.316502, 0.274654, 0.243744, 0.215498, 0.18403, 0.162898," " 0.131356, 0.117234, 0.090468, 0.079923, 0.060431, 0.053465, 0.0393," " 0.034801, 0.025039, 0.022168, 0.015636, 0.013913, 0.009594", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "The fourth diagonal of triangle A095759.", extra_H_link ); output_OEIS_sequence(stdout, 95746,vecA095746, vecA095746[0], /* Contains the count of collected primes. *(1),“素数p,其中A037 888(p)=4,即素数的二进制扩展”,“需要四位的翻转,成为”“回文”。“,”安蒂卡特努恩(他的第一个名字,他的姓(AT)IKi.Fi””,“6月12日2004”,“第五行数组A095799”。Cf. A095756.", NULL ); output_OEIS_sequence(stdout, 95756,vecA095756, expi, 1, "Number of A095746-primes in range ]2^n,2^(n+1)]." "\n%C A095756 Ratio a(n)/A036378(n) converges as: 0, 0, 0, 0, 0, 0, 0, 0," " 0.093333, 0.072993, 0.129412, 0.12069, 0.225917, 0.266749, 0.255116," " 0.25959, 0.254628, 0.282933, 0.230672, 0.243416, 0.191576, 0.206576," " 0.151524, 0.161145, 0.113419, 0.121187, 0.081914, 0.086887, 0.05722," " 0.061081, 0.039071, 0.041602, 0.026034", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "The fifth diagonal of triangle A095759.", extra_H_link ); output_OEIS_sequence(stdout, 95747,vecA095747, vecA095747[0], /* Contains the count of collected primes. */ 1, "Maximally base-2 asymmetric primes." "\n%C A095747 Primes p for which" " A037888(p)=(A070939(p)-2)/2 (here /2 first subtracts 1 if the" " dividend is odd), i.e. odd primes whose binary expansion" " is as asymmetric as possible.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "A095757, A095749.", NULL ); output_OEIS_sequence(stdout, 95757,vecA095757, expi, 1, "Number of A095747-primes in range ]2^n,2^(n+1)]." "\n%C A095757 Ratio a(n)/A036378(n) converges as: 1, 1, 1, 0.6, 0.285714," " 0.461538, 0.173913, 0.162791, 0.093333, 0.072993, 0.035294, 0.056034," " 0.022936, 0.026675, 0.008911, 0.012962, 0.003814, 0.005493, 0.002407," " 0.00246, 0.00119, 0.001846, 0.000533, 0.000807, 0.000295, 0.000338," " 0.000133, 0.000192, 0.000058, 0.000102, 0.000033, 0.000046, 0.000017", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "The last non-zero terms from each row of triangle A095759." " Bisection: A095760.", extra_H_link ); bisect(vecA095757,expi,1); output_OEIS_sequence(stdout, 95760,vecA095757, ((expi+1)>>1), 1, "Number of A095747-primes in range ]2^(2n-1),2^2n].", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "Bisection of A095757," " the central diagonal of triangle A095759.", extra_H_link ); output_OEIS_sequence(stdout, 95748,vecA095748, vecA095748[0], /* Contains the count of collected primes. */ 1, "Almost maximally base-2 asymmetric primes." "\n%C A095748 Primes p for which" " A037888(p)=(A070939(p)-4)/2 (here /2 first subtracts 1 if the" " dividend is odd), i.e. odd primes whose binary expansion" " contains just two bits mirroring each other (in addition to" " the most and the least significant bits, which are always 1).", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "A095758, A095749, A095743", NULL ); output_OEIS_sequence(stdout, 95758,vecA095758, expi, 1, "Number of A095748-primes in range ]2^n,2^(n+1)]." "\n%C A095758 Ratio a(n)/A036378(n) converges as: 0, 0, 0, 0.4, 0.714286," " 0.307692, 0.173913, 0.348837, 0.213333, 0.175182, 0.129412, 0.12069," " 0.082569, 0.058933, 0.049175, 0.03836, 0.029956, 0.026336, 0.016954," " 0.013562, 0.009328, 0.006931, 0.005419, 0.003942, 0.002819, 0.002219," " 0.001525, 0.001194, 0.000852, 0.000599, 0.000442, 0.000335, 0.000239" "\n%C A095758 Ratio a(n)/A095753(n) converges as: 1, 1, 0, 0.666667, 1," " 1, 0.266667, 0.833333, 0.5, 0.727273, 0.52381, 0.691358, 0.605042," " 0.659722, 0.582031, 0.688679, 0.611006, 0.839063, 0.63654, 0.779079," " 0.58542, 0.724474, 0.651533, 0.718299, 0.646411, 0.762582, 0.635404," " 0.767928, 0.657455, 0.704621, 0.636562, 0.71982, 0.646795", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "The penultimate non-zero terms from each row of triangle A095759." " Cf. A095757, A095742.", extra_H_link ); /*******************************/ output_OEIS_sequence(stdout, 95742,vecA095742, expi, 1, "Sum of A037888(p) for all primes p such that 2^n < p < 2^(n+1)." "\n%e A095742 a(1)=0, as only prime in range ]2,4] is 3, which has" " palindromic binary expansion 11, i.e. A037888(3)=0." " a(2)=0, as in range ]4,8] there are two primes 5 (101 in binary)" " and 7 (111 in binary) so A037888(5) + A037888(7) = 0." " a(3)=2, as in range ]8,16] there are two primes, 11 (1011 in binary), and" " 13 (1101 in binary), thus A037888(11) + A037888(13) = 1+1 = 2." "\n%C A095742 Ratio a(n)/A036378(n) gives the average asymmetricity" " ratio for n-bit primes: 0, 0, 1, 0.6, 1.285714, 1.230769, 1.521739," " 1.604651, 1.973333, 1.978102, 2.462745, 2.515086, 3.014908, 2.996278," " 3.49736, 3.517779, 3.993674, 4.000932, 4.50946, 4.502405, 4.997877," " 4.998792, 5.500352, 5.500462, 5.998361, 5.999852, 6.499427, 6.500684," " 7.000277, 7.000323, 7.499731, 7.499885, 7.999929, etc." " I.e. 2- and 3-bit odd primes are all palindromes, 4-bit primes" " need on average just a one-bit flip to become palindromes, etc.", /* "\n%C A095742 That ratio compared to average asymmetricity ratio" "(A0yyyyy(n)/A0zzzzz(n)) for all n-bit odd numbers converges as: " */ "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "Cf. A095298, A095732 (sums of similar assymetricity measures for" " Zeckendorf-expansion), A095753.", NULL ); output_OEIS_sequence(stdout, 95730,vecA095730,vecA095730[0], 1, "Primes p whose Zeckendorf-expansion A014417(p)" " is palindromic.", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "Intersection of A000040 & A094202." " Cf. A095731 for number of occurrences. A095733 shows the" " corresponding Fibonacci-representations.", NULL ); output_OEIS_sequence(stdout, 95731,vecA095731, binwidth(A003714(stop)), 1, "Number of such primes p (A095730) such that Fib(n+1) <= p < Fib(n+2)" " (where Fib = A000045) and p's Zeckendorf-expansion A014417(p) is" " palindromic." "\n** DISCARD THE LAST NON-ZERO ENTRY BEFORE SUBMITTING IF IT'S INCORRECT **", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "A095732, A095741.", NULL ); output_OEIS_sequence(stdout, 95732,vecA095732, binwidth(A003714(stop)), 1, "Sum of A095734(p) for all primes p such that Fib(n+1) <= p < Fib(n+2)" " (where Fib = A000045)." "\n%e A095732 a(1) = a(2) = 0, as there are no primes in ranges" " [1,2[ and [2,3[. a(3)=1 as in [3,5[ there is prime 3" " with Fibonacci-representation 100, which is just a one fibit-flip" " away from being a palindrome (i.e. A095734(3)=1)." " a(4)=3, as in [5,8[ there are" " primes 5 and 7, whose Fibonacci-representations are 1000 and 1010" " respectively, and the other needs one bit-flip and the other two" " to become palindromes, and 1 + 2 = 3." " a(5)=1, as in [8,13[ there is only one prime 11, with " " Zeckendorf-representation 10100, which needs to have just its" " least significant fibit flipped from 0 to 1 to become palindrome." "\n%C A095732 Ratio a(n)/A095354(n) converges as: 1, 1, 1, 1.5, 1, 1," " 2.333333, 2, 1.714286, 2.090909, 1.9375, 2.416667, 2.513514, 3.109091," " 2.892857, 3.349206, 3.20202, 3.845118, 3.676856, 4.22017, 4.053358," " 4.640382, 4.420446, 5.088608, 4.828676, 5.446601, 5.212762, 5.838853," " 5.611963, 6.257939, 6.017615, 6.668795, 6.424778, 7.069164, 6.819283," " 7.467319, 7.215081, 7.868411, 7.614126, 8.269242" "\n** DISCARD THE LAST NON-ZERO ENTRY BEFORE SUBMITTING IF IT'S INCORRECT **", "Antti Karttunen (his-firstname.his-surname(AT)iki.fi)", "Jun 12 2004", "Cf. A095730, A095731, A095742 (sums of similar assymetricity measures for" " binary-expansion).", NULL ); } /* This part could be more systematic. Still, what we could do: - similarly, divide A027697 into A091206\{3} and odious members of A091209. - Cryptographically strong primes (whatever that currently means...) Must mean A005384 & A005385, "Sophie Germain" -primes. - with the same, "second pass" method (???), count also A074832-primes, and their complement. */ #define add_p_to_vector(p,vec)\ if((vec)[0] < max_terms_collected)\ {\ (vec)[(int)(++(vec)[0])] = (p);\ } prime_found(ULLI p,int max_terms_collected) { int sz = binwidth(p); int w = sz - 1; int one_bits = A000120(p); int zero_bits = sz - one_bits; int twice_one_bits = (one_bits << 1); int is_odious = (one_bits & 1); /* Was = A010060(p); */ int bin_assymetricity = A037888(p); int mod6; int ind; static int prev_w = 0; static ULLI prev_prime = 0; if(w !{ FrpIfw){ffPrTfF(STDRR,“W= %U\N”,W);(0){{ffPrtutULLI(STDUT,P));ffPrTf(StdOUT,%D%D%D\n),W,iSodidiy,TWICHONEON-BITE;{} VECA03638[W]+;VIECA09598[W] +=(ON-BITS-2);/*MSB和LSB在任何情况下都是1。*/FFLUHY(P&PosithOf2(W-1))/*为3,W=1,因此3和1=1。*/ { add_p_to_vector(p,vecA080165); vecA095765[w]++; } else { add_p_to_vector(p,vecA080166); vecA095766[w]++; } vecA095742[w] += bin_assymetricity; if(0 == bin_assymetricity) { add_p_to_vector(p,vecA016041); vecA095741[w]++; } else if(1 == bin_assymetricity) { add_p_to_vector(p,vecA095743); vecA095753[w]++; } else if(2 == bin_assymetricity) { add_p_to_vector(p,vecA095744); vecA095754[w]++; } else if(3 == bin_assymetricity) { add_p_to_vector(p,vecA095745); vecA095755[w]++; } else if(4 == bin_assymetricity) { add_p_to_vector(p,vecA095746); vecA095756[w]++; } if(((sz-2)>>1) == bin_assymetricity) { add_p_to_vector(p,vecA095747); vecA095757[w]++; } else if(((sz-4)>>1) == bin_assymetricity) { add_p_to_vector(p,vecA095748); vecA095758[w]++;或恶素数(A027 699):***(i)({)v{aC0995[W]+;αAddip- toto矢(p,vECA026697);{} { vECa09566[W]+;{}*****素数素数(A0)(在A079523)*/{{VECA09593[W]+;AddipPtotox向量(P,VECCA095228);{} /*,不,它是偶数(在A079523的补充中)。*/{{VECA09592[W]+;AddioPotoTo-向量(P,VECCA095228);{}***************************************************************************************,如果(1,0)=1(1)。*/{{VECA095052[W]+;;AddioPotoTo-向量(P,VECA095072);{}否则(TWICHONSONYBIT==(SZ+1))/*多一个1 -比0位。*/ { vecA095053[w]++; add_p_to_vector(p,vecA095073); } /**********************************/ if(one_bits > (zero_bits-3)) { add_p_to_vector(p,vecA095320); vecA095330[w]++; } else /* if(ones_bits <= (zero_bits-3)) */ { add_p_to_vector(p,vecA095321); vecA095331[w]++; } if(one_bits > (zero_bits-2)) { add_p_to_vector(p,vecA095316); vecA095326[w]++; } else /* if(ones_bits <= (zero_bits-2)) */ { add_p_to_vector(p,vecA095317); vecA095327[w]++; } if(one_bits > (zero_bits-1)) /* Not zero-bit-dominant. */{{VECA095054 [W]+;;AddioPotoTo-向量(P,VECA095074);{}/Tele/*If(单位位< =(零位BITS-1))*//*0位占主导地位?*/{{AddioPotoTo-向量(p,vECA095071);vcA095019[W]+;{} /*,如果1比特的数目正好是二进制宽度的一半,则我们有一个二元平衡的素数:*/i- IF(OnEndoSt==ZooLi位){VECA095018[W] +;}如果(一个比特>零位)/*一个比特占主导地位。*/{{AddioPotoTo-向量(p,VECA095070);vcA095020[W]+;{}/Tele/*If(Onl位<=零位)*//*1位不占支配地位。*/ { add_p_to_vector(p,vecA095075); vecA095055[w]++; } if(one_bits > (1+zero_bits)) { add_p_to_vector(p,vecA095286); vecA095296[w]++; } else /* if(one_bits <= (1+zero_bits)) */ { add_p_to_vector(p,vecA095287); vecA095297[w]++; } if(one_bits > (2+zero_bits)) { add_p_to_vector(p,vecA095314); vecA095334[w]++; } else /* if(one_bits <= (2+zero_bits)) */ { add_p_to_vector(p,vecA095315); vecA095335[w]++; } if(one_bits > (3+zero_bits)) { add_p_to_vector(p,vecA095318); vecA095328[w]++; } else /* if(one_bits <= (3+zero_bits)) */ { add_p_to_vector(p,vecA095319); vecA095329[w]++; } if(one_bits > (4+zero_bits)) { add_p_to_vector(p,vecA095322); vecA095324[w]++; } else /* if(one_bits <= (4+zero_bits)) */ { add_p_to_vector(p,vecA095323); vecA095325[w]++; } if(one_bits > (5+zero_bits)) { add_p_to_vector(p,vecA095284); vecA095294[w]++; } else /* if(one_bits <= (5+zero_bits)) */ { add_p_to_vector(p,vecA095285); vecA095295[w]++; } if(one_bits > (6+zero_bits)) { add_p_to_vector(p,vecA095312); vecA095332[w]++; } else /* if(one_bits <= (6+zero_bits)) */ { add_p_to_vector(p,vecA095313); vecA095333[w]++; } /**********************************/ if(3 == one_bits) { vecA095056[w]++; } if(4 == one_bits) { vecA095057[w]++; add_p_to_vector(p,vecA095077); } if(1 == (sz - one_bits)) { vecA095058[w]++; add_p_to_vector(p,vecA095078); } if(2 == (sz - one_bits)) { vecA095059[w]++; add_p_to_vector(p,vecA095079); } /*** Modulo 4. *****(1=(p和3)){VECA09507[W]++;} /*素数为4k+4的形式。*//否则{VECA09500 8[W] ++;} /*素数为4K + 3形式。*/γ/ **模8。************************************/{{情况1:{{VECA09500 9[W+++;8*Primes的形式8K+ 1。*/VIECA095013[W] ++;/*素数的形式8K+ - 1。*/断裂;{} 3:{{VECA095010[W] ++;/*Primes形式8K+3。*/VIECA095014[W] ++;/*素数的形式8K+ - 3。*/断裂;{} 5:{{VECA095011[W] ++;/*素数的形式8K+ 5。*/VIECA095014[W] ++;/*素数的形式8K+ - 3。*/断裂;{} 7:{{VECA095012[W] ++;/*素数的形式8K+ 5。*/VIECA095013[W] ++;/*素数的形式8K+ - 1。断言;{}f}(STDRR,“素数”);ffpTrpululi(STDRR,p);ffPINTF(STDRR,“具有权重%D和可恶%d,”,w,isidiodiy);ffPINTF(STDRR),具有不可能的同余模8:%D\n,,((int)(p(7)));*/****/{ MOD6=(P% 6);IF(1=MOD6){VECA095015[W] ++;}6/*素数为6K+ 1。*/^否则如果(5=MOD6){VECA095016[W] ++;}6/*素数的形式6K+ 5。*/γ/ **模5。****************〉*{〉{案件0:{霹雳;}/*五本身。忽略。*/^情形1:{VECA095021[W] ++;断言;}情况2:{VECA095022[W] ++;断言;{情况3:{VECA095023 [W] ++;断言;}情况4:{VECA095024[W] ++;断言;}{}/**Zekkordf展开(斐波那契数系)。******(1)/*也检查Zekkordf展开。*/{{ulul-Ze= A000 314P(p);πFixIt=BiLoad(ZE);iint NothOfFix1FiBase= A000 0120(ZE);int int=FiBodiy=(NuthOfFix1Fiband 1);/*=A010060(ZE);*/In IsUpPiffyWythOffjPrime=(A00 7814(ZE)和1);以奇数为0的结尾。*/In int ZeasasyMultuy=A037 88(ZE);/*= A09534(P)。*/Vya095336[W] + = NUMYOFFY 1FIX;VIECA095353[NUMFOFFO FiBITS] + = NUMYOFFY 1FIX;VECA095354[NUMUFOFFIOFITS] ++;/*Primes在此F范围内。{ AdHythPotoTo-向量(P,VECA0957);VECA0953[NuMufOfFiBITS] ++;{} VECA0953[NuMufOFFiBITS] + = ZeasasySuthusiuy;{If(iSfimdidiy){{VECA095063[W+++;AddithPotoTo-向量(P,VECCA095083]);}} /*,*,不,它是FibviL。*/ωIf(0=Ze)*/{{VECA095064 [W]+;AddipPotoTo-向量(P,VECCA095084);{} If(IsUpPippyWythFo.PrimePrime/*),它在A00 1950。*/{{VECA09591[W]+;AddioPytoTo-向量(P,VECCA09528 1);{} ELS/*NO,下WythOff-Prime(A000 0201)。*/{{VECA095290[W] ++;AddithPotoTo-向量(P,VECA095280);{}开关(ZE和7)/*我们对三个最右边的比特感兴趣。*/ { case 0: /* 000 */ { vecA095065[w]++; add_p_to_vector(p,vecA095085); vecA095062[w]++; add_p_to_vector(p,vecA095082); /* 00 */ vecA095060[w]++; add_p_to_vector(p,vecA095080); /* 0 */ break; } case 1: /* 001 */ { vecA095066[w]++; add_p_to_vector(p,vecA095086); vecA095061[w]++; add_p_to_vector(p,vecA095081); /* 1 */ break; } case 2: /* 010 */ { vecA095067[w]++; add_p_to_vector(p,vecA095087); vecA095060[w]++; add_p_to_vector(p,vecA095080); /* 0 */ break; } case 4: /* 100 */ { vecA095068[w]++; add_p_to_vector(p,vecA095088); vecA095062[w]++; add_p_to_vector(p,vecA095082); /* 00 */ vecA095060[w]++; add_p_to_vector(p,vecA095080); /* 0 */ break; } case 5: /* 101 */ { vecA095069[w]++; add_p_to_vector(p,vecA095089); vecA095061[w]++; add_p_to_vector(p,vecA095081); /* 1 */ break; } default: { fprintf(stderr,"Prime "); fprint_ulli(stderr,p); fprintf(stderr, " with weight %d and odiousness %d,", w,is_odious); fprintf(stderr," has impossible Zeckendorf-expansion: "); fprint_ulli(stderr,ze); fprintf(stderr," as modulo 8 it results %u.\n", ((int)(ze&7))); exit(1); } } } /*** Is the Legendre-vector a valid Dyck-path? (更重的测试)**/yi]如果(W< = GythyDycNeSyCykKeDyOnLyUpth-toIn){{INTI=JSZ-DIVIGING指数(P,(P-1)/ 2);{IF(3=(p和3))/*素数形式4k+3。*/{{int Max?DyCKY-前缀=((0==di))?(P-1):(DI-1));AddipPtoto矢(DI,VECCA095104);AddioPotoTo-向量(Max,DykCl前缀,VECA095105);v VECA095106[W]+=Di;vECA095107[W] +=Max PykCl前缀;εIF(0=DI)/*是有效的Dyk路径。*/{{VECA095092[W] ++;AddithPotoTo-向量(P,VECCA095102);γAddipPtoto矢((P3)>2,VECA095227);/*对应K值。*/{} {{VECA095093[W]+;;AddioPotoTo-向量(P,VECCA095103);AddipPtoto矢(DI,VECCA095108);AddipPtoto矢((P3)>2,VECA095253);/*对应K值。*/}}{}(0=DI)/*上半部是有效的Dyk路径?*/{{VECA095094[W] ++;AddioPytoTo-向量(P,VECA080114);} { VECA095095[W] ++;AddithPotoTo-向量(P,VECA080115);}{}****孪生素数。*****((PrimyPrim+2)=p)/*找到一对素数。(孪生素数)*/{{INT W2= BIN宽度(PrimePrimy)- 1;VECA095017[W2] ++;/*较小孪生素数(6K+ 5素数的子集)。*/y}〉PrimePrime= p;{} /*A095100是所有奇数形式的4K+3,其雅可比向量=有效的MysTKIN路径.*和A095101是它的补码(4k+3整数)。(计算它们的潜水指数和它的平均值为2),^ ^ n(2+(n+1))范围。Moments, etc.) A095090 and A095091 are for the respective counts. */ iterate_over_4k_plus3(int upto_w,int max_terms_collected) { int w,n,next_lim; /* w=1, n=3; w=2, n=7; w=3, n=11,15; w=4, n=19,21,25,29; */ for(w=1, n=3; w <= upto_w; w++) { fprintf(stderr,"iterate_over_4k_plus3: w=%u\n",w); fflush(stderr); for(next_lim = power_of_2(w+1); n < next_lim; n += 4) { int di = js_diving_index(n,(n-1)/2); int max_dyck_prefix = ((0 == di) ? (N-1):(DI-1);γAddipPtoto矢(DI,VECCA095269);AddipPtoto矢(Max,DykCl前缀,VECA095270);V.VCa095109[W] +DI;VECA09510[W] + = Max PycKyPrimeIt;γIF(0=DI)/*,它是一个有效的MytZKIN路径。*/{{VECA095090[W]+;;AddipPtoto矢(n,VECA095100);γAddipPtoto矢((n-3)>2,VECCA09527 4);/*对应K值。*/{} {{VECA095091[W]+;;AddipPtoto矢(n,VECA095101);Addip- toto矢(DI,VECCA095171);AddipPtoto矢((n-3)>2,VECA095255);/*对应K值。(John Moyer)(JRM(AT)RSOKKY,*/Y/*版权1999年-2004年(C)John Moyer)。*/ /* */ /* This is actually borrowed from his 64bit sieve program */ /* (11.December 2002 version), */ /* which is available at */ /* ftp://ftp.rsok.com/pub/source/sieve2310_64bit.c */ /* See also: http://www.rsok.com/~jrm/ */ /* */ /* */ /**********************************************************************/ #define STEP_CONST 128 int small_primes[343] = { 2,3,5,7,11,13,17,19,23,29, 31,37,41,43,47,53,59,61,67,71, 73,79,83,89,97,101,103,107,109,113, 127,131,137,139,149,151,157,163,167,173, 179,181,191,193,197,199,211,223,227,229, 233,239,241,251,257,263,269,271,277,281, 283,293,307,311,313,317,331,337,347,349, 353,359,367,373,379,383,389,397,401,409, 419,421,431,433,439,443,449,457,461,463, 467,479,487,491,499,503,509,521,523,541, 547,557,563,569,571,577,587,593,599,601, 607,613,617,619,631,641,643,647,653,659, 661,673,677,683,691,701,709,719,727,733, 739,743,751,757,761,769,773,787,797,809, 811,821,823,827,829,839,853,857,859,863, 877,881,883,887,907,911,919,929,937,941, 947,953,967,971,977,983,991,997,1009,1013, 1019,1021,1031,1033,1039,1049,1051,1061,1063,1069, 1087,1091,1093,1097,1103,1109,1117,1123,1129,1151, 1153,1163,1171,1181,1187,1193,1201,1213,1217,1223, 1229,1231,1237,1249,1259,1277,1279,1283,1289,1291, 1297,1301,1303,1307,1319,1321,1327,1361,1367,1373, 1381,1399,1409,1423,1427,1429,1433,1439,1447,1451, 1453,1459,1471,1481,1483,1487,1489,1493,1499,1511, 1523,1531,1543,1549,1553,1559,1567,1571,1579,1583, 1597,1601,1607,1609,1613,1619,1621,1627,1637,1657, 1663,1667,1669,1693,1697,1699,1709,1721,1723,1733, 1741,1747,1753,1759,1777,1783,1787,1789,1801,1811, 1823,1831,1847,1861,1867,1871,1873,1877,1879,1889, 1901,1907,1913,1931,1933,1949,1951,1973,1979,1987, 1993,1997,1999,2003,2011,2017,2027,2029,2039,2053, 2063,2069,2081,2083,2087,2089,2099,2111,2113,2129, 2131,2137,2141,2143,2153,2161,2179,2203,2207,2213, 2221,2237,2239,2243,2251,2267,2269,2273,2281,2287, 2293,2297,2309 }; /* expand scheme from 30 to 2310 30 == 2*3*5 and 8 == (2-1)*(3-1)*(5-1) 2*3*5*7*11 == 2310 1*2*4*6*10 == 480 bits == 60 bytes ==> prime or not prime for 38.5 integers per byte In each 2310 integers, for N >= 1, the numbers that might be prime are: N*2310+1, N*2310+13, N*2310+17, . . . N*2310+13*13, N*2310+13*17, . . . N*2310+2309 */ unsigned long maskbits[32] = { 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020, 0x00000040, 0x00000080, 0x00000100, 0x00000200, 0x00000400, 0x00000800, 0x00001000, 0x00002000, 0x00004000, 0x00008000, 0x00010000, 0x00020000, 0x00040000, 0x00080000, 0x00100000, 0x00200000, 0x00400000, 0x00800000, 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000 }; /* value of mask_bit_index is bit corresponding to integer modulo 2310 mask_bit_index[i] is zero if this is integer that could not possibly be prime or bit number from 1 to 480 if it could be prime. */ unsigned int mask_bit_index[2310]; /* bit is one to 480 */ void clear_one_mask_bit(unsigned long *sieve_array, int bit) { int k; k = (bit - 1) >> 5 ; /* divide by 32 */ sieve_array[k] &= ~(maskbits[(bit - 1) & 31]); /* modulo 32 */ #ifdef DEBUG printf("sieve_array[%d]=0x%08x, ~(maskbits[(%d - 1) & 31]=0x%08x\n", k, sieve_array[k], bit, ~(maskbits[(bit - 1) & 31])); #endif } /* bit is one to 480 */ int test_one_mask_bit(unsigned long *sieve_array, int bit) { int k; k = (bit - 1) >> 5 ; /* divide by 32 */ return (sieve_array[k] & (maskbits[(bit - 1) & 31])); /* modulo 32 */ } int compute_primes(ULLI start, ULLI stop,int max_terms_collected) { unsigned int b; unsigned long s; ULLI k, j, ii; ULLI i; unsigned int bit_index = 0; ULLI indx; int c; unsigned long *list; FILE *fp; ULLI stop_here, t_stop_here; char ifnam[2048]; int errflag = 0; int write_flag = 0; s = (stop+2309)/2310 * 60 +60; /* bytes required */ fprintf(stderr,"Computing from "); fprint_ulli(stderr,start); fprintf(stderr," to "); fprint_ulli(stderr,stop); fprintf(stderr,", "); fprint_ulli(stderr,((ULLI)s)); fprintf(stderr," bytes required.\n\n\n"); /* print the first few small primes if they were requested */ for ( i = 0 ; i < 344 ; i ++) { if ( small_primes[i] > stop ) return 0; /* return to OS if nothing more to do */ if ( small_primes[i] >= start ) { prime_found(small_primes[i],max_terms_collected); } } fprintf(stderr,"attempting to malloc %lu bytes\n", s); list = malloc(s); if ( list == NULL ) { fprintf(stderr, "Could not allocate %lu bytes of memory\n", s); exit(1); } memset(list,0xff,s); j = 5; /* create array mapping 2310 integers to 480 bits */ mask_bit_index[0] = bit_index++; mask_bit_index[1] = bit_index++; for ( ii = 2; ii < 2310 ; ii++ {{同时(SimulyPrimes [j]<ii)] j++;{/*,如果模2310的任何素数因子,则不能是素*/IIF(ii=SimultPrimes [j])((Ⅱ% 2)!= 0和(ii % 3)!= 0和(ii % 5)!= 0和(ii % 7)!= 0和(ii % 11)!=0)) { mask_bit_index[ii] = bit_index++; } else mask_bit_index[ii] = 0; #ifdef DEBUG printf("mask_bit_index[%d]=%u, j=%d\n", ii, mask_bit_index[ii], j); #endif } indx = 0L; stop_here = (unsigned long) (sqrt((stop+2309.0)/2310.0 *2310.0) + 0.5); for ( k = 0 ; k*2310 < stop ; k+=STEP_CONST ) { /* no need to sieve numbers larger than this range */ t_stop_here = (k+STEP_CONST)*2310UL; if ( stop_here < t_stop_here ) t_stop_here = stop_here; for( i = 13 ; i <= t_stop_here ; i+=2 ) { /* start with 13 since multiples of 2,3,5,7,11 are handled by the storage method */ /* increment by 2 for odd numbers only */ /* if ( (i >= ((k+STEP_CONST)* 2310))) break; /* no need to sieve numbers larger than this range, do next k */ b = i % 2310; /* i could not possibly be prime if remainder is 2,3,4,7,11 */ if ( mask_bit_index[b] == 0 || (i < k*2310 && (test_one_mask_bit(&list[i/2310 *15], mask_bit_index[b]))==0 ) ) continue; /* or this one already marked so it is not a prime */ /* */ if ( k == 0 ) indx = i*i; else indx = (k*2310) - (k*2310)%i +i; if ( (indx & 1) == 0 ) indx += i; /* start with i*i since any integer < i has already been sieved */ /* add 2 * i to avoid even numbers and mark all multiples of this prime */ for ( ; indx < (k+STEP_CONST)*2310 && indx <= (stop+2309)/2310*2310 ; indx +=(i+i)) { b = indx % 2310; /* modulo 2310 */ if ( mask_bit_index[b] ![CurryOnOn.MaskyBIT(&列表[Inx/ 2310×15 ],MaskSuthBixDead [b]);{ IFDEF调试} Prtf(“Dnx= %LU,MaskyBiTyd[%D]=%D\n”,Inx,b,MaskSuthBixDead [b]);= 0){* / {{ if(k* 2310<开始)〉i=开始;另一个i=k* 2310;if((i和1)=0),i i++;/*强迫它为奇*/i,如果(2311>i)i=2311;则为(i;i=Stand & & i(k+阶跃常数)*2310;i+= 2){{bb= i %2310;if if(MasksBiTyByth[B])!= 0 & & > =开始& &(TestOnOnthMaskyBIT(和列表[I/ 2310×15 ],MaskSuthBixDead [B]))!= 0){{Prime}发现(i,Max,TysMySub);} } /*为k*/i}(i写)({写=f=(fp= FPEN(IFNAN,WB))){{ } PrRor(IFNAM)〉,返回1;i } fDrad(list,1L,s,FP);=f{Prftf(STDRR),“写错误:I= %卢,S=%Lu\n”,i,s);}{}返回0;{}