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 21-30 of 109 results. Next

A067189 Numbers that can be expressed as the sum of two primes in exactly three ways.

Original entry on oeis.org

22, 24, 26, 30, 40, 44, 52, 56, 62, 98, 128
Offset: 1

Views

Author

Amarnath Murthy, Jan 10 2002

Keywords

Comments

Corresponds to numbers 2m such that A045917(m)=3. Subsequence of A014091. - Lekraj Beedassy, Apr 22 2004

Examples

			26 is a term as 26 = 23+3 = 19+7 = 13+13 are all the three ways to express 26 as a sum of two primes.
		

Crossrefs

Cf. A023036.
Numbers that can be expressed as the sum of two primes in k ways for k=0..10: A014092 (k=0), A067187 (k=1), A067188 (k=2), this sequence (k=3), A067190 (k=4), A067191 (k=5), A066722 (k=6), A352229 (k=7), A352230 (k=8), A352231 (k=9), A352233 (k=10).

Programs

  • Mathematica
    y = Select[Flatten@Table[Prime[i] + Prime[j], {i, 500}, {j, 1, i}], # < Prime[500] &]; Select[Union[y], Count[y, #] == 3 &] (* Robert Price, Apr 22 2025 *)

Extensions

Extended by Peter Bertok (peter(AT)bertok.com), who finds (Jan 13 2002) that there are no other terms below 10000 and conjectures there are no further terms in this sequence and A067188, A067190, etc.
R. K. Guy (Jan 14 2002) remarks: "I believe that these conjectures follow from a more general one by Hardy & Littlewood (probably in Some problems of 'partitio numerorum' III, on the expression of a number as a sum of primes, Acta Math. 44(1922) 1-70)."

A280226 Number of partitions of 2n into two squarefree parts.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 3, 5, 4, 6, 5, 7, 5, 7, 5, 8, 7, 11, 7, 11, 8, 13, 8, 13, 8, 14, 10, 13, 11, 15, 11, 15, 11, 18, 13, 21, 14, 20, 13, 20, 13, 22, 14, 23, 17, 23, 17, 24, 17, 25, 18, 26, 19, 31, 19, 29, 20, 31, 20, 31, 20, 33, 23, 30, 23, 32, 23, 32, 23, 35, 24, 41, 25, 39
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 29 2016

Keywords

Examples

			From _Wesley Ivan Hurt_, Feb 20 2018: (Start)
a(5) = 2; there are two partitions of 2*5 = 10 into two squarefree parts: (7,3), (5,5).
a(6) = 4; there are four partitions of 2*6 = 12 into two squarefree parts: (11,1), (10,2), (7,5), (6,6).
a(7) = 3; there are three partitions of 2*7 = 14 into two squarefree parts: (13,1), (11,3), (7,7).
a(8) = 5; there are five partitions of 2*8 = 16 into two squarefree parts: (15,1), (14,2), (13,3), (11,5), (10,6). (End)
		

Crossrefs

Programs

  • Maple
    with(numtheory): A280226:=n->sum(mobius(i)^2*mobius(2*n-i)^2, i=1..n): seq(A280226(n), n=1..100);
  • Mathematica
    f[n_] := Sum[(MoebiusMu[i]*MoebiusMu[2n -i])^2, {i, n}]; Array[f, 74] (* Robert G. Wilson v, Dec 29 2016 *)
  • PARI
    a(n)=sum(i=1,n, issquarefree(i) && issquarefree(2*n-i)) \\ Charles R Greathouse IV, Nov 05 2017

Formula

a(n) = Sum_{i=1..n} mu(i)^2 * mu(2n-i)^2, where mu is the Möbius function (A008683).
a(n) = n - A302391(n). - Wesley Ivan Hurt, Dec 11 2023

A187129 Consider all pairs of primes (p,q) with p+q = 2n, p <= q; a(n) is the sum of all the q's.

Original entry on oeis.org

2, 3, 5, 12, 7, 18, 24, 24, 30, 47, 49, 55, 40, 59, 48, 100, 102, 50, 89, 120, 109, 136, 181, 158, 117, 199, 133, 170, 252, 133, 261, 300, 98, 267, 324, 279, 303, 419, 244, 303, 494, 345, 260, 593, 302, 343, 503, 207, 452, 612, 399, 488, 668, 526, 619, 872, 574, 540, 1082, 352, 475, 920, 273, 691, 865, 598, 523, 822, 725, 864, 1211
Offset: 2

Views

Author

N. J. A. Sloane, Mar 11 2011

Keywords

Examples

			2*5 = 10 can be expressed as the sum of two primes in two ways: 3+7 and 5+5, so a(5) = 7+5 = 12.
		

Crossrefs

Programs

  • Maple
    with(numtheory); a:=n-> sum( (2*n-i)*( ((pi(i) - pi(i-1)) * (pi(2*n-i) - pi(2*n-i-1))) ), i = 1..n ); seq(a(k),k=1..100); # Wesley Ivan Hurt, Jan 20 2013
  • Mathematica
    Table[Total[Select[IntegerPartitions[2*n,{2}],AllTrue[#,PrimeQ]&][[All,1]]],{n,2,100}] (* Harvey P. Dale, Aug 09 2020 *)
  • PARI
    a(n) = my(s=0); forprime(p=1, n, if (isprime(2*n-p), s += 2*n-p)); s; \\ Michel Marcus, Apr 29 2021

Formula

a(n) = Sum_{i=1..n} (2*n-i) * c(i) * c(2*n-i), where c = A010051. - Wesley Ivan Hurt, Apr 29 2021
a(n) = sopf(A362640(n)), n>=2. - Wesley Ivan Hurt, Apr 28 2023

A185297 Consider all pairs of primes (p,q) with p+q = 2n, p <= q; a(n) is the sum of all the p's.

Original entry on oeis.org

2, 3, 3, 8, 5, 10, 8, 12, 10, 19, 23, 23, 16, 31, 16, 36, 42, 26, 31, 48, 23, 48, 59, 42, 39, 71, 35, 62, 108, 53, 59, 96, 38, 83, 108, 91, 77, 127, 76, 107, 178, 85, 92, 217, 66, 127, 169, 87, 148, 204, 121, 148, 196, 134, 165, 268, 122, 168, 358, 136, 145, 340, 111, 219, 323, 206, 157, 282, 255, 272, 373, 246, 175, 486, 132, 260, 419
Offset: 2

Views

Author

N. J. A. Sloane, Mar 11 2011

Keywords

Examples

			2*5 = 10 can be expressed as the sum of two primes in two ways, 3+7 and 5+5, so a(5) = 3+5 = 8.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    a:=n-> sum( (i)*( ((pi(i) - pi(i-1)) * (pi(2*n-i) - pi(2*n-i-1))) ), i = 1..n ); seq(a(k),k=1..100); # Wesley Ivan Hurt, Jan 20 2013
  • PARI
    a(n) = my(s=0); forprime(p=1, n, if (isprime(2*n-p), s += p)); s; \\ Michel Marcus, Apr 29 2021

Formula

a(n) = Sum_{i=1..n} i * c(i) * c(2*n-i), where c = A010051. - Wesley Ivan Hurt, Apr 29 2021
a(n) = sopf(A362641(n)), n>=2. - Wesley Ivan Hurt, Apr 28 2023

A209320 Number of ways to write 2n = p+q with p and q both prime, p+1 and q-1 both practical.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 19 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>2.
As p+q=(p+1)+(q-1), this unifies Goldbach's conjecture and its analog involving practical numbers.
The conjecture has been verified for n up to 10^7.

Examples

			a(8) = 2 since 2*8 = 3+13 = 11+5 with 3, 5, 11, 13 all prime and 3+1, 13-1, 11+1, 5-1 all practical.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n]
    Pow[n_, i_]:=Pow[n, i]=Part[Part[f[n], i], 1]^(Part[Part[f[n], i], 2])
    Con[n_]:=Con[n]=Sum[If[Part[Part[f[n], s+1], 1]<=DivisorSigma[1, Product[Pow[n, i], {i, 1, s}]]+1, 0, 1], {s, 1, Length[f[n]]-1}]
    pr[n_]:=pr[n]=n>0&&(n<3||Mod[n, 2]+Con[n]==0)
    a[n_]:=a[n]=Sum[If[PrimeQ[2n-Prime[k]]==True&&pr[Prime[k]+1]==True&&pr[2n-Prime[k]-1]==True,1,0],{k,1,PrimePi[2n-2]}]
    Do[Print[n," ",a[n]],{n,1,100}]

A235189 Number of ways to write n = (1 + (n mod 2))*p + q with p < n/2 such that p, q and prime(p) - p + 1 are all prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Jan 04 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n > 6.
This implies both Goldbach's conjecture (A045917) and Lemoine's conjecture (A046927). For primes p with prime(p) - p + 1 also prime, see A234695.

Examples

			a(10) = 1 since 10 = 3 + 7 with 3, 7 and prime(3) - 3 + 1 = 3 all prime.
a(28) = 1 since 28 = 5 + 23 with 5, 23 and prime(5) - 4 = 7 all prime.
a(61) = 1 since 61 = 2*7 + 47 with 7, 47 and prime(7) - 6 = 11 all prime.
a(98) = 1 since 98 = 31 + 67 with 31, 67 and prime(31) - 30 = 97 all prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=PrimeQ[Prime[n]-n+1]
    a[n_]:=Sum[If[p[Prime[k]]&&PrimeQ[n-(1+Mod[n,2])*Prime[k]],1,0],{k,1,PrimePi[(n-1)/2]}]
    Table[a[n],{n,1,100}]

A224708 The number of unordered partitions {a,b} of n such that a and b are composite.

Original entry on oeis.org

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

Views

Author

J. Stauduhar, Apr 16 2013

Keywords

Comments

For n > 11, a(n) > 0. - Geoffrey Critzer, Jan 31 2015
Last occurrence of n is a(A014092(n+4)). - Anthony Browne, May 25 2016

Examples

			For n=8, in the set {{7,1},{6,2},{5,3},{4,4}}, {4,4} is the only partition {a,b} where a and b are both composite, so a(8)=1.
For n=12, we have partitions {8,4} and {6,6}, so a(12)=2.
		

Crossrefs

Programs

  • Mathematica
    nn = 76; Rest[Transpose[CoefficientList[Series[Product[1/(1 - y x^i), {i, Select[Range[2, nn], ! PrimeQ[#] &]}], {x,0,nn}], {x, y}]][[3]]] (* Geoffrey Critzer, Jan 31 2015 *)
    f[n_] := Count[ PrimeQ@ Rest@ IntegerPartitions[ n, {2}], {False, False}]; Array[f, 76] (* Robert G. Wilson v, Feb 04 2015 *)

Formula

a(2*n) - a(2*n+1) + A010051(n) = A045917(n). - Anthony Browne, May 03 2016
a(A014092(n+4)) = n. - Anthony Browne, May 25 2016

A346399 a(n) is the number of symmetrically distributed consecutive primes centered at n (including n itself if n is prime).

Original entry on oeis.org

0, 1, 1, 2, 3, 2, 1, 0, 4, 0, 1, 6, 1, 0, 6, 0, 1, 4, 1, 0, 2, 0, 1, 0, 0, 2, 0, 0, 1, 10, 1, 0, 0, 2, 0, 0, 1, 0, 2, 0, 1, 6, 1, 0, 2, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 2, 0, 0, 1, 4, 1, 0, 0, 2, 0, 0, 1, 0, 2, 0, 1, 2, 1, 0, 0, 2, 0, 0, 1, 0, 4, 0, 1, 0, 0, 2, 0
Offset: 1

Views

Author

Ya-Ping Lu, Sep 18 2021

Keywords

Comments

a(n) is the number of consecutive primes in Goldbach pairs of 2n centered at n.
a(n) is odd if n is prime; otherwise, a(n) is even.
n is prime if a(n) = 1 and n is composite if a(n) = 0.
a(n) = 14 is not seen until n = 8021811 (with none higher through 4*10^7). - Bill McEachen, Jul 26 2024

Examples

			a(1) = 0 because no prime is <= 1.
a(2) = 1 because no prime is < 2 and {2} is the only symmetrically distributed prime centered at 2.
a(30) = 10 because there are 10 symmetrically distributed consecutive primes, {13, 17, 19, 23, 29, 31, 37, 41, 43, 47}, centered at 30.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    for n in range(1, 100):
        d = 1 if n%2 == 0 else 2
        ct = 1 if isprime(n) else 0
        while n - d > 2:
            k = isprime(n+d) + isprime(n-d)
            if k == 2: ct += 2
            elif k == 1: break
            d += 2
        print(ct)

A182138 Irregular triangle T, read by rows, in which row n lists the distances between n and the two primes whose sum makes 2n in decreasing order (Goldbach conjecture).

Original entry on oeis.org

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

Views

Author

Jean COHEN, Apr 16 2012

Keywords

Comments

The Goldbach conjecture is that for any even integer 2n>=4, at least one pair of primes p and q exist such that p+q=2n. The present numbers listed here are the distances d between each prime and n, the half of the even integer 2n: d=n-p=q-n with p <= q.
See the link section for plots I added. - Jason Kimberley, Oct 04 2012
Each nonzero entry d of row n is coprime to n. For otherwise n+d would be composite. - Jason Kimberley, Oct 10 2012

Examples

			n=2, 2n=4, 4=2+2, p=q=2 -> d=0.
n=18, 2n=36, four prime pairs have a sum of 36: 5+31, 7+29, 13+23, 17+19, with the four distances d being 13=18-5=31-18, 11=18-7=29-18, 5=18-13=23-18, 1=18-17=19-18.
Triangle begins:
  0;
  0;
  1;
  2, 0;
  1;
  4, 0;
  5, 3;
  4, 2;
  7, 3;
  8, 6, 0;
		

Crossrefs

Cf. A045917 (row lengths), A047949 (first column), A047160 (last elements of rows).
Cf. A184995.

Programs

Formula

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

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
Previous Showing 21-30 of 109 results. Next