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

A014092 Numbers that are not the sum of 2 primes.

Original entry on oeis.org

1, 2, 3, 11, 17, 23, 27, 29, 35, 37, 41, 47, 51, 53, 57, 59, 65, 67, 71, 77, 79, 83, 87, 89, 93, 95, 97, 101, 107, 113, 117, 119, 121, 123, 125, 127, 131, 135, 137, 143, 145, 147, 149, 155, 157, 161, 163, 167, 171, 173, 177, 179, 185, 187, 189, 191, 197, 203, 205, 207, 209
Offset: 1

Views

Author

Keywords

Comments

Suggested by the Goldbach conjecture that every even number larger than 2 is the sum of 2 primes.
Since (if we believe the Goldbach conjecture) all the entries > 2 in this sequence are odd, they are equal to 2 + an odd composite number (or 1).
Otherwise said, the sequence consists of 2 and odd numbers k such that k-2 is not prime. In particular there is no element from A006512, greater of a twin prime pair. - M. F. Hasler, Sep 18 2012
Values of k such that A061358(k) = 0. - Emeric Deutsch, Apr 03 2006
Values of k such that A073610(k) = 0. - Graeme McRae, Jul 18 2006

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Section 2.8 (for Goldbach conjecture).

Crossrefs

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

Programs

  • Haskell
    a014092 n = a014092_list !! (n-1)
    a014092_list = filter (\x ->
       all ((== 0) . a010051) $ map (x -) $ takeWhile (< x) a000040_list) [1..]
    -- Reinhard Zumkeller, Sep 28 2011
    
  • Maple
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j),j=1..50): gser:=series(g,x=0,230): a:=proc(n) if coeff(gser,x^n)=0 then n else fi end: seq(a(n),n=1..225); # Emeric Deutsch, Apr 03 2006
  • Mathematica
    s1falsifiziertQ[s_]:= Module[{ip=IntegerPartitions[s, {2}], widerlegt=False},Do[If[PrimeQ[ip[[i,1]] ] ~And~ PrimeQ[ip[[i,2]] ], widerlegt = True; Break[]],{i,1,Length[ip]}];widerlegt]; Select[Range[250],s1falsifiziertQ[ # ]==False&] (* Michael Taktikos, Dec 30 2007 *)
    Join[{1,2},Select[Range[3,300,2],!PrimeQ[#-2]&]] (* Zak Seidov, Nov 27 2010 *)
    Select[Range[250],Count[IntegerPartitions[#,{2}],?(AllTrue[#,PrimeQ]&)]==0&] (* _Harvey P. Dale, Jun 08 2022 *)
  • PARI
    isA014092(n)=local(p,i) ; i=1 ; p=prime(i); while(pA014092(a), print(n," ",a); n++)) \\ R. J. Mathar, Aug 20 2006
    
  • Python
    from sympy import prime, isprime
    def ok(n):
        i=1
        x=prime(i)
        while xIndranil Ghosh, Apr 29 2017

Formula

Odd composite numbers + 2 (essentially A014076(n) + 2 ).
Equals {2} union A005408 \ A052147, i.e., essentially the complement of A052147 (or rather A048974) within the odd numbers A005408. - M. F. Hasler, Sep 18 2012

A052147 a(n) = prime(n) + 2.

Original entry on oeis.org

4, 5, 7, 9, 13, 15, 19, 21, 25, 31, 33, 39, 43, 45, 49, 55, 61, 63, 69, 73, 75, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 153, 159, 165, 169, 175, 181, 183, 193, 195, 199, 201, 213, 225, 229, 231, 235, 241, 243, 253, 259
Offset: 1

Views

Author

Simon Colton (simonco(AT)cs.york.ac.uk), Jan 24 2000

Keywords

Comments

A048974, A052147, A067187 and A088685 are very similar after dropping terms less than 13. - Eric W. Weisstein, Oct 10 2003
A117530(n,2) = a(n) for n>1. - Reinhard Zumkeller, Mar 26 2006
a(n) = A000040(n) + 2 = A008864(n) + 1 = A113395(n) - 1 = A175221(n) - 2 = A175222(n) - 3 = A139049(n) - 4 = A175223(n) - 5 = A175224(n) - 6 = A140353(n) - 7 = A175225(n) - 8. - Jaroslav Krizek, Mar 06 2010
Left edge of the triangle in A065342. - Reinhard Zumkeller, Jan 30 2012
Union of A006512 and A107986. - David James Sycamore, Jul 08 2018

Crossrefs

A139690 is a subsequence.

Programs

A067187 Numbers that can be expressed as the sum of two primes in exactly one way.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 12, 13, 15, 19, 21, 25, 31, 33, 39, 43, 45, 49, 55, 61, 63, 69, 73, 75, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 153, 159, 165, 169, 175, 181, 183, 193, 195, 199, 201, 213, 225, 229, 231, 235, 241, 243, 253, 259, 265, 271
Offset: 1

Views

Author

Amarnath Murthy, Jan 10 2002

Keywords

Comments

All primes + 2 are terms of this sequence. Is 12 the last even term? - Frank Ellermann, Jan 17 2002
A048974, A052147, A067187 and A088685 are very similar after dropping terms less than 13. - Eric W. Weisstein, Oct 10 2003
Values of n such that A061358(n)=1. - Emeric Deutsch, Apr 03 2006

Examples

			4 is a term as 4 = 2+2, 15 is a term as 15 = 13+2.
		

Crossrefs

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

Programs

  • Maple
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j),j=1..80): gser:=series(g,x=0,280): a:=proc(n) if coeff(gser,x^n)=1 then n else fi end: seq(a(n),n=1..272); # Emeric Deutsch, Apr 03 2006
  • Mathematica
    cQ[n_]:=Module[{c=0},Do[If[PrimeQ[n-i]&&PrimeQ[i],c++],{i,2,n/2}]; c==1]; Select[Range[4,271],cQ[#]&] (* Jayanta Basu, May 22 2013 *)
    y = Select[Flatten@Table[Prime[i] + Prime[j], {i, 60}, {j, 1, i}], # < Prime[60] &]; Select[Union[y], Count[y, #] == 1 &] (* Robert Price, Apr 21 2025 *)

Extensions

Edited by Frank Ellermann, Jan 17 2002

A088685 Records for the sum-of-primes function sopfr(n) if sopfr(prime) is taken to be 0.

Original entry on oeis.org

0, 4, 5, 6, 7, 9, 10, 13, 15, 19, 21, 25, 31, 33, 39, 43, 45, 49, 55, 61, 63, 69, 73, 75, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 153, 159, 165, 169, 175, 181, 183, 193, 195, 199, 201, 213, 225, 229, 231, 235, 241, 243, 253, 259, 265, 271
Offset: 1

Views

Author

Eric W. Weisstein, Oct 05 2003

Keywords

Comments

A048974, A052147 and A067187 are very similar after dropping terms less than 13. - Eric W. Weisstein, Oct 10 2003

Crossrefs

Programs

  • Mathematica
    Union@ FoldList[Max, Table[Total@ Flatten@ Map[ConstantArray[#1, #2] /. 1 -> 0 & @@ # &, FactorInteger@ n] - n Boole[PrimeQ@ n], {n, 540}]] (* Michael De Vlieger, Jun 29 2017 *)
  • PARI
    sopfr(k) = my(f=factor(k)); sum(j=1, #f~, f[j, 1]*f[j, 2]);
    lista(nn) = {my(record = -1); for (n=1, nn, if (! isprime(n), if ((x=sopfr(n)) > record, record = x; print1(record, ", "));););} \\ Michel Marcus, Jun 29 2017
    
  • Python
    from sympy import factorint, isprime
    def sopfr(n):
        f=factorint(n)
        return sum([i*f[i] for i in f])
    l=[]
    record=-1
    for n in range(1, 501):
        if not isprime(n):
            x=sopfr(n)
            if x>record:
                record=x
                l.append(record)
    print(l) # Indranil Ghosh, Jun 29 2017

A370090 Numbers that can be expressed in exactly one way as the unordered sum of two distinct primes.

Original entry on oeis.org

5, 7, 8, 9, 10, 12, 13, 14, 15, 19, 21, 25, 31, 33, 38, 39, 43, 45, 49, 55, 61, 63, 69, 73, 75, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 153, 159, 165, 169, 175, 181, 183, 193, 195, 199, 201, 213, 225, 229, 231, 235, 241, 243, 253, 259, 265
Offset: 1

Views

Author

Wesley Ivan Hurt, Feb 11 2024

Keywords

Comments

Apparently, a number that is the predecessor or successor of a prime number does not have a sum as defined here, except for a finite number of primes, which may be {7, 11, 13, 37}. - Peter Luschny, Feb 16 2024

Examples

			5 = 2+3; 7 = 2+5; 8 = 3+5; 9 = 2+7; 10 = 3+7 (10 = 5+5 is not considered).
		

Crossrefs

Cf. A117929, A048974, A065091, A067187 (not necessarily distinct).
If we change 1 way (this sequence) we get A077914 (2 ways), A077969 (3 ways), A078299 (4 ways), A080854 (5 ways), and A080862 (6 ways).

Programs

  • Maple
    select(n -> A117929(n) = 1, [seq(1..265)]);  # Peter Luschny, Feb 16 2024
  • Mathematica
    tdpQ[{a_,b_}]:=AllTrue[{a,b},PrimeQ]&&a!=b; Select[Range[300],Count[IntegerPartitions[#,{2}],?tdpQ]==1&] (* _Harvey P. Dale, Dec 30 2024 *)
  • Python
    from sympy import sieve
    from collections import Counter
    from itertools import combinations
    def aupton(max):
        sieve.extend(max)
        a = Counter(c[0]+c[1] for c in combinations(sieve._list, 2))
        return [n for n in range(1, max+1) if a[n] == 1]
    print(aupton(265)) # Michael S. Branicky, Feb 16 2024

A123123 Numbers m such that m mod k = 2 for only one integer k in 2..m.

Original entry on oeis.org

5, 6, 7, 9, 13, 15, 19, 21, 25, 31, 33, 39, 43, 45, 49, 55, 61, 63, 69, 73, 75, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 153, 159, 165, 169, 175, 181, 183, 193, 195, 199, 201, 213, 225, 229, 231, 235, 241, 243, 253, 259, 265, 271, 273, 279
Offset: 1

Views

Author

Jared B. Ricks (jaredricks(AT)yahoo.com), Sep 24 2006

Keywords

Comments

From 7 on, sequence gives primes + two. This can be easily seen since the definition is equivalent to the following: "Numbers m such that there's only one k, 2 <= k <= m-2, that divides m-2." So k|(m-2) and values of k: m and m-1 are not considered since they don't divide m-2. But this 2nd statement is also the same as saying that m-2 is a prime number and so m = prime + 2.
Essentially the same as A048974. - R. J. Mathar, Jun 18 2008

Crossrefs

Programs

  • Mathematica
    Join[{5,6},Prime[Range[3,60]]+2] (* Harvey P. Dale, Sep 05 2017 *)
  • PARI
    for(n=1,500,if(sum(k=2,n,if(n%k==2,1,0))==1,print1(n,", ")))
    
  • Python
    from sympy import prime
    a = lambda n : 5 if n==1 else (6 if n==2 else prime(n)+2)
    # Christoph B. Kassir, Apr 14 2022

Formula

a(n) = prime(n) + 2 = A000040(n) + 2 for n >= 3 (prime(3) = 5 > 4).

Extensions

Edited by Herman Jamke (hermanjamke(AT)fastmail.fm), Sep 24 2006

A343782 Sum of the positive differences of the prime pairs (p,q) such that n = p + q and p <= q.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 3, 2, 5, 4, 0, 2, 9, 8, 11, 16, 0, 12, 15, 20, 17, 28, 0, 26, 21, 32, 0, 24, 0, 28, 27, 32, 29, 64, 0, 60, 0, 24, 35, 58, 0, 72, 39, 86, 41, 88, 0, 122, 45, 116, 0, 78, 0, 128, 51, 98, 0, 108, 0, 144, 57, 80, 59, 202, 0, 204, 0, 60, 65, 184, 0, 216, 69, 188
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 29 2021

Keywords

Comments

From Bernard Schott, May 01 2021: (Start)
a(n) = 0 iff n is in A166081.
a(n) is odd iff n is A048974. (End)

Examples

			a(16) = 16; We have (3,13) and (5,11). The sum of the positive differences is (13-3) + (11-5) = 10 + 6 = 16.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[(n - 2 i) (PrimePi[i] - PrimePi[i - 1]) (PrimePi[n - i] - PrimePi[n - i - 1]), {i, Floor[n/2]}], {n, 100}]
  • PARI
    a(n) = my(s=0); forprime(p=1, n\2, if (isprime(n-p), s += n-2*p)); s; \\ Michel Marcus, May 01 2021

Formula

a(n) = Sum_{i=1..floor(n/2)} c(i) * c(n-i) * (n-2*i), where c is the prime characteristic (A010051).
Showing 1-7 of 7 results.