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

A231557 Least positive integer k <= n such that 2^k + (n - k) is prime, or 0 if such an integer k does not exist.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 11 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0.
See also part (i) of the conjecture in A231201.
We have computed a(n) for all n up to 2*10^6 except for n = 1657977. Here are some relatively large values of a(n): a(421801) = 149536 (the author found that 2^{149536} + 421801 - 149536 is prime, and then his friend Qing-Hu Hou verified that 2^k + 421801 - k is composite for each integer 0 < k < 149536), a(740608) = 25487, a(768518) = 77039, a(1042198) = 31357, a(1235105) = 21652, a(1253763) = 39018, a(1310106) = 55609, a(1346013) = 33806, a(1410711) = 45336, a(1497243) = 37826, a(1549802) = 21225, a(1555268) = 43253, a(1674605) = 28306, a(1959553) = 40428.
Now we find that a(1657977) = 205494. The prime 2^205494 + (1657977-205494) has 61860 decimal digits. - Zhi-Wei Sun, Aug 30 2015
We have found that a(n) > 0 for all n = 1..7292138. For example, a(5120132) = 250851, and the prime 2^250851 + 4869281 has 75514 decimal digits. - Zhi-Wei Sun, Nov 16 2015
We have verified that a(n) > 0 for all n = 1..10^7. For example, a(7292139) = 218702 and 2^218702 + (7292139-218702) is a prime of 65836 decimal digits; also a(9302003) = 311468 and the prime 2^311468 + (9302003-311468) has 93762 decimal digits. - Zhi-Wei Sun, Jul 28 2016

Examples

			a(1) = 1 since 2^1 + (1-1) = 2 is prime.
a(2) = 1 since 2^1 + (2-1) = 3 is prime.
a(3) = 2 since 2^1 + (3-1) = 4 is not prime, but 2^2 + (3-2) = 5 is prime.
		

Crossrefs

Programs

  • Mathematica
    Do[Do[If[PrimeQ[2^x+n-x],Print[n," ",x];Goto[aa]],{x,1,n}];
    Print[n," ",0];Label[aa];Continue,{n,1,100}]
  • PARI
    a(n) = {for (k = 1, n, if (isprime(2^k+n-k), return (k));); return (0);} \\ Michel Marcus, Nov 11 2013

A232398 Number of ways to write n = p + (2^k - k) + (2^m - m) with p prime and 0 < k <= m.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 23 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3.
This was motivated by A231201. We have verified the conjecture for n up to 2*10^8. It seems that a(n) = 1 for no odd n.
In contrast, R. Crocker proved that there are infinitely many positive odd numbers not of the form p + 2^k + 2^m with p prime and k, m > 0.
It seems that any integer n > 3 not equal to 1361802 can be written in the form p + (2^k + k) + (2^m + m), where p is a prime, and k and m are nonnegative integers.
On Dec 08 2013, Qing-Hu Hou finished checking the conjecture for n up to 10^10 and found no counterexamples. - Zhi-Wei Sun, Dec 08 2013

Examples

			a(11) = 2 since 11 = 5 + (2 - 1) + (2^3 - 3) = 7 + (2^2 - 2) + (2^2 - 2) with 5 and 7 prime.
a(28) = 1 since 28 = 11 + (2^3 - 3) + (2^4 - 4) with 11 prime.
a(94) = 1 since 94 = 31 + (2^3 - 3) + (2^6 - 6) with 31 prime.
		

Crossrefs

Programs

  • Mathematica
    PQ[n_]:=n>0&&PrimeQ[n]
    A232398[n_] := Sum[If[2^m - m < n && PQ[n - 2^m + m - 2^k + k], 1, 0], {m, Log[2, 2n]}, {k, m}]; Table[A232398[n], {n, 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}]

A231776 Least positive integer k <= n with (2^k + k) * n - 1 prime, or 0 if such a number k does not exist.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 6, 2, 10, 1, 2, 1, 2, 1, 2, 1, 4, 2, 2, 1, 2, 8, 6, 1, 2, 1, 4, 2, 2, 1, 8, 1, 4, 1, 2, 2, 14, 2, 2, 1, 2, 1, 2, 6, 2, 1, 4, 2, 2, 3, 8, 1, 6, 1, 2, 1, 8, 5, 4, 1, 2, 1, 2, 6, 42, 2, 6, 2, 4, 2, 2, 1, 2, 1, 4, 1, 4, 2, 8, 1, 2, 1, 2, 1, 6, 1, 8, 20, 2, 1, 2, 6, 10, 1, 2, 2
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 13 2013

Keywords

Comments

We find that 75011 is the only value of n <= 10^5 with a(n) = 0. The least positive integer k with (2^k + k)*75011 - 1 prime is 81152.

Examples

			a(3) = 2 since (2^1 + 1) * 3 - 1 = 8 is not prime, but (2^2 + 2) * 3 - 1 = 17 is prime.
		

Crossrefs

Programs

  • Mathematica
    Do[Do[If[PrimeQ[(2^k+k)*n-1],Print[n," ",k];Goto[aa]],{k,1,n}]; Print[n," ",0];Label[aa];Continue,{n,1,100}]
    lpi[n_]:=Module[{k=1},While[!PrimeQ[n(2^k+k)-1],k++];k]; Array[lpi,100] (* Harvey P. Dale, Aug 10 2019 *)
Showing 1-4 of 4 results.