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-7 of 7 results.

A232463 Number of ways to write n = p + q - pi(q), where p and q are odd primes not exceeding n, and pi(q) is the number of primes not exceeding q.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 24 2013

Keywords

Comments

Note that this sequence is different from A232443.
Conjecture: a(n) > 0 for all n > 3. Also, a(n) = 1 only for n = 4, 5, 6, 7, 9, 10, 11, 12, 15, 16, 28, 35.

Examples

			a(10) = 1 since 10 = 7 + 7 - pi(7), and 7 is an odd prime not exceeding 10.
a(11) = 1 since 11 = 5 + 11 - pi(11), and 5 and 11 are odd primes not exceeding 11.
a(15) = 1 since 15 = 13 + 5 - pi(5), and 13 and 5 are odd primes not exceeding 15.
a(28) = 1 since 28 = 17 + 19 - pi(19), and 17 and 19 are odd primes not exceeding 28.
a(35) = 1 since 35 = 29 + 11 - pi(11), and 29 and 11 are odd primes not exceeding 35.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=n>2&&PrimeQ[n]
    a[n_]:=Sum[If[PQ[n-Prime[k]+k],1,0],{k,2,PrimePi[n]}]
    Table[a[n],{n,1,100}]

A232443 Number of ways to write n = p + q - pi(q), where p and q are odd primes, and pi(q) is the number of primes not exceeding q.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 23 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 3. Moreover, every n = 6, 7, ... can be written as p + q - pi(q) with p, p + 6 and q all prime.
(ii) For each integer n > 7, there is a prime p < n with n + p - pi(p) prime.
(iii) Any integer n > 4 not equal to 9 or 17 can be written as p + q + pi(q) with p and q both prime.
(iv) Each integer n > 7 can be written as p + q + pi(p) + pi(q) with p and q both prime.

Examples

			a(4) = 1 since 4 = 3 + 3 - pi(3) with 3 prime.
a(5) = 1 since 5 = 3 + 5 - pi(5) with 3 and 5 prime.
a(6) = 2 since 6 = 3 + 7 - pi(7) = 5 + 3 - pi(3) with 3, 5, 7 all prime.
a(7) = 1 since 7 = 5 + 5 - pi(5) with 5 prime.
a(11) = 1 since 11 = 5 + 11 - pi(11) with 5 and 11 both prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=PQ[n]=n>2&&PrimeQ[n]
    a[n_]:=Sum[If[PQ[n-Prime[k]+k],1,0],{k,2,PrimePi[2n-2]}]
    Table[a[n],{n,1,100}]

A232616 Least positive integer m such that {2^k - k: k = 1,...,m} contains a complete system of residues modulo n.

Original entry on oeis.org

1, 2, 4, 5, 10, 6, 14, 10, 12, 18, 29, 13, 33, 22, 40, 19, 38, 18, 58, 21, 36, 58, 75, 26, 60, 66, 40, 64, 195, 53, 87, 36, 158, 67, 130, 37, 133, 94, 90, 42, 95, 42, 105, 112, 112, 140, 247, 51, 122, 94, 119, 120, 311, 54, 126, 90, 184, 223, 264, 61
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 26 2013

Keywords

Comments

By a result of the author (see arXiv:1312.1166), for any integers a and n > 0, the set {a^k - k: k = 1, ..., n^2} contains a complete system of residues modulo n. (We may also replace a^k - k by a^k + k.) Thus a(n) always exists and it does not exceed n^2.
Conjectures:
(i) a(n) < 2*(prime(n)-1) for all n > 0.
(ii) The Diophantine equation x^n - n = y^m with m, n, x, y > 1 only has two integral solutions: 2^5 - 5 = 3^3 and 2^7 - 7 = 11^2. Also, the Diophantine equation x^n + n = y^m with m, n, x, y > 1 only has two integral solutions: 5^2 + 2 = 3^3 and 5^3 + 3 = 2^7.

Examples

			a(3) = 4 since {2 - 1, 2^2 - 2, 2^3 - 3} = {1, 2, 5} does not contain a complete system of residues mod 3, but {2 - 1, 2^2 - 2, 2^3 - 3, 2^4 - 4} = {1, 2, 5, 12} does.
		

Crossrefs

Programs

  • Mathematica
    L[m_,n_]:=Length[Union[Table[Mod[2^k-k,n],{k,1,m}]]]
    Do[Do[If[L[m,n]==n,Print[n," ",m];Goto[aa]],{m,1,n^2}];
    Print[n," ",0];Label[aa];Continue,{n,1,60}]

A232548 Number of ways to write n = p - pi(p) + 2^k + 2^m with 0 < k <= m, where p is an odd prime and pi(p) is the number of primes not exceeding p.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 25 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4.
In contrast, R. Crocker proved that there are infinitely many positive odd integers not of the form p + 2^k + 2^m, where p is a prime, and k and m are positive integers.
Qing-Hu Hou has checked the conjecture for n up to 10^7, and found one counterexample: n = 1897048.

Examples

			a(7) = 2 since 7 = 3 - pi(3) + 2 + 2^2 = 7 - pi(7) + 2 + 2, with 3 and 7 odd primes.
a(8) = 1 since 8 = 5 - pi(5) + 2 + 2^2 with 5 an odd prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[n==Prime[k]-k+2^i+2^j,1,0],{k,2,PrimePi[2n]},{j,1,Log[2,n]},{i,1,j}]
    Table[a[n],{n,1,100}]
  • PARI
    a(n)=my(s,ppi=1); forprime(p=3,, if(p-ppi++>n-4,return(s)); if((n-p+ppi)%2==0 && hammingweight(n-p+ppi)<3,s++)) \\ Charles R Greathouse IV, Nov 27 2013

A202650 Number of ways to write n = p + p(k) + p(m) with 0 < k <= m, where p is a prime and p(.) is the partition function (A000041).

Original entry on oeis.org

0, 0, 0, 1, 2, 3, 4, 4, 6, 5, 7, 5, 7, 5, 10, 6, 10, 5, 12, 7, 13, 5, 13, 6, 15, 6, 15, 6, 15, 6, 13, 7, 15, 8, 17, 10, 14, 8, 14, 11, 12, 9, 13, 11, 14, 14, 16, 13, 16, 14, 15, 12, 12, 14, 16, 14, 13, 10, 14, 16, 15, 14, 18, 17, 15, 17, 14, 14, 15, 16, 14, 13, 15, 19, 18, 18, 16, 15, 13, 17, 18, 14, 19, 17, 19, 18, 18, 15, 21, 17, 22, 13, 17, 14, 20, 15, 19, 13, 15, 15
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 24 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 3.
(ii) For any integer n > 2, |n - p(k)| is prime for some k = 1,...,n. Also, for any positive integer n not equal to 7, n + p(k) is prime for some k = 1,...,n.
We have verified part (i) of the conjecture for all n = 4, 5, ..., 2*10^7.

Examples

			a(6) = 3 since 6 = 3 + p(1) + p(2) = 2 + p(1) + p(3) = 2 + p(2) + p(2) with 2 and 3 prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=n>1&&PrimeQ[n]
    a[n_]:=Sum[If[PQ[n-PartitionsP[m]-PartitionsP[k]],1,0],{m,1,n},{k,1,m}]
    Table[a[n],{n,1,100}]

A229835 Number of ways to write n = (p - 1)/6 + q, where p is a prime, and q is a term of the sequence A000009.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Dec 19 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1. Also, any integer n > 1 can be written as (p + 1)/6 + q, where p is a prime and q is a term of A000009.
We have verified this for n up to 2*10^8. Note that 26128189 cannot be written as (p - 1)/4 + q with p a prime and q a term of A000009. Also, 65152682 cannot be written as (p + 1)/4 + q with p a prime and q a term of A000009.

Examples

			a(2) = 1 since 2 = (7 - 1)/ 6 + 1 with 7 prime, and 1 = A000009(i) for i = 0, 1, 2.
a(3) = 2 since 3 = (7 - 1 )/6 + 2 with 7 prime and 2 = A000009(3) = A000009(4), and 3 = (13 - 1 )/6 + 1 with 13 prime and 1 = A000009(i) for i = 0, 1, 2.
		

Crossrefs

Programs

  • Mathematica
    Do[m=0;Do[If[PartitionsQ[k]>=n,Goto[aa]];If[k>1&&PartitionsQ[k]==PartitionsQ[k-1],Goto[bb]];
    If[PrimeQ[6(n-PartitionsQ[k])+1],m=m+1];Label[bb];Continue,{k,1,2n}];
    Label[aa];Print[n," ",m];Continue,{n,1,100}]

A262980 Number of ordered ways to write n as p + 2^k + pi(2^m), where p is prime, and k and m are nonnegative integers, and pi(x) denotes the number of primes not exceeding x.

Original entry on oeis.org

0, 0, 1, 3, 4, 5, 6, 7, 7, 8, 8, 7, 9, 7, 12, 7, 10, 7, 12, 9, 14, 11, 12, 10, 15, 8, 13, 6, 12, 7, 12, 9, 13, 9, 14, 11, 15, 11, 18, 9, 14, 8, 14, 10, 18, 13, 11, 9, 18, 13, 17, 10, 13, 7, 15, 12, 14, 10, 10, 10, 15, 12, 19, 11, 15, 12, 16, 10, 20, 12, 13, 12, 20, 12, 23
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 06 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 2.
We have verified this for n up to 2*10^8.
In contrast with this conjecture, in 1971 R. Crocker proved that there are infinitely many positive odd numbers not of the form p + 2^k + 2^m, where p is prime, and k and m are positive integers.

Crossrefs

Programs

  • Maple
    a(3) = 1 since 3 = 2 + 2^0 + pi(2^0) with 2 prime.
    a(4) = 3 since 4 = 2 + 2^0 + pi(2) = 2 + 2 + pi(2^0) = 3 + 2^0 + pi(2^0) with 2 and 3 both prime.
  • Mathematica
    f[n_]:=PrimePi[2^n]
    Do[r=0;Do[If[f[x]>=n,Goto[aa]];Do[If[PrimeQ[n-f[x]-2^y],r=r+1],{y,0,Log[2,n-f[x]]}];Continue,{x,0,n}];Label[aa];Print[n," ",r];Continue,{n,1,100}]
Showing 1-7 of 7 results.