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 43 results. Next

A120303 Largest prime factor of Catalan number A000108(n).

Original entry on oeis.org

2, 5, 7, 7, 11, 13, 13, 17, 19, 19, 23, 23, 23, 29, 31, 31, 31, 37, 37, 41, 43, 43, 47, 47, 47, 53, 53, 53, 59, 61, 61, 61, 67, 67, 71, 73, 73, 73, 79, 79, 83, 83, 83, 89, 89, 89, 89, 97, 97, 101, 103, 103, 107, 109, 109, 113, 113, 113, 113, 113, 113, 113, 127, 127, 131, 131
Offset: 2

Views

Author

Alexander Adamchuk, Jul 13 2006

Keywords

Comments

All prime numbers (except 3) are present in this sequence in their natural order with repetition. The number of repetitions is equal to A028334(n): differences between consecutive primes, divided by 2. - Alexander Adamchuk, Jul 30 2006
For p>3 a((p+1)/2) = p and all a(n) = p for n >= (p+1)/2 until the first occurrence of the next prime q = NextPrime(p) at a((q+1)/2) = q. - Alexander Adamchuk, Dec 27 2013
For n>2, a(n) is the largest prime less than 2*n. - Gennady Eremin, Mar 02 2021

Examples

			G.f. = 2*x^2 + 5*x^3 + 7*x^4 + 7*x^5 + 11*x^6 + 13*x^7 + 13*x^8 + 17*x^9 + ...
		

Crossrefs

Programs

  • Mathematica
    Table[Max[FactorInteger[(2n)!/n!/(n+1)! ]],{n,2,100}]
    FactorInteger[CatalanNumber[#]][[-1,1]]&/@Range[2,70] (* Harvey P. Dale, May 02 2017 *)
  • PARI
    a(n) = vecmax(factor(binomial(2*n, n)/(n+1))[,1]); \\ Michel Marcus, Nov 14 2015
    
  • PARI
    a(n)=if(n>2,precprime(2*n),2) \\ Charles R Greathouse IV, Nov 17 2015
    
  • Python
    from gmpy2 import is_prime
    A120303 = [2]
    for n in range(3, 801):
        for k in range(2*n-1, n, -2):
            if is_prime(k, n):
                A120303.append(k)
                break
    for n in range(len(A120303)):
        print(n+2, A120303[n])  # Gennady Eremin, Mar 17 2021

Formula

a(n) = A060308(n) = A060265(n) for n>2.
a(n) = A006530(A000108(n)). - Michel Marcus, Nov 14 2015
G.f.: A(x) - x^2, where A(x) is the g.f. of A060265. - Gennady Eremin, Mar 02 2021

A204100 Number of integers between successive twin primes, divided by 3.

Original entry on oeis.org

0, 1, 1, 3, 3, 5, 3, 9, 1, 9, 3, 9, 3, 1, 9, 3, 9, 3, 9, 11, 23, 3, 9, 19, 15, 9, 5, 7, 5, 49, 3, 1, 9, 7, 45, 3, 5, 3, 9, 19, 25, 15, 3, 3, 5, 35, 7, 9, 1, 39, 3, 15, 9, 7, 21, 27, 1, 17, 5, 15, 9, 17, 1, 7, 5, 3, 31, 9, 13, 9, 13, 55, 13, 21, 9, 7, 5, 19
Offset: 1

Views

Author

Michel Lagneau, Jan 10 2012

Keywords

Examples

			a(2) = 1 because there exists three numbers 8, 9 and 10 between (5,7) and (11,13) => a(2) = 3/3 = 1.
		

Crossrefs

Programs

  • Maple
    T:=array(1..100,1..2):k:=0:for n from 1 to 1000 do:p1:=ithprime(n):p2:=ithprime(n+1):if p2-p1 = 2 then k:=k+1:T[k,1]:=p1:T[k,2]:=p2:else fi:od: for p from 2 to k do:x:= T[p+1,1]- T[p,2]: printf(`%d, `,(x-1)/3):od:
  • Mathematica
    Join[{0},Rest[(#[[2]]-#[[1]]-1)/3&/@Partition[Rest[Flatten[Select[ Partition[ Prime[Range[500]],2,1],#[[2]]-#[[1]]==2&]]],2]]] (* Harvey P. Dale, Jan 10 2016 *)

Formula

a(n) = (A063091(n+1)- A063091(n)-3)/3 = A204099(n)/3

A356223 Position of n-th appearance of 2n in the sequence of prime gaps (A001223). If 2n does not appear at least n times, set a(n) = -1.

Original entry on oeis.org

2, 6, 15, 79, 68, 121, 162, 445, 416, 971, 836, 987, 2888, 1891, 1650, 5637, 5518, 4834, 9237, 8152, 10045, 21550, 20248, 20179, 29914, 36070, 24237, 53355, 52873, 34206, 103134, 90190, 63755, 147861, 98103, 117467, 209102, 206423, 124954, 237847, 369223
Offset: 1

Views

Author

Gus Wiseman, Aug 04 2022

Keywords

Comments

Prime gaps (A001223) are the differences between consecutive prime numbers. They begin: 1, 2, 2, 4, 2, 4, 2, 4, 6, ...

Examples

			We need the first 15 prime gaps (1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6) before we reach the 3rd appearance of 6, so a(6) = 15.
		

Crossrefs

The first appearances are at A038664, seconds A356221.
Diagonal of A356222.
A001223 lists the prime gaps.
A073491 lists numbers with gapless prime indices.
A356224 counts divisors with gapless prime indices, complement A356225.
A356226 = gapless interval lengths of prime indices, run-lengths A287170.

Programs

  • Mathematica
    nn=1000;
    gaps=Differences[Array[Prime,nn]];
    Table[Position[gaps,2*n][[n,1]],{n,Select[Range[nn],Length[Position[gaps,2*#]]>=#&]}]

A330559 a(n) = (number of primes p <= prime(n) with Delta(p) == 2 (mod 4)) - (number of primes p <= prime(n) with Delta(p) == 0 (mod 4)), where Delta(p) = nextprime(p) - p.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 30 2019

Keywords

Comments

Equals A330560 - A330561.
Since Delta(prime(n)) grows roughly like log n, this probably changes sign infinitely often. When is the next time a(n) is zero, or the first time a(n) < 0 (if these values exist)?
Let s = A024675, the interprimes. For each n let E(n) = number of even terms of s that are <= n, and let O(n) = number of odd terms of s that are <= n. Then a(n+1) = E(n) - O(n). That is, as we progress through s, the number of evens stays greater than the number of odds. - Clark Kimberling, Feb 26 2024

Examples

			n=6: prime(6) = 13, primes p <= 13 with Delta(p) == 2 (mod 4) are 3,5,11; primes p <= 13 with Delta(p) == 0 (mod 4) are 7,13; so a(6) = 3-2 = 1.
		

Crossrefs

Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556, A330557, A330558, A330560, A330561.

Programs

  • Mathematica
    Join[{0}, Accumulate[Mod[Differences[Prime[Range[2, 100]]], 4] - 1]] (* Paolo Xausa, Feb 05 2024 *)

A330560 a(n) = number of primes p <= prime(n) with Delta(p) == 2 (mod 4), where Delta(p) = nextprime(p) - p.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, 18, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 29, 30, 30, 30, 30, 31, 31, 32, 33, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 42, 43, 43, 44, 45, 46, 47, 47, 48, 48, 49, 50, 50, 51, 51, 51, 51, 52, 53, 54
Offset: 1

Views

Author

N. J. A. Sloane, Dec 30 2019

Keywords

Crossrefs

Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556, A330557, A330558, A330559, A330561.

Programs

  • Magma
    [#[p:p in PrimesInInterval(1,NthPrime(n))| (NextPrime(p)-p) mod 4 eq 2]:n in [1..90]]; // Marius A. Burtea, Dec 31 2019
  • Maple
    N:= 200: # for a(1)..a(N)
    P:= [seq(ithprime(i), i=1..N+1)]:
    Delta:= P[2..-1]-P[1..-2] mod 4:
    R:= map(charfcn[2], Delta):
    ListTools:-PartialSums(R); # Robert Israel, Dec 31 2019
  • Mathematica
    Accumulate[Map[Boole[Mod[#, 4] == 2]&, Differences[Prime[Range[100]]]]] (* Paolo Xausa, Feb 05 2024 *)

A352743 a(n) = Product_{k=1..n} (p(k+1) + p(k))/(p(k+1) - p(k)), where p(k) = prime(k).

Original entry on oeis.org

1, 5, 20, 120, 540, 6480, 48600, 874800, 9185400, 79606800, 2388204000, 27066312000, 527793084000, 22167309528000, 498764464380000, 8312741073000000, 155171166696000000, 9310270001760000000, 198619093370880000000, 6852358721295360000000, 493369827933265920000000
Offset: 0

Views

Author

Thomas Ordowski, Apr 01 2022

Keywords

Comments

Conjecture: a(n) is an integer for every natural n. - Thomas Ordowski
Checked up to n = 10^4. - Amiram Eldar, Mar 30 2022
Checked up to n = 10^6. - Michael S. Branicky, Apr 01 2022
Note that (a(n)-1)/(a(n)+1) is the relativistic sum of the velocities prime(k)/prime(k+1) from k = 1 to n, in units where the speed of light c = 1. - Thomas Ordowski, Apr 05 2022
a(0) = 1, a(n) is the largest k such that b(n+1) = b(n)*(k + a(n-1))/(k - a(n-1)) is prime, where b(1) = 2. By my conjecture, b(n) = prime(n). - Thomas Ordowski, Jul 30 2025

Examples

			a(4) = ((3+2)/(3-2))*((5+3)/(5-3))*((7+5)/(7-5))*((11+7)/(11-7)) = 540.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; (p-> `if`(n=0, 1,
          a(n-1)*(p(n+1)+p(n))/(p(n+1)-p(n))))(ithprime)
        end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Apr 01 2022
  • Mathematica
    p = Prime[Range[21]]; FoldList[Times, 1, (Rest[p] + Most[p])/(Rest[p] - Most[p])] (* Amiram Eldar, Apr 01 2022 *)
  • PARI
    a(n) = my(v=primes(n+1)); prod(k=1, n, (v[k+1]+v[k])/(v[k+1]-v[k])); \\ Michel Marcus, Apr 10 2025
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        n, an, p, pp = 0, 1, 2, 3
        while True:
            yield an
            q, r = divmod(an*(pp+p), pp-p)
            assert r == 0, ("Counterexample", n, p, pp)
            n, an, p, pp = n+1, q, pp, nextprime(pp)
    print(list(islice(agen(), 21))) # Michael S. Branicky, Apr 01 2022
    

Formula

a(n) = Product_{k=1..n} A001043(k)/A001223(k).
a(n+1) = 5 * Product_{k=1..n} A024675(k)/A028334(k+1).
Note that A024675(k) and A028334(k+1) are relatively prime.
For n >= 2, a(n) <= (prime(n)+1)*a(n-1). - Thomas Ordowski, Jul 30 2025

Extensions

More terms from Amiram Eldar, Apr 01 2022

A100820 Number of odd numbers between prime(n) and prime(n+1).

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, Jan 06 2005

Keywords

Examples

			a(2)=0 because between 3 and 5 there are no odd numbers.
a(3)=0 because between 5 and 7 there are no odd numbers.
		

Crossrefs

Programs

  • Magma
    [0] cat [(NthPrime(n+1)-NthPrime(n))/2-1 : n in [2..100]]; // Wesley Ivan Hurt, Jun 01 2016
  • Maple
    P:= select(isprime,[seq(i,i=3..1000,2)]):
    0,op(map(`-`,1/2*(P[2..-1]-P[1..-2]),1)); # Robert Israel, Jun 01 2016
  • Mathematica
    Table[Floor[Max[(Prime[n + 1] - Prime[n])/2 - 1, 0] ], {n, 120}] (* Ray Chandler, Jan 09 2005 *)

Formula

a(n) = (prime(n+1)-prime(n))/2-1 = A001223(n)/2-1 for n>=2. - Robert Israel, Jun 01 2016
a(n) = A028334(n) - 1 for n>=2. - Michel Marcus, Jan 04 2023

Extensions

Corrected and extended by Ray Chandler, Jan 09 2005

A225423 Primes p such that p + 70000000 is also prime.

Original entry on oeis.org

37, 43, 103, 157, 181, 283, 331, 379, 409, 433, 613, 631, 643, 691, 739, 811, 823, 829, 991, 1021, 1093, 1171, 1201, 1237, 1249, 1279, 1297, 1381, 1483, 1741, 1759, 1777, 1873, 1879, 2011, 2017, 2131, 2221, 2239, 2269, 2341, 2377, 2467, 2473, 2551, 2659, 2791
Offset: 1

Views

Author

T. D. Noe, May 15 2013

Keywords

Comments

Yitang (Tom) Zhang announced yesterday that he could prove that there are an infinite number of k-twin primes p, p+k, for some k < 70000000. Here 70000000 is only an upper bound. See the Comments in A028334. - corrected by Jonathan Sondow, May 17 2013

Crossrefs

Cf. A001359 (first member of a twin prime pair), A028334.

Programs

  • Mathematica
    Select[Prime[Range[600]], PrimeQ[70000000 + #] &]

A279765 Primes p such that p+24 and p+48 are also primes.

Original entry on oeis.org

5, 13, 19, 23, 59, 79, 83, 89, 103, 149, 233, 269, 283, 349, 373, 409, 419, 439, 443, 499, 523, 569, 593, 653, 709, 773, 829, 839, 859, 863, 929, 1039, 1069, 1259, 1279, 1399, 1423, 1559, 1699, 1753, 1823, 1949, 1979, 2039, 2063, 2089, 2113, 2309, 2333, 2393
Offset: 1

Views

Author

Gerhard Kirchner, Dec 18 2016

Keywords

Comments

Subsequence of A033560. The triples have the form (p,p+d,p+2d). The current sequence (d=24) continues A023241 (d=6), A185022 (d=12) and A156109 (d=18). The frequencies of such triples and the triple (p, p+3±1, p+6) in A007529 do not differ very much (see table in the link "comparison of triples"). For creating the b-file I used a file of prime differences, divided by 2 (extension of A028334). For filling the table I analyzed primes up to 10^9.
Annotation: The algorithm using a file of primes or prime differences is not difficult but not as easy as using a function like isprime(n). On the other hand, such a function needs computing time which is not negligible for large numbers.

Examples

			First term: 5, 5 + 24 = 29 and 5 + 48 = 53 are all primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@Range@500, PrimeQ[# + 24] && PrimeQ[# + 48] &] (* Robert G. Wilson v, Dec 18 2016 *)
  • PARI
    is(n) = for(k=0, 2, if(!ispseudoprime(n+24*k), return(0))); 1 \\ Felix Fröhlich, Dec 26 2016

A341765 Consider gaps between successive odd primes from 3 up to prime(n+2). Let k1 be number of gaps congruent to 2 (mod 6) and let k2 be number of gaps congruent to 4 (mod 6). Then a(n) = k1 - k2.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2
Offset: 1

Views

Author

Artur Jasinski, Feb 19 2021

Keywords

Comments

Theorem A: for all n, a(n) belongs to the set: {1,2}, for proof see A342156.
The indices n for which numbers of 1's and 2's in this sequence are equal are 2, 4, 6, 10, 12, 20, 36, 46, 48 and no other up to n=10^6.

Examples

			a(1)=1 because prime(2+1)-prime(2)=5-3=2 then the gap 2 is congruent to 2 mod 6, then k1=1 and k2=0 so k1 - k2 = 1.
		

Crossrefs

Programs

  • Mathematica
    k1 = 0; k2 = 0; cc = {}; Do[
    gap = Prime[n + 1] - Prime[n];
    If[Mod[gap/2, 3] == 1, k1 = k1 + 1,
      If[Mod[gap/2, 3] == 2, k2 = k2 + 1]]; AppendTo[cc, k1 - k2];
    If[k1 - k2 == 1, , If[k1 - k2 == 2, , Print[{n, k1 - k2}]]], {n, 2,
      105}]; cc
  • PARI
    a(n) = {my(vp = vector(n+1, k, prime(k+1)), dp = vector(#vp-1, k, (vp[k+1] - vp[k])/2)); my(s=0); for (k=1, #dp, if ((dp[k]%3)==1, s++); if ((dp[k]%3) == 2, s--)); s;} \\ Michel Marcus, Feb 27 2021

Formula

a(n) = 3 - A039701(n+2). - Andrey Zabolotskiy, Nov 04 2024

Extensions

Name edited by Andrey Zabolotskiy, Nov 04 2024
Previous Showing 21-30 of 43 results. Next