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.

User: Bernardo Boncompagni

Bernardo Boncompagni's wiki page.

Bernardo Boncompagni has authored 8 sequences.

A258107 Smallest number > 1 whose representation in all bases up to n consists only of 0's and 1's.

Original entry on oeis.org

2, 3, 4, 82000
Offset: 2

Author

Bernardo Boncompagni, May 20 2015

Keywords

Comments

As with A146025, it is a plausible conjecture that there are no more terms, but this has not been proved. - Daniel Mondot, Dec 16 2016
From Devansh Singh, Mar 14 2021: (Start)
If a(n) exists then b-1|(N-Sum_{i>=0} A(i)), b-2|(N-Sum_{i>=0} A(i)*2^i), b-3|(N-Sum_{i>=0} A(i)*3^i), ... where b <= n.
If a(n) exists for n > 5 then let it be N. N = Sum_{i>=0} A(i)*b^i where A(i) is the i-th digit (0 or 1 only) of N starting from the right in base b <= n.
N = Sum_{i>=0} A(i)*b'^i + Sum_{i>=1} A(i)*(b^i - b'^i), where b' < b. If b=6 then we can see that 5|(N-Sum_{i>=0} A(i)), 4|(N-Sum_{i>=0} A(i)*2^i), 3|(N-Sum_{i>=0} A(i)*3^i). (End)

Examples

			a(4) = 4 because it is 100 in base 2, 11 in base 3 and 10 in base 4. No smaller number, except 1, can be expressed in such bases with only 0's and 1's.
a(5) = 82000: 82000 in bases 2 through 5 is 10100000001010000, 11011111001, 110001100, 10111000, containing only 0's and 1's, while all smaller numbers have a larger digit in one of those bases. For example, 12345 is 11000000111001, 121221020, 3000321, 343340. - _N. J. A. Sloane_, Feb 01 2016
		

Crossrefs

Cf. A146025.

Programs

  • Mathematica
    Table[k = 2; While[Total[Total@ Drop[RotateRight[DigitCount[k, #]], 2] & /@ Range[3, n]] > 0, k++]; k, {n, 2, 5}] (* Michael De Vlieger, Aug 29 2015 *)

A126717 Least odd k such that k*2^n-1 is prime.

Original entry on oeis.org

3, 3, 1, 1, 3, 1, 3, 1, 5, 7, 5, 3, 5, 1, 5, 9, 17, 1, 3, 1, 17, 7, 33, 13, 39, 57, 11, 21, 27, 7, 213, 1, 5, 31, 3, 25, 17, 21, 3, 25, 107, 15, 33, 3, 35, 7, 23, 31, 5, 19, 11, 21, 65, 147, 5, 3, 33, 51, 77, 45, 17, 1, 53, 9, 3, 67, 63, 43, 63, 51, 27, 73, 5, 15, 21, 25, 3, 55, 47, 69
Offset: 0

Author

Bernardo Boncompagni, Feb 13 2007

Keywords

Comments

If a(n)=1 then n is a Mersenne exponent (A000043). - Pierre CAMI, Apr 22 2013
From Pierre CAMI, Apr 03 2017: (Start)
Empirically, as N increases, (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} n) tends to log(2); this is consistent with the prime number theorem as the probability that x*2^n - 1 is prime is ~ 1/(n*log(2)) if n is large enough.
For n=1 to 10000, a(n)/n < 7.5.
a(n)*2^n - 1 and a(n)*2^n + 1 are twin primes for n = 1, 2, 6, 18, 22, 63, 211, 282, 546, 726, 1032, 1156, 1321, 1553, 2821, 4901, 6634, 8335, 8529; corresponding values of a(n) are 3, 1, 3, 3, 33, 9, 9, 165, 297, 213, 177, 1035, 1065, 291, 6075, 2403, 2565, 4737, 3975, 459. (End)

Examples

			a(10)=5 because 5*2^10-1 is prime but 1*2^10-1 and 3*2^10-1 are not.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[ !PrimeQ[k*2^n - 1], k += 2]; k]; Table[f@n, {n, 0, 80}] (* Robert G. Wilson v, Feb 20 2007 *)
  • PARI
    a(n) = {my(k=1); while(!isprime(k*2^n - 1), k+=2); k}; \\ Indranil Ghosh, Apr 03 2017
    
  • Python
    from sympy import isprime
    def a(n):
        k=1
        while True:
            if isprime(k*2**n - 1): return k
            k+=2
    print([a(n) for n in range(101)]) # Indranil Ghosh, Apr 03 2017

Formula

a(n) << 19^n by Xylouris' improvement to Linnik's theorem. - Charles R Greathouse IV, Dec 10 2013
Conjecture: a(n) = O(n log n). - Thomas Ordowski, Oct 15 2014

Extensions

More terms from Robert G. Wilson v, Feb 20 2007

A113275 Lesser of twin primes for which the gap before the following twin primes is a record.

Original entry on oeis.org

3, 5, 17, 41, 71, 311, 347, 659, 2381, 5879, 13397, 18539, 24419, 62297, 187907, 687521, 688451, 850349, 2868959, 4869911, 9923987, 14656517, 17382479, 30752231, 32822369, 96894041, 136283429, 234966929, 248641037, 255949949
Offset: 1

Author

Bernardo Boncompagni, Oct 21 2005

Keywords

Examples

			The smallest twin prime pair is 3, 5, then 5, 7 so a(1) = 3; the following pair is 11, 13 so a(2) = 5 because 11 - 5 = 6 > 5 - 3 = 2; the following pair is 17, 19: since 17 - 11 = 6 = 11 - 5 nothing happens; the following pair is 29, 31 so a(3)= 17 because 29 - 17 = 12 > 11 - 5 = 6.
		

Crossrefs

Record gaps are given in A113274. Cf. A002386.

Programs

  • Mathematica
    NextLowerTwinPrim[n_] := Block[{k = n + 2}, While[ !PrimeQ[k] || !PrimeQ[k + 2], k++ ]; k]; p = 3; r = 0; t = {3}; Do[q = NextLowerTwinPrim[p]; If[q > r + p, AppendTo[t, p]; r = q - p]; p = q, {n, 10^9}] (* Robert G. Wilson v, Oct 22 2005 *)

Formula

a(n) = A036061(n) - 2.
a(n) = A036062(n) - A113274(n).

Extensions

a(22)-a(30) from Robert G. Wilson v, Oct 22 2005
Terms up to a(72) are listed in Kourbatov (2013), terms up to a(75) in Oliveira e Silva's website, added by Max Alekseyev, Nov 06 2015

A113274 Record gaps between twin primes.

Original entry on oeis.org

2, 6, 12, 18, 30, 36, 72, 150, 168, 210, 282, 372, 498, 630, 924, 930, 1008, 1452, 1512, 1530, 1722, 1902, 2190, 2256, 2832, 2868, 3012, 3102, 3180, 3480, 3804, 4770, 5292, 6030, 6282, 6474, 6552, 6648, 7050, 7980, 8040, 8994, 9312, 9318, 10200, 10338, 10668
Offset: 1

Author

Bernardo Boncompagni, Oct 21 2005

Keywords

Comments

a(n) mod 6 = 0 for each n>1.

Examples

			The first twin primes are 3,5 and 5,7 so a(0)=5-3=2. The following pair is 11,13 so a(1)=11-5=6. The following pair is 17,19 so 6 remains the record and no terms are added.
		

Crossrefs

The smallest primes originating the sequence are given in A113275. Cf. A008407, A005250, A002386.

Programs

  • Mathematica
    NextLowerTwinPrim[n_] := Block[{k = n + 6}, While[ !PrimeQ[k] || !PrimeQ[k + 2], k+=6]; k]; p = 5; r = 2; t = {2}; Do[ q = NextLowerTwinPrim[p]; If[q > r + p, AppendTo[t, q - p]; Print[{p, q - p}]; r = q - p]; p = q, {n, 10^9}]; t (* Robert G. Wilson v, Oct 22 2005 *)
    DeleteDuplicates[Differences[Select[Partition[Prime[Range[10^7]],2,1],#[[2]]-#[[1]] == 2&][[All,2]]],GreaterEqual] (* The program generates the first 27 terms of the sequence. *) (* Harvey P. Dale, Dec 31 2022 *)

Formula

a(n) = A036063(n) + 2.
a(n) = A036062(n) - A113275(n).
From Alexei Kourbatov, Dec 29 2011: (Start)
(1) Upper bound: gaps between twin primes are smaller than 0.76*(log p)^3, where p is the prime at the end of the gap.
(2) Estimate for the actual size of the maximal gap that ends at p: maximal gap = a(log(p/a)-1.2), where a = 0.76*(log p)^2 is the average gap between twin primes near p, as predicted by the Hardy-Littlewood k-tuple conjecture.
Formulas (1) and (2) are asymptotically equal as p tends to infinity. However, (1) yields values greater than all known gaps, while (2) yields "good guesses" that may be either above or below the actual size of known maximal gaps.
Both formulas (1) and (2) are derived from the Hardy-Littlewood k-tuple conjecture via probability-based heuristics relating the expected maximal gap size to the average gap. Neither of the formulas has a rigorous proof (the k-tuple conjecture itself has no formal proof either). In both formulas, the constant ~0.76 is reciprocal to the twin prime constant 1.32032...
(End)

Extensions

More terms from Robert G. Wilson v, Oct 22 2005
Corrected terms based on A036063, cross-checked with independent computations by Carlos Rivera and Richard Fischer (linked).
Terms up to a(72) are given in Kourbatov (2013), terms up to a(75) in Oliveira e Silva website.

A113403 Primes p in prime quadruplets (p,p+2,p+6,p+8) at the end of maximal gaps in A113404.

Original entry on oeis.org

11, 101, 821, 1481, 3251, 5651, 9431, 31721, 43781, 97841, 135461, 187631, 326141, 768191, 1440581, 1508621, 3047411, 3798071, 5146481, 5610461, 9020981, 17301041, 22030271, 47774891, 66885851, 76562021, 87797861, 122231111, 132842111, 204651611, 628641701, 1749878981
Offset: 1

Author

Bernardo Boncompagni, Oct 28 2005

Keywords

Comments

Prime quadruplets (p, p+2, p+6, p+8) are densest permissible constellations of four primes. Record (maximal) gaps between prime quadruplets are listed in A113404; see further comments there.

Examples

			Record gaps between prime quadruplets are as follows (arXiv:1309.4053, Table 4):
Initial primes: Max gap
.....5......11........6
....11.....101.......90
...191.....821......630
...821....1481......660
..2081....3251.....1170
..3461....5651.....2190
..5651....9431.....3780
...
The left column is A229907. The middle column is A113403 (this sequence); the right column is A113404.
		

Crossrefs

Record gaps are given in A113404. Cf. A007530, A002386.

A113404 Record gaps between prime quadruplets.

Original entry on oeis.org

6, 90, 630, 660, 1170, 2190, 3780, 6420, 8940, 9030, 13260, 16470, 24150, 28800, 29610, 39990, 56580, 56910, 71610, 83460, 94530, 114450, 157830, 159060, 171180, 177360, 190500, 197910, 268050, 315840, 395520, 435240, 440910, 513570, 536010, 539310, 557340, 635130
Offset: 1

Author

Bernardo Boncompagni, Oct 28 2005

Keywords

Comments

Prime quadruplets (p, p+2, p+6, p+8) are densest permissible constellations of 4 primes (A007530). By the Hardy-Littlewood k-tuple conjecture, average gaps between prime k-tuples are O(log^k(p)), with k=4 for quadruplets. If a gap is larger than all preceding gaps, we call it a maximal gap, or a record gap. Maximal gaps may be significantly larger than average gaps. This sequence suggests that maximal gaps between prime quadruplets are O(log^5(p)). - Alexei Kourbatov, Jan 04 2012

Examples

			The first prime quadruplets are (5,7,11,13) and (11,13,17,19), so a(1)=11-5=6. The next quadruplet is (101,103,107,109), so a(2)=101-11=90. The following quadruplet is 191,193,197,199 so 90 remains the record and no terms are added.
		

Crossrefs

A229907 lists initial primes in quadruplets preceding the maximal gaps. A113403 lists the corresponding primes at the end of the maximal gaps. Cf. A008407, A007530.

Programs

  • Mathematica
    DeleteDuplicates[Differences[#[[4]]&/@Select[Partition[Prime[Range[10^7]],4,1],Differences[#] == {2,4,2}&]],GreaterEqual] (* The program generates the first 29 terms of the sequence. *) (* Harvey P. Dale, Aug 04 2024 *)

Formula

From Alexei Kourbatov, Jan 04 2012: (Start)
(1) Upper bound: gaps between prime quadruplets (p, p+2, p+6, p+8) are smaller than 0.241*(log p)^5, where p is the prime at the end of the gap.
(2) Estimate for the actual size of the maximal gap that ends at p: maximal gap = a*(log(p/a)-0.55), where a = 0.241*(log p)^4 is the average gap between quadruplets near p, as predicted by the Hardy-Littlewood k-tuple conjecture.
Formulas (1) and (2) are asymptotically equal as p tends to infinity. However, (1) yields values greater than all known gaps, while (2) yields "good guesses" that may be either above or below the actual size of known maximal gaps.
Both formulas (1) and (2) are derived from the Hardy-Littlewood k-tuple conjecture via probability-based heuristics relating the expected maximal gap size to the average gap. Neither of the formulas has a rigorous proof (the k-tuple conjecture itself has no formal proof either). In both formulas, the constant ~0.241 is reciprocal to the Hardy-Littlewood 4-tuple constant 4.15118... (End)

Extensions

Terms 159060 to 635130 added by Alexei Kourbatov, Jan 04 2012

A111166 Let p < q be consecutive primes; p is in the sequence if p/(q-p) is a record.

Original entry on oeis.org

2, 5, 11, 17, 29, 41, 59, 71, 101, 107, 137, 149, 179, 191, 197, 227, 239, 269, 281, 311, 347, 419, 431, 461, 521, 569, 599, 617, 641, 659, 809, 821, 827, 857, 881, 1019, 1031, 1049, 1061, 1091, 1151, 1229, 1277, 1289, 1301, 1319, 1427, 1451, 1481, 1487, 1607
Offset: 1

Author

Bernardo Boncompagni, Oct 21 2005

Keywords

Comments

Conjecture: Except for first term, the sequence coincides with A001359. This is true for all primes < 2*10^7.
Conjecture: Except for first term, the sequence coincides with A001359. This is true for all primes < 7*10^16. Let n >= 2 be an integer, N +- 1 and M +- 1 two consecutive twin pairs where M>n*N. Finding a counterexample is the same as finding two consecutive primes P1 and P2 with n*N
The smallest prime(n) such that prime(n+1)/prime(n) is decreasing. [Thomas Ordowski, May 13 2012]
This sequence corresponds with A001359 for all terms less than 10^100. - Charles R Greathouse IV, May 14 2012

Examples

			a(0)=2 and the record is 2/(3-2)=2; a(1)<>3 because 3/(5-3)=1.5; a(1)=5 because 5/(7-5)=2.5
		

Crossrefs

Cf. A001359.

Programs

  • Mathematica
    rmax = 0; p = 2; seq = {}; Do[q = NextPrime[p]; r = p/(q-p); If[r > rmax, rmax = r; AppendTo[seq, p]]; p = q, {100}]; seq (* Amiram Eldar, Dec 24 2019 *)
    DeleteDuplicates[{#[[1]],#[[2]],#[[1]]/(#[[2]]-#[[1]])}&/@Partition[Prime[Range[300]],2,1],GreaterEqual[#1[[3]],#2[[3]]]&][[;;,1]] (* Harvey P. Dale, Jun 16 2025 *)

A096356 Smallest number which can be expressed as the sum of its proper divisors in exactly n ways.

Original entry on oeis.org

1, 6, 12, 30, 112, 24, 80, 36, 228, 150, 48, 156, 160, 126, 1242, 132, 5300, 1330, 448, 1326, 108, 96, 1288, 90, 918, 84, 1026, 750, 858, 16592, 744, 72, 910, 952, 60, 696, 896, 702, 690, 760, 6966, 12464, 192, 570, 400, 6642, 546, 594, 2178, 2420, 5424, 640
Offset: 0

Author

Bernardo Boncompagni, Aug 04 2004

Keywords

Comments

All numbers in the sequence are pseudoperfect.

Examples

			a(2)=12 because 12 is the smallest number which can be expressed as the sum of its proper divisors in exactly 2 ways: 12=6+4+2 and 12=6+3+2+1.
		

Crossrefs

Records are in A065218.

Programs

  • Mathematica
    (* first *) Needs["DiscreteMath`Combinatorica`"] (* then *) f[n_] := Count[Plus @@@ Subsets[ Drop[ Divisors[n], -1]], n]; t = Table[0, {100}]; Do[ a = f[n]; If[a < 101 && t[[a]] == 0, t[[a]] = n; Print[a, " = ", n]], {n, 2, 16600}]; t (* Robert G. Wilson v, Aug 13 2004 *)

Formula

A033630(a(n))=n; A033630(j)<>n for jR. J. Mathar, Dec 11 2006

Extensions

More terms from Robert G. Wilson v, Aug 13 2004
Definition corrected by R. J. Mathar, Nov 27 2006