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.

Previous Showing 11-20 of 33 results. Next

A284919 Even integers E such that there is no prime p < E with E - p and E + p both prime.

Original entry on oeis.org

0, 2, 4, 6, 28, 38, 52, 58, 62, 68, 74, 80, 82, 88, 94, 98, 112, 118, 122, 124, 128, 136, 146, 148, 152, 158, 164, 166, 172, 178, 182, 184, 188, 190, 206, 208, 212, 214, 218, 220, 224, 238, 242, 244, 248, 250, 256, 262, 268, 278, 284, 290, 292, 296, 298
Offset: 1

Views

Author

Claudio Meller, Apr 05 2017

Keywords

Comments

Or, even integers k such that k + p is composite for all primes p, q with p + q = k.
The two initial terms vacuously satisfy the definition, but all even numbers >= 4 are the sum of two primes, according to the Goldbach conjecture.
All odd numbers except for numbers m such that m-2 and m+2 are prime (= A087679) would satisfy the definition. - M. F. Hasler, Apr 05 2017
Conjecture: except for a(4)=6, all terms are coprime to 3. - Bob Selcoe, Apr 06 2017
If E is an even number not divisible by 3, then E is in the sequence unless E-3 and at least one of E+3 and 2E-3 are prime. - Robert Israel, Apr 10 2017
Consider a subsequence with the additional condition: n+odd part of p-1 is composite (for example, for p=19 it is 9). I found that this subsequence begins 0,2,118 and up to 300000 Peter J. C. Moses found only more one term 868. Is this subsequence finite? - Vladimir Shevelev, Apr 12 2017
One can compare the theoretical maxima with the actual sequence numbers of terms. Doing this at powers of 10, we see at powers {2,3,4,5,6} the ratio progression {2.33, 1.51, 1.25, 1.15, 1.096}. This implies that the excluded even numbers become increasingly rare (those coprime to 3). - Bill McEachen, Apr 17 2017
From Robert Israel's comment and the distribution of primes, the proportion of even numbers not divisible by 3 that are in the sequence tends to 1. - Peter Munn, Apr 23 2017
Moreover, If n is not divisible by 3 and 2*n - 3 is composite, then 2*n+p is also composite. Indeed, for these 2*n all primes p such that 2*n-p is prime are in the interval (3, 2*n-3). Then either 2*n-p or 2*n+p should be divisible by 3, but 2*n-p is a prime > 3. So 2*n+p is composite and 2*n is in the sequence. - Vladimir Shevelev, Apr 28 2017

Examples

			k=28 is in the sequence because 5+23 = 28 and 11+17 = 28, and 28 + {5,11,17,23} are composite; k=26 is not in the sequence because 3+23 = 26, 7+19 = 26 and 13+13 = 26, but 26+3 = 29 (prime).  - _Bob Selcoe_, Apr 06 2017
		

Crossrefs

Cf. A284928 (terms/2), A002375 (number of decompositions p + q = 2k), A020481 (least p: p + q = 2k), A277688 (an analog for decompositions odd k as 2p+q).

Programs

  • Mathematica
    fQ[n_] :=  Select[Select[Prime@Range@PrimePi@n, PrimeQ[n - #] &],    PrimeQ[n + #] &] == {}; Select[2 Range[0, 150], fQ] (* Robert G. Wilson v, Apr 05 2017 *)
  • PARI
    is(n)=!bittest(n,0)&&!forprime(p=2,n\2, isprime(n-p) && (isprime(n+p) || isprime(2*n-p)) && return) \\ Charles R Greathouse IV and M. F. Hasler, Apr 05 2017

Formula

a(n) = 2*A284928(n). - M. F. Hasler, Apr 06 2017

A049613 a(n) = 2n - (largest prime < 2n-2).

Original entry on oeis.org

3, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 5, 7, 3, 3, 5, 7, 3, 5, 3, 3, 5, 3, 5, 7, 3, 5, 7, 3, 3, 5, 7, 3, 5, 3, 3, 5, 7, 3, 5, 3, 5, 7, 3, 5, 7, 9, 3, 5, 3, 3, 5, 3, 3, 5, 3, 5, 7, 9, 11, 13, 15, 3, 5, 3, 5, 7, 3, 3, 5, 7, 9, 11, 3, 3, 5, 7, 3, 5, 7, 3, 5, 3, 5, 7, 3, 5, 7, 3, 3, 5
Offset: 3

Views

Author

David M. Elder (elddm(AT)rhodes.edu)

Keywords

Examples

			a(14)=28 - (largest prime < 26) = 28 - 23 = 5.
		

Crossrefs

Programs

  • Haskell
    a049613 n = 2 * n - a007917 (2 * n - 2)
    -- Reinhard Zumkeller, Jan 02 2015
  • Mathematica
    Table[2n-NextPrime[2n-2,-1],{n,3,100}] (* Harvey P. Dale, Aug 16 2011 *)

Formula

a(n) <= A002373(n). - R. J. Mathar, Mar 19 2008
a(n) = 2*n - A007917(2*n-2). - Reinhard Zumkeller, Jan 02 2015

A184995 Irregular triangle T, read by rows, in which row n lists the primes p <= n such that 2n-p is also prime.

Original entry on oeis.org

2, 3, 3, 3, 5, 5, 3, 7, 3, 5, 5, 7, 3, 7, 3, 5, 11, 5, 7, 11, 3, 7, 13, 5, 11, 7, 11, 13, 3, 13, 3, 5, 11, 17, 5, 7, 13, 17, 7, 19, 3, 11, 17, 5, 11, 13, 19, 3, 7, 13, 3, 5, 17, 23, 5, 7, 11, 17, 19, 3, 7, 13, 19, 5, 11, 23, 7, 11, 13, 17, 23, 3, 13, 19, 5, 11, 17, 29, 7, 13, 17, 19, 23, 29
Offset: 2

Views

Author

Jason Kimberley, Sep 03 2011

Keywords

Comments

Row n has first entry A020481(n), length A045917(n), and last entry A112823(n).
Each row is the prefix to the middle of the corresponding row of A171637.
The Goldbach conjecture states that this irregular Goldbach triangle has in each row at least one entry (A045917(n) >= 1). - Wolfdieter Lang, May 14 2016

Examples

			The irregular triangle T(n, i) starts:
n, 2*n\i  1   2   3   4   5   6 ...
2,   4    2
3,   6    3
4,   8    3
5,  10    3   5
6,  12    5
7,  14    3   7
8,  16    3   5
9,  18    5   7
10, 20    3   7
11, 22    3   5  11
12, 24    5   7  11
13, 26    3   7  13
14, 28    5  11
15, 30    7  11  13
16, 32    3  13
17, 34    3   5  11  17
18, 36    5   7  13  17
19, 38    7  19
20, 40    3  11  17
21, 42    5  11  13  19
22, 44    3   7  13
23, 46    3   5  17  23
24, 48    5   7  11  17  19
25, 50    3   7  13  19
26, 52    5  11  23
27, 54    7  11  13  17  23
28, 56    3  13  19
29, 58    5  11  17  29
30, 60    7  13  17  19  23  29
... reformatted - _Wolfdieter Lang_, May 14 2016
		

Crossrefs

Programs

  • Magma
    A184995 := func;
    &cat[A184995(n):n in [2..30]];
  • Maple
    T:= n-> seq(`if`(andmap(isprime, [p, 2*n-p]), p, NULL), p=2..n):
    seq(T(n), n=2..40);  # Alois P. Heinz, Jan 09 2025
  • Mathematica
    Table[Select[Prime@ Range@ PrimePi@ n, PrimeQ[2 n - #] &], {n, 2, 30}] // Flatten (* Michael De Vlieger, May 14 2016 *)
    T[n_] := Table[If[PrimeQ[p] && PrimeQ[2n-p], p, Nothing], {p, 2, n}];
    Table[T[n], {n, 2, 30}] // Flatten (* Jean-François Alcover, Jan 09 2025, after Alois P. Heinz in A182138 *)

Formula

T(n,i) = n - A182138(n,i). - Jason Kimberley, Sep 25 2012

A238711 Product of all primes p such that 2n - p is also prime.

Original entry on oeis.org

2, 3, 15, 105, 35, 231, 2145, 5005, 4641, 53295, 1616615, 119301, 21505, 7436429, 21489, 57998985, 3038795305, 4123, 13844919, 10393190665, 12838371, 299859855, 7292509103495, 12023917269, 70691995, 37198413949697, 62483343, 2769282065, 98755025688454681
Offset: 2

Views

Author

Reinhard Zumkeller, Mar 06 2014

Keywords

Comments

Product of n-th row in triangle A171637;
All terms greater than 3 are odd, composite and squarefree numbers, cf. A024556.
n is prime iff n is a factor of a(n).
Product of the distinct primes in the Goldbach partitions of 2n. - Wesley Ivan Hurt, Sep 29 2020

Crossrefs

Cf. A000040, A010051, A238778, subsequence of A056911.

Programs

  • Haskell
    a238711 n = product $ filter ((== 1) . a010051') $
       map (2 * n -) $ takeWhile (<= 2 * n) a000040_list
  • Mathematica
    Table[Times@@Select[Select[Prime[Range[2 n]], # < 2 n &], PrimeQ[2 n - #] &], {n, 2, 30}] (* Robert Price, Apr 26 2025 *)

Formula

A020639(a(n)) = A020481(n); A006530(a(n)) = A020482(n);
A001221(a(n)) = A035026(n); A008472(a(n)) = A238778(n);
A027748(a(n),k) + A027748(a(n),l+1-k) = 2*n for k=1..l, with l=A001221(a(n)); particulary A020639(a(n))+A006530(a(n)) = 2*n;
a(n) = n^c(n) * Product_{i=1..n-1} (i*(2*n-i))^(c(i)*c(2*n-i)), where c is the prime characteristic (A010051). - Wesley Ivan Hurt, Sep 29 2020

A279040 Even numbers 2k such that the smallest prime p satisfying p+q=2k (q prime) is greater than or equal to sqrt(k).

Original entry on oeis.org

4, 6, 8, 10, 12, 14, 16, 18, 24, 28, 30, 36, 38, 42, 48, 54, 60, 68, 80, 90, 96, 98, 122, 124, 126, 128, 148, 150, 190, 192, 208, 210, 212, 220, 222, 224, 302, 306, 308, 326, 330, 332, 346, 368, 398, 418, 458, 488, 518, 538, 540, 542, 556, 640, 692, 710, 796, 854, 908, 962, 968, 992, 1006
Offset: 1

Views

Author

Corinna Regina Böger, Dec 04 2016

Keywords

Comments

a(n) is an extension of A244408.
It is conjectured that a(230) = 503222 is the last term. Oliveira e Silva's work shows that there are no more terms below 4*10^18.
The sequence definition is equivalent to: "Even integers k such that there exists a prime p with p = min{q: q prime and (k - q) prime} and k < 2*p^2" and therefore this is a member of the EGN- family (Cf. A307782). - Corinna Regina Böger, May 01 2019

Examples

			The smallest prime for 42 is 5 with 5 > sqrt(21), but not smaller than sqrt(42), and therefore 42 does not belong to A244408. The smallest prime for 38 is 7, and 7 >= sqrt(38), and therefore 38 also belongs to A244408.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[4, 1006, 2], Function[n, Select[#, PrimeQ@ Last@ # &][[1, 1]] >= Sqrt[n/2] &@ Map[{#, n - #} &, Prime@ Range@ PrimePi@ n]]] (* Michael De Vlieger, Dec 06 2016 *)
  • PARI
    isok(n) = forprime(p=2, n, if (isprime(n-p), if (p >= sqrt(n/2), return(1), return(0))));
    lista(nn) = forstep(n=2, nn, 2, if (isok(n), print1(n, ", "))) \\ Michel Marcus, Dec 04 2016

A104772 If n<=2 then n else (if n is odd then 2*a(n+1) else p*q, where n=p+q, p<=q, primes).

Original entry on oeis.org

1, 2, 8, 4, 18, 9, 30, 15, 42, 21, 70, 35, 66, 33, 78, 39, 130, 65, 102, 51, 114, 57, 190, 95, 138, 69, 230, 115, 322, 161, 174, 87, 186, 93, 310, 155, 434, 217, 222, 111, 370, 185, 246, 123, 258, 129, 430, 215, 282, 141, 470, 235, 658, 329, 318, 159, 530, 265, 742
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 24 2005

Keywords

Comments

Encoding of positive integers based on the Goldbach conjecture, see A104774 for decoding: A104774(A104772(n))=n;
a(n - n mod 2) = (2^(1 + n mod 2)) * A020481(floor(n/2))*A020482(floor(n/2));
for numbers greater than 4: a(even) = odd and a(odd) = even;
A001222(a(n)) = A010693(n) for n>2;
a(a(n)) = A104773(n).

Crossrefs

Formula

For k>1: a(2*k)=A020481(k)*A020482(k) and a(2*k-1)=2*a(2*k).

A112825 Least even number k such that the Goldbach gap is 2n, or 0 if no such number exists.

Original entry on oeis.org

4, 10, 14, 24, 22, 26, 36, 34, 50, 52, 46, 60, 58, 70, 62, 80, 78, 74, 84, 82, 86, 94, 100, 126, 114, 106, 120, 118, 130, 0, 138, 0, 134, 144, 142, 152, 158, 162, 176, 172, 166, 0, 178, 196, 0, 208, 198, 194, 204, 202, 230, 216, 214, 236, 0, 226, 0, 0, 0, 0, 258, 0, 254
Offset: 0

Views

Author

Robert G. Wilson v, Sep 05 2005

Keywords

Examples

			a(1)=10 because the two Goldbach partitions of 10 are {3,7} & {5,5} and (5-3)/2=1.
		

Crossrefs

Cf. A020481.

Programs

  • Mathematica
    f[n_] := Block[{p = 2, q = n/2}, While[ !PrimeQ[p] || !PrimeQ[n - p], p++ ]; While[ !PrimeQ[q] || !PrimeQ[n - q], q-- ]; q - p]; t = Table[0, {100}]; Do[a = f[2n]; If[a < 100 && t[[a/2 + 1]] == 0, t[[a/2 + 1]] = 2n; Print[{2a, 2n}]], {n, 2, 10^4}]; Take[t, 63]

A306261 Least k > 0 such that 2n - p is prime where p is some prime divisor of 4n^2 - (2k-1)^2 for n >= 4.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 2, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 4, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1
Offset: 4

Views

Author

Juri-Stepan Gerasimov, Feb 01 2019

Keywords

Comments

Conjecture: a(n) exists for n >= 4.
The conjecture holds up to 10^6. Records: a(4) = 1, a(6) = 2, a(34) = 3, a(75) = 4, a(154) = 9, a(1027) = 10, a(1097) = 11, a(1477) = 14, a(1552) = 17, a(5179) = 18, a(10684) = 29, a(70201) = 32, a(79861) = 43, a(519632) = 45, a(1018804) = 46, a(1713031) = 47, .... - Charles R Greathouse IV, Feb 17 2019

Examples

			a(4) = 1 because 4*4^2 - (2*1-1)^2 = 63 = 3^2*7 and 2*4 - 3 = 5 is prime;
a(5) = 1 because 4*5^2 - (2*1-1)^2 = 99 = 3^2*11 and 2*5 - 3 = 7 is prime;
a(6) = 2 because 4*6^2 - (2*1-1)^2 = 143 = 11*13 and 2*6 - 11 = 1 is not a prime, 2*6 - 13 = -1 is not a prime, but 4*6^2 -(2*2-1)^2 = 135 = 3^3*5 and 2*6 - 5 = 7 is prime.
		

Crossrefs

Programs

  • PARI
    a(n)=for(k=1,2*n,my(f=factor(4*n^2-(2*k-1)^2)[,1]);for(i=1,#f,if(isprime(2*n-f[i]),return(k)))); "does not exist" \\ Charles R Greathouse IV, Feb 17 2019

A377758 a(n) is the least i such that 2n-prime(i) is also a prime, where prime(i) is the i-th prime.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local i,p;
      p:= 1:
      for i from 1 do
        p:= nextprime(p);
        if isprime(2*n-p) then return i fi
      od
    end proc:
    map(f, [$2..100]); # Robert Israel, Nov 19 2024
  • Mathematica
    Table[Module[{i = 1}, While[i <= PrimePi[n] && ! PrimeQ[n - Prime[i]], i++]; If[i <= PrimePi[n], i, None]], {n, 4, 1000, 2}]
  • PARI
    a(n) = my(i=1); while (!isprime(2*n-prime(i)), i++); i; \\ Michel Marcus, Nov 06 2024
    
  • Python
    from sympy import primerange, isprime
    def A377758(n): return next(i for i, p in enumerate(primerange(2*n),1) if isprime((n<<1)-p)) # Chai Wah Wu, Nov 19 2024

Formula

a(n) = pi(A020481(n)).

A112824 Consider the Goldbach conjecture that every even number 2n=p+p' with p<=p'. Consider all such Goldbach partitions; a(n) is the difference between the largest p and the smallest p. Call this difference the Goldbach gap.

Original entry on oeis.org

0, 0, 0, 2, 0, 4, 2, 2, 4, 8, 6, 10, 6, 6, 10, 14, 12, 12, 14, 14, 10, 20, 14, 16, 18, 16, 16, 24, 22, 28, 20, 24, 24, 26, 26, 34, 26, 32, 30, 38, 36, 40, 36, 36, 28, 42, 36, 18, 44, 38, 40, 50, 42, 40, 50, 48, 40, 54, 52, 48, 42, 46, 42, 56, 56, 64, 48, 60, 64, 68, 66, 66, 48, 60
Offset: 2

Views

Author

Robert G. Wilson v, Sep 05 2005

Keywords

Comments

The gap is always even.

Crossrefs

Cf. A020481.

Programs

  • Mathematica
    f[n_] := Block[{p = 2, q = n/2}, While[ !PrimeQ[p] || !PrimeQ[n - p], p++ ]; While[ !PrimeQ[q] || !PrimeQ[n - q], q-- ]; q - p]; Table[ f[n], {n, 4, 150, 2}]

Formula

Previous Showing 11-20 of 33 results. Next