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

A210497 a(n) = 2*prime(n+1) - prime(n).

Original entry on oeis.org

4, 7, 9, 15, 15, 21, 21, 27, 35, 33, 43, 45, 45, 51, 59, 65, 63, 73, 75, 75, 85, 87, 95, 105, 105, 105, 111, 111, 117, 141, 135, 143, 141, 159, 153, 163, 169, 171, 179, 185, 183, 201, 195, 201, 201, 223, 235, 231, 231, 237, 245, 243, 261, 263, 269, 275, 273, 283
Offset: 1

Views

Author

Marco Piazzalunga, Jan 24 2013

Keywords

Comments

The subsequence of multiples of 3 begins: 9, 15, 15, 21, 21, 27, 33, 45.
The subsequence of primes begins: 7, 43, 73, 163, 179, 223.
Some terms, like a(3)=15 or a(5)=21, are repeated twice, other terms, like a(23)=105, are repeated three times.

Examples

			a(2) = 7 because prime(3) = 5, prime(2) = 3, and 2 * 5 - 3 = 7.
a(3) = 9 because prime(4) = 7, prime(3) = 5, and 2 * 7 - 5 = 9.
a(4) = 15 because prime(5) = 11, prime(4) = 7, and 2 * 11 - 7 = 15.
		

Crossrefs

Cf. A001223, A062234, A085704 (subsequence).

Programs

  • Magma
    [2*NextPrime(p)-p: p in PrimesUpTo(300)]; // Bruno Berselli, Jan 24 2013
    
  • Mathematica
    Table[2 Prime[n + 1] - Prime[n], {n, 50}] (* Vincenzo Librandi, May 03 2015 *)
    ListConvolve[{2, -1}, Prime[Range[100]]] (* Paolo Xausa, Oct 29 2024 *)
  • PARI
    a(n)=my(p=prime(n));2*nextprime(p+1)-p \\ Charles R Greathouse IV, Jan 24 2013
    
  • Python
    from sympy import prime, nextprime
    def A210497(n): return -(p:=prime(n))+(nextprime(p)<<1) # Chai Wah Wu, Oct 29 2024

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Jan 24 2013

A215808 Primes of the form 2*prime(k) - prime(k+1).

Original entry on oeis.org

3, 3, 17, 41, 47, 67, 151, 167, 199, 227, 251, 257, 347, 367, 557, 587, 601, 607, 641, 647, 727, 941, 971, 1051, 1091, 1097, 1117, 1181, 1217, 1277, 1361, 1427, 1447, 1447, 1487, 1487, 1499, 1607, 1697, 1741, 1747, 1741, 1777, 1877, 1901, 2087, 2143, 2281
Offset: 1

Views

Author

Zak Seidov, Sep 06 2012

Keywords

Comments

Corresponding values of k: 3, 4, 9, 15, 16, 21, 37, 40, 47, 51, 55, 56, 71, 74, 103 (A216075).

Examples

			k=3: 2*5-7=3, k=4: 2*7-11=3, k=9: 2*23-29=17.
		

Crossrefs

Programs

  • Mathematica
    pr=Prime[Range[1000]]; s=Select[2*Most[pr]-Rest[pr],PrimeQ]
    Select[2#[[1]]-#[[2]]&/@Partition[Prime[Range[500]],2,1],PrimeQ] (* Harvey P. Dale, Feb 25 2017 *)

A163981 a(n) is the smallest prime of the form prime(n+1)*k - prime(n), k >= 1, where prime(n) is the n-th prime.

Original entry on oeis.org

7, 2, 2, 37, 2, 89, 2, 73, 151, 2, 43, 127, 2, 239, 59, 419, 2, 73, 359, 2, 401, 419, 1163, 881, 307, 2, 967, 2, 569, 3697, 397, 691, 2, 457, 2, 163, 821, 839, 179, 1259, 2, 2111, 2, 1777, 2, 223, 3803, 3863, 2, 3499, 1201, 2, 2269, 263, 269, 1889, 2, 283, 1409, 2, 2647
Offset: 1

Views

Author

Leroy Quet, Aug 07 2009

Keywords

Comments

a(n) = 2 if and only if n is in A029707. - Robert Israel, Jan 16 2019

Crossrefs

Contains A085704.

Programs

  • Maple
    a := proc (n) local k: for k while isprime(ithprime(n+1)*k-ithprime(n)) = false do end do: ithprime(n+1)*k-ithprime(n) end proc: seq(a(n), n = 1 .. 65); # Emeric Deutsch, Aug 10 2009
  • Mathematica
    a[n_] := Module[{p, q, r}, For[p = Prime[n]; q = Prime[n + 1]; k = 1, True, k++, If[PrimeQ[r = q k - p], Return[r]]]];
    Array[a, 100] (* Jean-François Alcover, Aug 28 2020 *)
  • PARI
    a(n) = my(k=1); while (!isprime(p=prime(n+1)*k - prime(n)), k++); p; \\ Michel Marcus, Jul 02 2021
  • Python
    from sympy import isprime, nextprime, prime
    def a(n):
        pn = prime(n); pn1 = nextprime(pn); k = 1
        while not isprime(pn1*k - pn): k += 1
        return pn1*k - pn
    print([a(n) for n in range(1, 62)]) # Michael S. Branicky, Jul 02 2021
    

Extensions

Extended by Emeric Deutsch, Aug 10 2009
Showing 1-3 of 3 results.