cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A225889 Least prime p_m such that n = p_m-p_{m-1}+...+(-1)^(m-k)*p_k for some 0

Original entry on oeis.org

3, 5, 7, 5, 7, 11, 13, 11, 11, 17, 19, 17, 17, 23, 17, 23, 23, 31, 23, 41, 23, 41, 31, 47, 29, 47, 37, 59, 41, 59, 37, 59, 43, 67, 37, 67, 43, 67, 43, 73, 61, 83, 53, 83, 47, 101, 61, 97, 53, 97, 59, 97, 59, 103, 61, 109, 67, 127, 67, 131
Offset: 1

Views

Author

Zhi-Wei Sun, May 19 2013

Keywords

Comments

By a conjecture of the author, a(n) <= 2*n+2.2*sqrt(n), and moreover a(n) <= n+4.6*sqrt(n) if n is odd. Clearly a(n)>n. We guess that a(2n)/(2n) --> 2 as n tends to the infinity.
Note that this sequence is different from A222579 which involves a stronger conjecture of the author.
Zhi-Wei Sun also conjectured that any positive even integer m can be written in the form p_n-p_{n-1}+...+(-1)^{n-k}*p_k with k < n and 2m-3.6*sqrt(m+1) < p_n < 2m+2.2*sqrt(m).

Examples

			a(7) = 13 since 7 = 13-11+7-5+3.
a(20) = 41 since 20 = 41-37+31-29+23-19+17-13+11-7+5-3.
		

Crossrefs

Programs

  • Mathematica
    s[0_]:=0
    s[n_]:=s[n]=Prime[n]-s[n-1]
    Do[Do[If[s[j]-(-1)^(j-i)*s[i]==m,Print[m," ",Prime[j]];Goto[aa]],{j,PrimePi[m]+1,PrimePi[2m+2.2Sqrt[m]]},{i,0,j-2}];
    Print[m," ",counterexample];Label[aa];Continue,{m,1,100}]

A222580 Number of ways to write n=p_m-p_{m-1}+...+(-1)^{m-k}p_k with k

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 3, 2, 3, 2, 2, 2, 3, 1, 2, 2, 3, 2, 2, 1, 2, 3, 3, 1, 1, 2, 4, 2, 1, 3, 2, 2, 2, 3, 3, 2, 2, 2, 2, 6, 1, 2, 3, 4, 2, 3, 3, 2, 3, 4, 2, 4, 2, 1, 1, 4, 3, 4, 2, 4, 1, 3, 3, 2, 4, 4, 2, 3, 2, 3, 3, 3, 3, 2, 5, 1, 3, 4, 7, 4, 2, 3, 2, 1, 5, 2, 4, 2, 7, 3, 3, 3, 4, 5, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 25 2013

Keywords

Comments

Conjecture: All the terms are positive.
See also the comments related to A222579.

Examples

			a(9)=2 since 9=11-7+5=19-17+13-11+7-5+3 with 12, 4, 20, 2 all practical.
a(806)=1 since 806=p_{358}-p_{357}+...+p_{150}-p_{149} with p_{358}=2411<=3*806=2418, and 2412 and p_{149}-1=858 are both practical.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n]
    Pow[n_,i_]:=Pow[n,i]=Part[Part[f[n],i],1]^(Part[Part[f[n],i],2])
    Con[n_]:=Con[n]=Sum[If[Part[Part[f[n],s+1],1]<=DivisorSigma[1,Product[Pow[n,i],{i,1,s}]]+1,0,1],{s,1,Length[f[n]]-1}]
    pr[n_]:=pr[n]=n>0&&(n<3||Mod[n,2]+Con[n]==0)
    pp[k_]:=pp[k]=pr[Prime[k]+1]==True
    pq[k_]:=pq[k]=pr[Prime[k]-1]==True
    s[0_]:=0
    s[n_]:=s[n]=Prime[n]-s[n-1]
    a[n_]:=a[n]=Sum[If[pp[j]==True&&pq[i+1]==True&&s[j]-(-1)^(j-i)*s[i]==n,1,0],{j,PrimePi[n]+1,PrimePi[3n]},{i,0,j-2}]
    Table[a[n],{n,1,100}]

A226115 Least positive integer not of the form p_m - p_{m-1} + ... +(-1)^(m-k)*p_k with 0 < k < m <= n, where p_j denotes the j-th prime.

Original entry on oeis.org

1, 2, 3, 6, 7, 10, 11, 14, 18, 18, 20, 20, 24, 24, 28, 28, 34, 34, 40, 40, 42, 42, 46, 46, 46, 54, 56, 56, 58, 58, 60, 64, 78, 78, 80, 80, 94, 94, 98, 98, 104, 104, 106, 106, 106, 106, 118, 118, 118, 118, 122, 122, 140, 140, 146, 146, 152, 152, 158, 158
Offset: 1

Views

Author

Zhi-Wei Sun, May 27 2013

Keywords

Comments

Conjecture: sqrt(2*a(n)) > sqrt(p_n)-0.7 for all n > 0, and a(n) is even for any n > 7.
Note that f(n) = sqrt(2*a(n))-sqrt(p_n)+0.7 is approximately equal to 0.000864 at n = 651. It seems that f(n) > 0.1 for any other value of n.

Examples

			a(4) = 6,  since 2,3,5,7 are the initial four primes, and 1=3-2, 2=5-3, 3=7-5+3-2, 4=5-3+2, 5=7-5+3.
		

Crossrefs

Programs

  • Mathematica
    s[0_]:=0
    s[n_]:=s[n]=Prime[n]-s[n-1]
    R[j_]:=R[j]=Union[Table[s[j]-(-1)^(j-i)*s[i],{i,0,j-2}]]
    t=1
    Do[Do[Do[If[MemberQ[R[j],m]==True,Goto[aa]],{j,PrimePi[m]+1,n}];Print[n," ",m];t=m;Goto[bb];
    Label[aa];Continue,{m,t,Prime[n]-1}];Print[n," ",counterexample];Label[bb],{n,1,100}]
Showing 1-3 of 3 results.