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-10 of 12 results. Next

A211190 Number of ways to write 2n = p+2q+3r with p,q,r terms of A210479.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 3, 4, 3, 3, 3, 4, 4, 5, 5, 5, 5, 4, 7, 6, 6, 7, 5, 6, 7, 7, 7, 7, 5, 5, 8, 6, 7, 8, 5, 8, 10, 9, 9, 11, 9, 8, 12, 9, 8, 10, 7, 7, 10, 8, 7, 9, 7, 6, 12, 8, 9, 11, 7, 8, 10, 8, 7, 11, 8, 7, 11, 7, 7, 10, 6, 5, 8, 7, 6, 10, 7, 7, 10, 7, 6, 11, 7, 7, 10, 5, 5, 10, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 03 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>8. Moreover, for positive integers a<=b<=c, all integers n>=3(a+b+c) with n-a-b-c even can be written as a*p+b*q+c*r with p,q,r terms of A210479, if and only if (a,b,c) is among the following 6 triples: (1,2,3), (1,2,4), (1,2,8), (1,2,9), (1,3,5), (1,3,8).
The author also conjectured that if n>8 is odd, different from 201 and 447, and not congruent to 1 or -1 modulo 12, then n can be written as a sum of three terms of A210479.

Examples

			a(10)=1 since 2*10=5+2*3+3*3 with 3 and 5 terms of A210479.
		

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)
    p[k_]:=p[k]=pr[Prime[k]-1]==True&&pr[Prime[k]+1]==True
    q[n_]:=q[n]=PrimeQ[n]==True&&pr[n-1]==True&&pr[n+1]==True
    a[n_]:=a[n]=Sum[If[p[j]==True&&p[k]==True&&q[2n-2Prime[j]-3Prime[k]]==True,1,0],{j,1,PrimePi[n]},{k,1,PrimePi[(2n-2Prime[j])/3]}]
    Do[Print[n," ",a[n]],{n,1,100}]

A287681 Twin practical numbers: numbers k such that both k and k+2 are practical numbers.

Original entry on oeis.org

2, 4, 6, 16, 18, 28, 30, 40, 54, 64, 78, 88, 126, 160, 196, 198, 208, 270, 304, 306, 340, 378, 390, 414, 448, 460, 462, 510, 520, 544, 558, 700, 702, 726, 798, 810, 858, 868, 880, 918, 928, 966, 990, 1024, 1120, 1216, 1230, 1240, 1288, 1300, 1350, 1408, 1456
Offset: 1

Views

Author

Amiram Eldar, May 29 2017

Keywords

Comments

Melfi proved that this sequence is infinite.

Crossrefs

Programs

  • Mathematica
    practicalQ[n_] := Module[{f, p, e, prod=1, ok=True}, If[n<1 || (n>1 && OddQ[n]), False, If[n==1, True, f=FactorInteger[n]; {p, e} = Transpose[f]; Do[If[p[[i]] > 1+DivisorSigma[1, prod], ok=False; Break[]]; prod=prod*p[[i]]^e[[i]], {i, Length[p]}]; ok]]];
    a={}; p1=False; k=2; While[Length[a]<100, p2=practicalQ[k]; If[p1 && p2, a=AppendTo[a,k-2]]; p1 = p2; k+=2];a

A258836 Least practical number q with q-1 and q+1 twin prime such that n = q'/q for some practical number q' with q'-1 and q'+1 twin prime.

Original entry on oeis.org

4, 6, 4, 18, 6, 12, 6, 30, 12, 6, 18, 6, 150, 30, 4, 12, 60, 4, 12, 12, 42, 30, 240, 18, 6, 12, 4, 270, 12, 6, 42, 6, 6, 30, 12, 12, 180, 6, 60, 6, 30, 150, 30, 30, 4, 18, 2550, 4, 18, 12, 42, 6, 150, 30, 12, 60, 4, 6, 60, 4, 462, 180, 1230, 18, 30, 108, 60, 180, 12, 6, 30, 6, 570, 420, 462, 180, 6, 4, 198, 42, 522, 600, 1050, 42, 12, 12, 4, 60, 432, 18, 12, 60, 30, 60, 6, 12, 150, 60, 30, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Jun 11 2015

Keywords

Comments

Conjecture: a(n) exists for any n > 0. Moreover, any positive rational number r can be written as q'/q, where q and q' are terms of A258838 (i.e., q is practical with q-1 and q+1 twin prime, and q' is practical with q'-1 and q'+1 twin prime).
This implies that there are infinitely many "sandwiches of the second kind" (i.e., triples {q-1,q,q+1} with q practical and q-1 and q+1 twin prime).
I have verified the conjecture for all those rational numbers r = n/m with m,n = 1,...,1000. -Zhi-Wei Sun, Jun 15 2015

Examples

			a(1) = 4 since 1 = 4/4 with 4 practical and 4-1 and 4+1 twin prime.
a(2) = 6 since 2 = 12/6, 6 is practical with 6-1 and 6+1 twin prime, and 12 is practical with 12-1 and 12+1 twin prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=FactorInteger[n]
    Pow[n_,i_]:=Part[Part[f[n],i],1]^(Part[Part[f[n],i],2])
    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_]:=n>0&&(n<3||Mod[n,2]+Con[n]==0)
    SW[n_]:=PrimeQ[n-1]&&PrimeQ[n+1]&&pr[n]
    Do[k=0;Label[bb];k=k+1;If[PrimeQ[Prime[k]+2]&&pr[Prime[k]+1]&&SW[n*(Prime[k]+1)],Goto[aa],Goto[bb]];
    Label[aa];Print[n," ",Prime[k]+1];Continue,{n,1,100}]

A258838 Practical numbers q with q-1 and q+1 twin primes: "Sandwiches of the second kind".

Original entry on oeis.org

4, 6, 12, 18, 30, 42, 60, 72, 108, 150, 180, 192, 198, 228, 240, 270, 312, 348, 420, 432, 462, 522, 570, 600, 660, 810, 828, 858, 882, 1020, 1032, 1050, 1092, 1152, 1230, 1290, 1302, 1320, 1428, 1452, 1482, 1488, 1620, 1722, 1872, 1932, 1950, 1998, 2028, 2088, 2112, 2130, 2142, 2268, 2310, 2340, 2550, 2592, 2688, 2730
Offset: 1

Views

Author

Zhi-Wei Sun, Jun 12 2015

Keywords

Comments

The author introduced two kinds of "sandwiches" in 2013. The conjecture in A258836 essentially says that {a(m)/a(n): m,n = 1,2,3,...} coincides with the set of all positive rational numbers. This implies that the sequence contains infinitely many terms.

Examples

			a(1) = 4 since 4 is practical with 4-1 and 4+1 twin prime.
a(2) = 6 since 6 is practical with 6-1 and 6+1 twin prime.
a(3) = 12 since 12 is practical with 12-1 and 12+1 twin prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=FactorInteger[n]
    Pow[n_,i_]:=Part[Part[f[n],i],1]^(Part[Part[f[n],i],2])
    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_]:=n>0&&(n<3||Mod[n,2]+Con[n]==0)
    SW[n_]:=PrimeQ[n-1]&&PrimeQ[n+1]&&pr[n]
    n=0;Do[If[SW[m],n=n+1;Print[n," ",m]],{m,1,2730}]

A210480 Number of primes p

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 23 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>3.
This is stronger than Goldbach's conjecture and the author's conjecture that any odd number greater than one is the sum of a prime and a practical number. Also, it implies that there are infinitely many primes p with p-1 and p+1 both practical.
The author has verified this new conjecture for n up to 10^7.

Examples

			a(1846)=1 since 1846=1289+557 with 1289 and 557 both prime, and 1288 and 1290 both practical.
a(15675)=1 since 15675=919+14756 with 919 prime, and 918, 920, 14756 all 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)
    a[n_]:=a[n]=Sum[If[pr[Prime[k]-1]==True&&pr[Prime[k]+1]==True&&(PrimeQ[n-Prime[k]]==True||pr[n-Prime[k]]==True),1,0],{k,1,PrimePi[n-1]}]
    Do[Print[n," ",a[n]],{n,1,100}]

A210681 Number of ways to write 2n = p+q+r (p<=q) with p, q, r-1, r+1 all prime and p-1, p+1, q-1, q+1, r all practical.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 3, 3, 2, 2, 3, 5, 6, 4, 3, 2, 4, 7, 10, 8, 5, 3, 5, 8, 12, 10, 6, 2, 3, 6, 11, 12, 6, 4, 3, 5, 9, 10, 6, 5, 4, 5, 8, 8, 5, 7, 7, 6, 8, 7, 6, 6, 8, 6, 7, 8, 5, 7, 8, 6, 7, 7, 4, 6, 7, 5, 6, 8, 4, 8, 6, 4, 5, 7, 5, 5, 8, 5, 6, 8, 6, 4, 7, 6, 6, 7, 5, 3, 7, 3, 4, 8, 6, 8, 5, 4, 3, 7, 6
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 29 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4.
This conjecture involves two kinds of sandwiches introduced by the author, and it is much stronger than the Goldbach conjecture for odd numbers. We have verified the conjecture for n up to 10^7.
Zhi-Wei Sun also made the following conjectures:
(1) Any even number greater than 10 can be written as the sum of four elements in the set
S = {prime p: p-1 and p+1 are both practical}.
Also, every n=3,4,5,... can be represented as the sum of a prime in S and two triangular numbers.
(2) Each integer n>7 can be written as p + q + x^2 (or p + q + x(x+1)/2), where p is a prime with p-1 and p+1 both practical, and q is a practical number with q-1 and q+1 both prime.
(3) Every n=3,4,... can be written as the sum of three elements in the set
T = {x: 6x is practical with 6x-1 and 6x+1 both prime}.
(4) Any integer n>6 can be represented as the sum of two elements of the set S and one element of the set T.
(5) Each odd number greater than 11 can be written in the form 2p+q+r, where p and q belong to S, and r is a practical number with r-1 and r+1 both prime.

Examples

			a(5)=1 since 2*5=3+3+4 with 3 and 5 both prime, and 2 and 4 both practical.
a(6)=2 since 2*6=3+3+6=3+5+4 with 3,5,7 all prime and 2,4,6 all 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&&pr[Prime[k]+1]==True
    pq[n_]:=pq[n]=PrimeQ[n-1]==True&&PrimeQ[n+1]==True&&pr[n]==True
    a[n_]:=a[n]=Sum[If[pp[j]==True&&pp[k]==True&&pq[2n-Prime[j]-Prime[k]]==True,1,0],{j,1,PrimePi[n-1]},{k,j,PrimePi[2n-Prime[j]]}]
    Do[Print[n," ",a[n]],{n,1,100}]

A222579 Least prime p_m with p_m+1 practical 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, 19, 11, 11, 17, 19, 17, 17, 23, 19, 23, 23, 31, 31, 41, 23, 41, 31, 47, 29, 47, 41, 59, 53, 59, 47, 59, 59, 79, 41, 83, 59, 79, 47, 83, 71, 83, 53, 83, 47, 103, 79, 107, 53, 103, 59, 103, 89, 103, 71, 131, 79, 127, 103, 131, 79, 127, 83, 149, 71, 127, 89, 127, 107, 127, 79, 191, 83, 149, 107, 197, 83, 149, 131, 167, 139, 149, 103, 149, 89, 149, 103, 167, 127, 179, 149, 167, 107, 167, 139, 167, 107, 179, 103, 179
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 25 2013

Keywords

Comments

Conjecture: a(n)<=3n for all n>0. Moreover, a(2n-1)/(2n-1) and a(2n)/(2n) have limits 1 and 2 respectively, as n tends to the infinity.

Examples

			a(6)=11 since 6=11-7+5-3 with 12 and 2 both practical;
a(7)=19 since 7=19-17+13-11+7-5+3-2 with 20 and 1 both practical;
a(806)=p_{358}=2411 since 806=p_{358}-p_{357}+...+p_{150}-p_{149} with p_{358}+1=2412 and p_{149}-1=858 both practical. Note that a(806)/806 is about 2.9913.
		

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]
    Do[Do[If[pp[j]==True&&pq[i+1]==True&&s[j]-(-1)^(j-i)*s[i]==m,Print[m," ",Prime[j]];Goto[aa]],{j,PrimePi[m]+1,PrimePi[3m]},{i,0,j-2}];
    Print[m," ",counterexample];Label[aa];Continue,{m,1,100}]

A211165 Number of ways to write n as the sum of a prime p with p-1 and p+1 both practical, a prime q with q+2 also prime, and a Fibonacci number.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 3, 3, 4, 5, 3, 5, 3, 4, 4, 3, 4, 4, 4, 6, 6, 8, 6, 8, 3, 7, 3, 6, 5, 5, 5, 7, 6, 11, 8, 12, 4, 8, 4, 7, 8, 6, 8, 8, 7, 11, 9, 13, 5, 8, 4, 7, 7, 6, 6, 6, 5, 7, 6, 10, 4, 9, 3, 9, 7, 8, 7, 6, 6, 7, 4, 7, 4, 7, 4, 8, 8, 11, 7, 6, 6, 8, 5, 6, 4, 7, 2, 9, 7, 12, 8, 7, 4, 10, 5, 9, 5, 8, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 30 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>5.
This has been verified for n up to 300000.
Note that for n=406 we cannot represent n in the given way with q+1 practical.

Examples

			a(6)=a(7)=1 since 6=3+3+0 and 7=3+3+1 with 3 and 5 both prime, 2 and 4 both practical, 0 and 1 Fibonacci numbers.
		

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&&pr[Prime[k]+1]==True
    q[n_]:=q[n]=PrimeQ[n]==True&&PrimeQ[n+2]==True
    a[n_]:=a[n]=Sum[If[k!=2&&Fibonacci[k]
    				

A213202 Number of ways to write n = p + sum_{k=1..m}(-1)^(m-k)*p_k, where p is a Sophie Germain prime and p_k is the k-th prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 01 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>2.
This has been verified for n up to 10^7.
Let s_n=sum_{k=1}^n(-1)^{n-k}p_k for n=1,2,3,... The author also made the following conjectures:
(1) For each n>2, there is an integer k>0 such that 3(n-s_k)-1 and 3(n-s_k)+1 are twin primes.
(2) For each n>3, there is an integer k>0 such that 3(n-s_k)-2 and 3(n-s_k)+2 are cousin primes.
(3) Every n=6,7,... can be written as p+s_k (k>0) with p and p+6 sexy primes.
(4) Any integer n>3 different from 65 and 365 can be written as p+s_k (k>0) with p a term of A210479.
(5) Each integer n>8 can be written as q+s_k (k>0) with q-4, q, q+4 all practical.
(6) Any integer n>1 can be written as j(j+1)/2+s_k with j,k>0.

Examples

			a(11)=1 since 11=3+p_5-p_4+p_3-p_2+p_1 with 3 and 2*3+1 both prime.
a(182)=1 since 182=179+(7-5+3-2) with 179 and 2*179+1 both prime.
		

Crossrefs

Programs

  • Mathematica
    sp[n_]:=qq[n]=PrimeQ[n]&&PrimeQ[2n+1]
    s[0_]:=0
    s[n_]:=s[n]=Prime[n]-s[n-1]
    a[n_]:=a[n]=Sum[If[n-s[m]>0&&sp[n-s[m]],1,0],{m,1,n}]
    Do[Print[n," ",a[n]],{n,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}]
Showing 1-10 of 12 results. Next