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

A196778 a(n) is the number of primes in the form of 4^n+/-4^k+/-1, while 0 <= k < n.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Oct 06 2011

Keywords

Comments

Conjecture: all elements of this sequence is greater than 0.
Conjecture tested hold up to n=2355. Further test is still running
The Mathematica program gives the first 100 terms.
Terms for all n are tend to be small integers.
4^n+/-4^k+/-1=2^2n+/-2^2k+/-1

Examples

			n=1, 2=4^1-4^0-4^0, 1 prime found, so a(1)=1;
n=2, 11=4^2-4^1-1; 13=4^2-4^1+1; 19=4^2+4^1-1, 3 primes found, so a(2)=3;
...
n=13, 67043329=4^13-4^8+1; 67104769=4^13-4^6+1; 67108859=4^13-4^1-1; 67108879=4^13+4^2-1, 4 primes found, so a(13)=4;
		

Crossrefs

Programs

  • Mathematica
    b = 4; Table[c1 = b^i; cs = {};
    Do[c2 = b^j; cp = c1 + c2 + 1; If[PrimeQ[cp], cs = Union[cs, {cp}]];
      cp = c1 + c2 - 1; If[PrimeQ[cp], cs = Union[cs, {cp}]];
      cp = c1 - c2 + 1; If[PrimeQ[cp], cs = Union[cs, {cp}]];
      cp = c1 - c2 - 1;
      If[PrimeQ[cp], cs = Union[cs, {cp}]], {j, 0, i - 1}];
    ct = Length[cs]; ct, {i, 1, 100}]

A232190 a(n) is the number of primes of the form 2^b + 2n +- 2^k +- 1 and 2^(b+2) - 2^b - 2n +- 2^k +- 1, where b is the length of the binary representation of 2n, and 0

Original entry on oeis.org

5, 9, 7, 10, 11, 10, 10, 13, 14, 14, 15, 12, 13, 11, 12, 15, 18, 15, 15, 15, 17, 17, 18, 12, 15, 14, 14, 12, 16, 14, 13, 14, 16, 23, 20, 16, 18, 16, 17, 16, 17, 16, 16, 13, 17, 15, 15, 15, 20, 18, 20, 19, 17, 18, 18, 14, 15, 18, 18, 13, 17, 14, 15, 17, 17, 16
Offset: 1

Views

Author

Lei Zhou, Nov 20 2013

Keywords

Comments

Tested up to n = 1000000000, a(n)> 0.
If any zero terms exist, it is likely that the first one will appear in the interval [2*10^9, 2*10^10].
The terms of this sequence form a bell-shaped distribution with the commonest value of 21 when n is large enough. Up to the first 100 million terms, the range of a(n) is [3..55].

Examples

			When n=1, 2n=2, b=2, the set of numbers of the form 2^b + 2n + 2^k + 1 is {9, 11}; form 2^b + 2n + 2^k - 1: {7, 9}; form 2^b + 2n - 2^k - 1: {1, 3}; form 2^b + 2n - 2^k + 1: {3, 5}; form 2^(b+2) - 2^b - 2n - 2^k - 1: {7, 5}; form 2^(b+2) - 2^b - 2n - 2^k + 1: {9, 7}; form 2^(b+2) - 2^b - 2n + 2^k + 1: {15, 13}; form 2^(b+2) - 2^b - 2n + 2^k - 1: {13, 11}. The union of the above sets is {1, 3, 5, 7, 9, 11, 13, 15}. Among the 8 numbers, 5 are primes. So a(1)=5.
When n=11, using the same rule, the candidate number set is {21, 23, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 105, 107}. Among these 32 numbers, 15 are prime: {23, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 107}. So a(11)=15.
		

Crossrefs

Programs

  • Mathematica
    Table[n2 = 2*n; b = Ceiling[Log[2, n2 + 1]]; sdm = 2^b + n2 - 1;
    sdp = 2^b + n2 + 1; cset = {}; Do[cpmp = sdm + 2^k; cpmm = sdm - 2^k; cppp = sdp + 2^k; cppm = sdp - 2^k; upl = 2^(b + 2); cset = Join[
        cset, {cpmp, upl - cpmp, cpmm, upl - cpmm, cppp, upl - cppp, cppm,
          upl - cppm}], {k, 1, b}]; cset = Union[cset];
    size = Length[cset]; ct = 0;
    Do[If[PrimeQ[cset[[j]]], ct++], {j, 1, size}]; ct, {n, 1, 66}]

Extensions

Edited by Jon E. Schoenfield, Mar 28 2015

A277577 a(n) is the number of primes of the form (6n+3) +/- 3^k +/- 1, 1<=k<(t-2) and t is the number of digits of (6n+3)'s balanced ternary representation.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Oct 20 2016

Keywords

Comments

The first a few of a(n)=0 terms of this sequence appear on n=72030, 228439, 282059, 383424, 384204, 593477, 710787, 736541, 1057465, 1628226, 1831745, 1892512, 1922647, 2128995, 2244660, 2260650, 2276272, 2289706, 2374644, 2507484, 2633477, 2681747, 2695747, 2875824, 2889472, 2913659 up to n<=3000000.

Examples

			n=1: 6n+3=9. 9=(100)_bt. 1<=k<=(3-2)=1. When k=1, (6n+3)+/-3^1+/-1 = 5, 7, 11, 13, all primes. So a(1) = 4;
n=2: 6n+3=15. 15=(1TT0)_bt. 1<=k<=(4-2)=2. When k=1, (6n+3)+/-3^1+/-1 = 11, 13, 17, 19, all primes; when k=2, (6n+3)+/-3^2+/-1 = 5, 7, 23, 25, three primes.  Totals 7. So a(2) = 7.
		

Crossrefs

Cf. A196698.

Programs

  • Mathematica
    BTDigits[m_Integer,g_] :=
      Module[{n = m, d, sign, t = g},
       If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
        d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
        While[Length[t] < d, PrependTo[t, 0]];
        t[[Length[t] + 1 - d]] = sign;
        t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    Table[trib = 6*n + 3; t = BTDigits[trib,{}]; l = Length[t]; ct = 0;
    Do[If[PrimeQ[trib - 3^j - 1], ct++];
      If[PrimeQ[trib - 3^j + 1], ct++]; If[PrimeQ[trib + 3^j + 1], ct++];
      If[PrimeQ[trib + 3^j - 1], ct++], {j, 1, l - 2}]; ct, {n, 1, 111}]

A196779 a(n) is the smallest number m such that no prime takes the form of n^m+/-n^k+/-1, while 0 <= k < m and m > 1.

Original entry on oeis.org

1147, 113, 113, 400, 866, 131, 399, 32, 26, 29, 23, 58, 77, 21, 42, 3, 817, 4, 2, 37, 80, 29, 181, 39, 120, 382, 76, 5, 29, 20, 48, 19, 36, 7, 43, 7, 62, 22, 7, 43, 5, 17, 23, 44, 52, 137, 103, 2, 5, 49, 31, 10, 30, 5, 25, 25, 49, 10, 72, 50, 13, 4, 7, 6
Offset: 5

Views

Author

Lei Zhou, Oct 06 2011

Keywords

Comments

Conjecture: a(n) has finite value when a>4
already tested: a(4)>2364; a(3)>7399; and a(2)>9594.
Hypothesis is that a(2), a(3), and a(4) are infinite.
Mathematica program ran about an hour and gave the first 96 items.
When n is larger, a(n) tends to be 2 for most of n.

Examples

			n=5, there is no prime number in the form of 5^1147+/-5^k+/-1 for 0 <= k < 1147
		

Crossrefs

Programs

  • Mathematica
    Table[i = 1;  While[i++; c1 = b^i; cs = {};
      Do[c2 = b^j; cp = c1 + c2 + 1;
       If[PrimeQ[cp], cs = Union[cs, {cp}]];
       cp = c1 + c2 - 1; If[PrimeQ[cp], cs = Union[cs, {cp}]];
       cp = c1 - c2 + 1; If[PrimeQ[cp], cs = Union[cs, {cp}]];
       cp = c1 - c2 - 1;
       If[PrimeQ[cp], cs = Union[cs, {cp}]], {j, 0, i - 1}];
      ct = Length[cs]; ct > 0]; i, {b, 5, 100}]

A277514 Irregular triangle read by rows: T(n,k) is the number of primes with n balanced ternary digits of which 2k+1 (3 <= 2k+1 <= n) are nonzero.

Original entry on oeis.org

4, 6, 8, 10, 7, 35, 11, 70, 30, 7, 129, 143, 10, 191, 458, 93, 11, 262, 1112, 605, 11, 370, 2209, 2513, 273, 8, 484, 4007, 7646, 2562, 10, 595, 6683, 19361, 12878, 938, 9, 765, 10697, 42633, 47555, 10311, 11, 917, 16103, 85860, 143382, 62541, 3183
Offset: 3

Views

Author

Lei Zhou, Oct 18 2016

Keywords

Comments

This sequence has the same indexing rule as A277513.
There are no zeros in this sequence up to the (10^5)-th term.
It is conjectured that all terms of this sequence are greater than zero, or else there are infinitely many zero terms. The first zero term might appear beyond 10^6.

Examples

			When n=3 and k=1, there are the following three trits balanced ternary numbers: 5=1TT, 7=1T1, 11=11T, 13=111. All four of them are primes, so T(3,1) = 4;
When n=4 and k=1, there are the following balanced ternary numbers with 2k+1=3 nonzero trits: 17=1T0T, 19=1T01, 23=10TT, 25=10T1, 29=101T, 31=1011, 35=110T, 37=1101. Among these 8 numbers, 6 of them are prime, so T(4,1) = 6.
By listing the first few rows, this sequence appears as:
        k=1        2        3        4
n=3       4
n=4       6
n=5       8       10
n=6       7       35
n=8      11       70       30
n=9       7      129      143
n=10     10      191      458       93
		

Crossrefs

2 together with the column 1 gives A196698.

Programs

  • Mathematica
    (* This converts number m to balanced ternary form, stores the result in list t. *)
    BTDigits[m_Integer, g_] :=
      Module[{n = m, d, sign, t = g},
       If[n != 0, If[n > 0, sign = 1, sign = -1; n = -n];
        d = Ceiling[Log[3, n]]; If[3^d - n <= ((3^d - 1)/2), d++];
        While[Length[t] < d, PrependTo[t, 0]];
        t[[Length[t] + 1 - d]] = sign;
        t = BTDigits[sign*(n - 3^(d - 1)), t]]; t];
    (* This calculates j and k for balanced ternary form of number m. *)
    BTnonzeroNumofDigits[m_Integer] :=
      Module[{n = m}, t = BTDigits[n, {}]; j = Length[t];
       k = 0; Do[If[t[[i]] != 0, k++], {i, 1, j}];
       k = (k - 1)/2; {j, k}];
    (* This calculates the category index n as defined in A277513 for a {j,k} pair. *)
    IndexA277513[{j_, k_}] :=
      Module[{m, i},
       If[OddQ[j], m = (j - 1)/2; i = m^2 - m + k, m = j/2;
        i = m^2 - 2 m + 1 + k]];
    (* This counts a(n). *)
    p=3;a={} ;While[p = NextPrime[p]; jk = BTnonzeroNumofDigits[p]; jk[[1]] <= 15, id = IndexA277513[jk]; While[Length[a] < id, AppendTo[a, 0]];
      a[[id]]++];a
Showing 1-5 of 5 results.