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

A006512 Greater of twin primes.

Original entry on oeis.org

5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883, 1021, 1033, 1051, 1063, 1093, 1153, 1231, 1279, 1291, 1303, 1321, 1429, 1453, 1483, 1489, 1609
Offset: 1

Views

Author

Keywords

Comments

Also primes that are the sum of two primes (which is possible only if 2 is one of the primes). - Cino Hilliard, Jul 02 2004, edited by M. F. Hasler, Nov 14 2019
The set of greater of twin primes larger than five is a proper subset of the set of primes of the form 3n + 1 (A002476). - Paul Muljadi, Jun 05 2008
Smallest prime > n-th isolated composite. - Juri-Stepan Gerasimov, Nov 07 2009
Subsequence of A175075. Union of a(n) and sequence A175080 is A175075. - Jaroslav Krizek, Jan 30 2010
A164292(a(n))=1; A010051(a(n)+2)=0 for n > 1. - Reinhard Zumkeller, Mar 29 2010
Omega(n) = Omega(n-2); d(n) = d(n-2). - Juri-Stepan Gerasimov, Sep 19 2010
Aside from the first term, all subsequent terms have digital root 1, 4, or 7. - J. W. Helkenberg, Jul 24 2013
Also primes p with property that the sum of the successive gaps between primes <= p is a prime number. - Robert G. Wilson v, Dec 19 2014
The phrase "x is an element of the {primes, positive integers} and there {exist no, exist} elements a,b of {1 and primes, primes}: a+b=x" determines A133410, A067829, A025584, A006512, A166081, A014092, A014091 and A038609 for the first few hundred terms with only de-duplication or omitting/including 3, 4 and 6 in the case of A166081/A014091 and one case of omitting/including 3 given 1 isn't prime. - Harry G. Coin, Nov 25 2015
The yet unproved Twin Prime Conjecture states that this sequence is infinite. - M. F. Hasler, Nov 14 2019

References

  • See A001359 for further references and links.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A139690.
Bisection of A077800.

Programs

  • Haskell
    a006512 = (+ 2) . a001359 -- Reinhard Zumkeller, Feb 10 2015
    
  • Magma
    [n: n in PrimesUpTo(1610)|IsPrime(n-2)]; // Bruno Berselli, Feb 28 2011
    
  • Maple
    for i from 1 to 253 do if ithprime(i+1) = ithprime(i) + 2 then print({ithprime(i+1)}); fi; od; # Zerinvary Lajos, Mar 19 2007
    P := select(isprime,[$1..1609]): select(p->member(p-2,P),P); # Peter Luschny, Mar 03 2011
    A006512 := proc(n)
        2+A001359(n) ;
    end proc: # R. J. Mathar, Nov 26 2014
  • Mathematica
    Select[Prime[Range[254]], PrimeQ[# - 2] &] (* Robert G. Wilson v, Jun 09 2005 *)
    Transpose[Select[Partition[Prime[Range[300]], 2, 1], Last[#] - First[#] == 2 &]][[2]] (* Harvey P. Dale, Nov 02 2011 *)
    Cases[Prime[Range[500]] + 2, ?PrimeQ] (* _Fred Patrick Doty, Aug 23 2017 *)
  • PARI
    select(p->isprime(p-2),primes(1000))
    
  • PARI
    a(n)=p=3; while(p+2 < (p=nextprime(p+1)) || n-->0, ); p
    vector(100, n, a(n)) \\ Altug Alkan, Dec 04 2015
    
  • Python
    from sympy import primerange, isprime
    print([n for n in primerange(1, 2001) if isprime(n - 2)]) # Indranil Ghosh, Jul 20 2017

A117929 Number of partitions of n into 2 distinct primes.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Apr 03 2006

Keywords

Comments

Number of distinct rectangles with prime length and width such that L + W = n, W < L. For example, a(16) = 2; the two rectangles are 3 X 13 and 5 X 11. - Wesley Ivan Hurt, Oct 29 2017

Examples

			a(24) = 3 because we have [19,5], [17,7] and [13,11].
		

Crossrefs

Cf. A010051, A045917, A061358, A073610, A166081 (positions of 0), A077914 (positions of 2), A080862 (positions of 6).
Column k=2 of A219180. - Alois P. Heinz, Nov 13 2012

Programs

  • Maple
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j-1),j=1..35): gser:=series(g,x=0,130): seq(coeff(gser,x,n),n=1..125);
    # alternative
    A117929 := proc(n)
        local a,i,p ;
        a := 0 ;
        p := 2 ;
        for i from 1 do
            if 2*p >= n then
                return a;
            end if;
            if isprime(n-p) then
                a := a+1 ;
            end if;
            p := nextprime(p) ;
        end do:
    end proc:
    seq(A117929(n),n=1..80) ; # R. J. Mathar, Oct 01 2021
  • Mathematica
    l = {}; For[n = 1, n <= 1000, n++, c = 0; For[k = 1, Prime[k] < n/2, k++, If[PrimeQ[n - Prime[k]], c = c + 1] ]; AppendTo[l, c] ] l (* Jake Foster, Oct 27 2008 *)
    Table[Count[IntegerPartitions[n,{2}],?(AllTrue[#,PrimeQ]&&#[[1]]!= #[[2]] &)],{n,120}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale, Jul 26 2020 *)
  • PARI
    a(n)=my(s);forprime(p=2,(n-1)\2,s+=isprime(n-p));s \\ Charles R Greathouse IV, Feb 26 2014
    
  • 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 [a[n] for n in range(1, max+1)]
    print(aupton(105)) # Michael S. Branicky, Feb 16 2024

Formula

G.f.: Sum_{j>0} Sum_{i=1..j-1} x^(p(i)+p(j)), where p(k) is the k-th prime.
G.f.: A(x)^2/2 - A(x^2)/2 where A(x) = Sum_{p in primes} x^p. - Geoffrey Critzer, Nov 21 2012
a(n) = [x^n*y^2] Product_{i>=1} (1+x^prime(i)*y). - Alois P. Heinz, Nov 22 2012
a(n) = Sum_{i=2..floor((n-1)/2)} A010051(i) * A010051(n-i). - Wesley Ivan Hurt, Oct 29 2017

A038609 Numbers that are the sum of 2 different primes.

Original entry on oeis.org

5, 7, 8, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 24, 25, 26, 28, 30, 31, 32, 33, 34, 36, 38, 39, 40, 42, 43, 44, 45, 46, 48, 49, 50, 52, 54, 55, 56, 58, 60, 61, 62, 63, 64, 66, 68, 69, 70, 72, 73, 74, 75, 76, 78, 80, 81, 82, 84, 85, 86, 88, 90, 91, 92
Offset: 1

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net) 1998 Jul

Keywords

Crossrefs

Cf. A014091, A166081 (complement).

Programs

  • Maple
    isA038609 := proc(n)
        local i,p,q;
        for i from 1 do
            p := ithprime(i) ;
            if 2*p > n then
                return false;
            fi;
            q := n-p ;
            if q <= p then
                return false ;
            end if;
            if isprime(q) then
                return true;
            end if;
        end do:
    end proc:
    n :=1 :
    for c from 1 do
        if isA038609(c) then
            printf("%d %d\n",n,c) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Jun 09 2014
  • Mathematica
    max = 100;
    ip = PrimePi[max];
    Table[Prime[i] + Prime[j], {i, ip}, {j, i + 1, ip}] // Flatten // Union // Select[#, # <= max&]& (* Jean-François Alcover, Mar 23 2020 *)

A347419 Number of partitions of n into two or more distinct primes.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 0, 2, 1, 2, 2, 3, 1, 4, 2, 4, 4, 4, 4, 5, 5, 6, 5, 6, 6, 6, 8, 7, 9, 9, 9, 11, 10, 11, 13, 12, 13, 15, 14, 17, 16, 18, 18, 20, 21, 23, 22, 25, 25, 27, 30, 29, 32, 32, 34, 37, 38, 40, 42, 44, 45, 50, 49, 53, 55, 57, 60, 64, 66, 70, 71, 76, 78, 83, 86, 89, 93, 96
Offset: 1

Views

Author

Ayoub Saber Rguez, Aug 31 2021

Keywords

Comments

Every positive integer can be written as a sum of two or more distinct primes except 1,2,3,4,6 and 11.

Examples

			a(5) = 1: 2+3.
a(18) = 4: 11+7, 11+5+2, 13+5, 13+3+2.
		

Crossrefs

Programs

  • Maple
    h:= proc(n) h(n):=`if`(n<2, 0, `if`(isprime(n), n, h(n-1))) end:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<2, 0,
          b(n, h(i-1))+b(n-i, h(min(n-i, i-1)))))
        end:
    a:= n-> b(n, h(n-1)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 03 2021
  • Mathematica
    m = 24; Rest @ CoefficientList[Series[Product[(1 + x^Prime[k]), {k, 1, m}], {x, 0, Prime[m]}], x] - Table[Boole @ PrimeQ[n], {n, 1, Prime[m]}] (* Amiram Eldar, Sep 03 2021 *)
  • Python
    from sympy import isprime, primerange
    from functools import cache
    @cache
    def A000586(n, k=None): # after Charles R Greathouse IV
        if k == None: k = n
        if n < 1: return int(n == 0)
        return sum(A000586(n-p, p-1) for p in primerange(1, k+1))
    def a(n): return A000586(n) - isprime(n)
    print([a(n) for n in range(1, 83)]) # Michael S. Branicky, Sep 03 2021

Formula

a(n) = A000586(n) - A010051(n).

A303403 Even numbers that are not the sum of two prime-indexed primes.

Original entry on oeis.org

2, 4, 12, 18, 24, 26, 30, 32, 38, 40, 50, 54, 56, 60, 66, 68, 74, 80, 92, 96, 102, 104, 106, 110, 116, 122, 128, 136, 146, 148, 152, 154, 156, 164, 170, 172, 178, 180, 200, 204, 206, 212, 226, 230, 234, 248, 256, 260, 264, 268, 276, 290, 292, 296, 298, 302
Offset: 1

Views

Author

Amiram Eldar, May 13 2018

Keywords

Comments

Bayless et al. conjectured that every even number larger than 80612 is the sum of two prime-indexed primes. If the conjecture is true then this sequence is finite with 733 terms.
Similarly, it appears that 322704332 is the largest of the 1578727 even numbers that cannot be written as prime(prime(prime(i))) + prime(prime(prime(j))). - Giovanni Resta, May 31 2018

Examples

			20 is not in the sequence since 20 = 17 + 3 = prime(7) + prime(2).  2 and 7 are primes, so 3 and 17 are prime-indexed primes. - _Michael B. Porter_, May 21 2018
		

Crossrefs

Equals 2*A174682. - Michel Marcus, May 18 2018

Programs

  • Mathematica
    pipQ[n_]:=PrimeQ[n]&&PrimeQ[PrimePi[n]]; s1falsifiziertQ[s_]:= Module[{ip=IntegerPartitions[s, {2}], widerlegt=False}, Do[If[pipQ[ip[[i, 1]] ] ~And~ pipQ [ip[[i, 2]] ], widerlegt = True; Break[]], {i, 1, Length[ip]}]; widerlegt]; Select[Range[2500],EvenQ[#]&& s1falsifiziertQ[ # ]==False&] (* after Michael Taktikos at A014092 *)
    (* or *) p = Prime@ Prime@ Range@ PrimePi@ PrimePi@ 302; Select[Range[2, 302, 2], IntegerPartitions[#, {2}, p] == {} &] (* Giovanni Resta, May 31 2018 *)
  • PARI
    isok(n) = {if (n % 2, return (0)); forprime(p=2, n/2, if (isprime(primepi(p)) && isprime(n-p) && isprime(primepi(n-p)), return (0));); return (1);} \\ Michel Marcus, May 18 2018

A066615 Numbers that are not the sum of two or three distinct primes.

Original entry on oeis.org

1, 2, 3, 4, 6, 11, 17
Offset: 1

Views

Author

Amarnath Murthy, Dec 24 2001

Keywords

Comments

Probably there are no further terms.
An outgrowth of Goldbach's conjecture. "[I]n a letter to L. Euler (1742), C. F. Goldbach [asserted] that 'every odd number greater than 6 is equal to the sum of three primes.' Euler replied that Goldbach's conjecture was equivalent to the statement that every even number equal to or greater than 4 is equal to the sum of two primes. Because proving the second implies the first, but not the converse, most attention has been focused on the second representation. However, whether the statement is true for all even integers is still unsettled. Nevertheless, it is supported by existing evidence. A Russian mathematician, I. M. Vinogradov, proved that all large odd integers are the sum of three primes. Surprisingly, his techniques involve extremely subtle use of the theory of complex variables; no one has been able to extend them in order to solve Goldbach's conjecture." Andrews.
"Every number greater than 17 is the sum of 3 integers greater than 1 which are relatively prime in pairs." - Wells.

References

  • George E. Andrews, "Number Theory," Dover Publ. Inc., NY, 1994, page 111.
  • Calvin C. Clawson, "Mathematical Mysteries, the beauty and magic of numbers," Perseus Books, Cambridge, MA, 1996, Chapter 12, Pages 236-257.
  • Mark Herkommer, "Number Theory, A Programmer's Guide," McGraw-Hill, NY, 1999, pages 359-362.
  • Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, "An Introduction to The Theory of Numbers," Fifth Edition, John Wiley & Sons, Inc. NY, 1991, page 2.
  • Wacław Sierpiński, "250 Problems in Elementary Number Theory," New York: American Elsevier, Warsaw, 1970, pp. 4, 38-39.
  • David Wells, "The Penguin Dictionary of Curious and Interesting Numbers," Revised Edition, Penguin Books, London, 1997, page 76.

Crossrefs

Intersection of A166081 and A124868.

Programs

  • Mathematica
    a = Table[ Prime[n], {n, 1, 100}]; b = {0}; Do[ b = Append[b, a[[i]] + a[[j]]], {j, 2, 100}, {i, 1, j - 1}]; Union[b]; c = {0}; Do[ c = Append[c, a[[i]] + a[[j]] + a[[k]]], {k, 3, 100}, {j, 2, k - 1}, {i, 1, j - 1}]; Union[c]; Complement[ Table[n, {n, 1, 541} ], Union[b, c]]

Extensions

Entry revised by Robert G. Wilson v, Dec 27 2001

A171469 Nonnegative nonprimes which are neither the sum nor the product of two distinct primes.

Original entry on oeis.org

0, 1, 4, 27, 117, 121, 125, 135, 147, 171, 189, 207, 245, 255, 261, 275, 289, 297, 325, 343, 345, 357, 363, 387, 405, 425, 429, 455, 475, 477, 483, 495, 507, 513, 529, 531, 539, 555, 561, 567, 575, 585, 605, 625, 627, 637, 639, 651, 657, 665, 705, 715, 725, 747, 765, 777
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 09 2009

Keywords

Crossrefs

Programs

  • Mathematica
    prs=Prime[Range[150]];
    prodprs=Times@@@Subsets[prs,{2}];
    sumprs=Plus@@@Subsets[prs,{2}];
    Complement[Range[0,800],prs,prodprs,sumprs]  (* Harvey P. Dale, Jan 23 2011 *)

Extensions

Definition clarified, sequence corrected (51 removed, 289 inserted) and extended by R. J. Mathar, Apr 24 2010

A294345 Sum of the products of the smaller and larger parts of the Goldbach partitions of n into two distinct parts.

Original entry on oeis.org

0, 0, 0, 0, 6, 0, 10, 15, 14, 21, 0, 35, 22, 33, 26, 94, 0, 142, 34, 142, 38, 142, 0, 357, 46, 202, 0, 302, 0, 591, 58, 334, 62, 491, 0, 980, 0, 217, 74, 821, 0, 1340, 82, 785, 86, 827, 0, 1987, 94, 1512, 0, 1353, 0, 2677, 106, 1421, 0, 1479, 0, 4242, 118
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 28 2017

Keywords

Comments

Sum of the areas of the distinct rectangles with prime length and width such that L + W = n, W < L. For example, a(14) = 33; the only rectangle is 3 X 11 and 3*11 = 33 (the 7 X 7 rectangle is not considered since we have W < L).

Examples

			a(22) = 142; the Goldbach partitions of 22 are (19,3), (17,5) and (11,11) (we do not consider (11,11) since we only count prime parts which are distinct). Then the sum of the products of the smaller and larger parts from each partition is 19*3 + 17*5 = 142.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A294345:=n->add(i*(n-i)*(pi(i)-pi(i-1))*(pi(n-i)-pi(n-i-1)), i=2..floor((n-1)/2)): seq(A294345(n), n=1..100);
  • Mathematica
    Table[Sum[i (n - i) (PrimePi[i] - PrimePi[i - 1]) (PrimePi[n - i] - PrimePi[n - i - 1]), {i, 2, Floor[(n-1)/2]}], {n, 60}]
    Table[Total[Times@@@Select[IntegerPartitions[n,{2}],AllTrue[#,PrimeQ] && #[[1]]!=#[[2]]&]],{n,70}] (* Harvey P. Dale, Jul 29 2021 *)
  • PARI
    a(n) = sum(i=1, (n-1)\2, i*isprime(i)*(n-i)*isprime(n-i)); \\ Michel Marcus, Nov 08 2017

Formula

a(n) = Sum_{i=2..floor((n-1)/2)} i * (n-i) * c(i) * c(n-i), where c is the prime characteristic (A010051).
a(k) = 0, for k in A166081. - Michel Marcus, Oct 30 2017

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