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

A089623 Numbers n such that n^2 + 2n - 1 is prime.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 14, 18, 20, 26, 28, 32, 34, 36, 42, 46, 48, 54, 60, 62, 68, 70, 74, 76, 88, 92, 102, 106, 116, 118, 120, 126, 130, 134, 138, 144, 154, 160, 168, 172, 176, 182, 190, 204, 210, 216, 222, 230, 232, 236, 238, 246, 252, 256, 258, 264, 266, 272
Offset: 1

Views

Author

Giovanni Teofilatto, Dec 31 2003

Keywords

Comments

Equivalently, numbers n such that (n+1)^2 - 2 is prime.

References

  • M. Cerasoli, F. Eugeni and M. Protasi, Elementi di Matematica Discreta, Bologna 1988.
  • Emanuele Munarini and Norma Zagaglia Salvi, Matematica Discreta, UTET, CittaStudiEdizioni, Milano 1997.

Crossrefs

Cf. A088572. See A028871 for the actual primes.

Programs

Formula

a(n) = 2*A088572(n).

Extensions

Corrected (1 prepended and 96 replaced with 92) by Vincenzo Librandi, Dec 17 2010

A225844 Least k>0 such that triangular(n) + k*(k+1) is a triangular number.

Original entry on oeis.org

2, 1, 3, 5, 7, 2, 11, 13, 5, 17, 19, 3, 6, 25, 27, 9, 31, 33, 35, 4, 9, 41, 8, 45, 47, 10, 14, 53, 9, 5, 59, 61, 21, 18, 67, 69, 21, 73, 75, 14, 22, 6, 11, 13, 87, 15, 91, 26, 20, 34, 12, 101, 26, 105, 30, 7, 20, 33, 115, 117, 119, 34, 21, 125, 37, 129, 29, 133, 14, 137
Offset: 0

Views

Author

Alex Ratushnyak, May 17 2013

Keywords

Comments

For n>0, a(n) <= 2*n-1, because n*(n+1)/2 + (2*n-1)*2*n = (9*n^2 - 3*n)/2 = 3*n*(3*n-1)/2 = triangular(3*n-1).
The subsequence with terms less than 2*n-1 begins: 2, 5, 3, 6, 9, 4, 9, 8, 10, 14, 9, 5, 21, 18, 21, 14, 22, 6, 11, 13, 15, ...
The sequence of n's such that a(n) < 2*n-1 begins: 5, 8, 11, 12, 15, 19, 20, 22, 25, 26, ...

Crossrefs

Cf. A101157 (least k>0 such that triangular(n) + k^2 is a triangular number).

Programs

  • Maple
    a:= proc(n) option remember; local w, k; w:= n*(n+1)/2;
          for k while not issqr(8*(w+k*(k+1))+1) do od; k
        end:
    seq(a(n), n=0..69);  # Alois P. Heinz, Nov 13 2024
  • Mathematica
    lktrno[n_]:=Module[{t=(n(n+1))/2,k=1},While[!IntegerQ[(Sqrt[ 8(t+k(k+1))+1]-1)/2],k++];k]; Array[lktrno,70,0] (* Harvey P. Dale, Aug 19 2014 *)
  • PARI
    a(n)=for(k=1,2*n,t=n*(n+1)/2+k*(k+1);x=sqrtint(2*t);if(t==x*(x+1)/2,return(k))) /* from Ralf Stephan */
  • Python
    def isTriangular(a):
        sr = 1 << (a.bit_length() >> 1)
        a += a
        while a < sr*(sr+1):  sr>>=1
        b = sr>>1
        while b:
          s = sr+b
          if a >= s*(s+1):  sr = s
          b>>=1
        return (a==sr*(sr+1))
    n = tn = 0
    while 1:
      for m in range(1, 1000000000):
        if isTriangular(tn + m*(m+1)): break
      print(m, end=', ')
      n += 1
      tn += n
    

A293620 Numbers k such that f(k), f(k+1) and f(k+2) are all primes, where f(k) = (2k+1)^2 - 2 (A073577).

Original entry on oeis.org

1, 2, 16, 58, 149, 177, 534, 681, 954, 1045, 1052, 1255, 1367, 1563, 2046, 2074, 2515, 2557, 2564, 2788, 3586, 3593, 3908, 4062, 4552, 5252, 5371, 5385, 6400, 6729, 7443, 7478, 9305, 9375, 9942, 10355, 10411, 10726, 10740, 11286, 11545, 11559, 11832, 11965
Offset: 1

Views

Author

Amiram Eldar, Oct 13 2017

Keywords

Comments

Sierpiński proved that under Schinzel's hypothesis H this sequence is infinite.
Sierpiński showed that the only quadruple of consecutive primes of the form (2k+1)^2 - 2 are for k = 1 (i.e., 1 and 2 are the only consecutive terms in this sequence).
Numbers k such that the 3 consecutive integers k, k+1 and k+2 belong to A088572. - Michel Marcus, Oct 13 2017

Examples

			The first triples are: k = 1: (7, 23, 47), k = 2: (23, 47, 79), k = 16: (1087, 1223, 1367).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^4], AllTrue[{(2#+1)^2-2, (2#+3)^2-2, (2#+5)^2-2},PrimeQ] &]
    SequencePosition[Table[If[PrimeQ[(2k+1)^2-2],1,0],{k,12000}],{1,1,1}][[;;,1]] (* Harvey P. Dale, Feb 09 2025 *)
  • PARI
    f(n) = 4*n^2 + 4*n - 1;
    isok(n) = isprime(f(n)) && isprime(f(n+1)) && isprime(f(n+2)); \\ Michel Marcus, Oct 13 2017

A323741 a(n) = m-p where m = (2n+1)^2 and p is the largest prime < m.

Original entry on oeis.org

2, 2, 2, 2, 8, 2, 2, 6, 2, 2, 6, 6, 2, 2, 8, 2, 2, 2, 10, 12, 2, 8, 2, 2, 8, 6, 2, 20, 12, 2, 2, 6, 6, 2, 2, 6, 2, 2, 12, 8, 6, 6, 8, 2, 8, 2, 12, 6, 10, 8, 2, 22, 2, 14, 20, 6, 6, 2, 2, 2, 8, 6, 2, 8, 2, 6, 2, 12, 2, 14, 6, 2, 8, 8, 14, 10, 2, 18, 20, 2, 8, 14, 6, 2, 10, 2, 32, 2, 12, 12, 2, 8, 6, 44, 2, 6, 14, 6, 20, 14
Offset: 1

Views

Author

Ali Sada, Sep 03 2019

Keywords

Comments

a(n) cannot be a square: suppose a(n) = k^2; then p=m-a(n) could be factored as (2n+k-1)*(2n-k-1); hence it would not be a prime.
Legendre's conjecture implies a(n) <= 4*n. Oppermann's conjecture implies a(n) <= 2*n. - Robert Israel, Sep 04 2019
All terms are even. - Alois P. Heinz, Sep 04 2019

Examples

			When n=4, m=81, p=79, so a(4) = 81-79 = 2.
		

Crossrefs

Programs

  • Maple
    seq((2*n+1)^2-prevprime((2*n+1)^2),n=1..100); # Robert Israel, Sep 04 2019
  • Mathematica
    mp[n_]:=Module[{m=(2n+1)^2},m-NextPrime[m,-1]]; Array[mp, 100] (* Harvey P. Dale, Feb 03 2022 *)
  • PARI
    a(n) = (2*n+1)^2 - precprime((2*n+1)^2 - 1); \\ Michel Marcus, Sep 05 2019

Formula

a(n) = A049711(A016754(n)).

A334294 Numbers k such that 70*k^2 + 70*k - 1 is prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 17, 20, 22, 23, 24, 26, 27, 29, 30, 31, 33, 34, 36, 37, 39, 40, 41, 43, 44, 45, 46, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 70, 71, 74, 76, 77, 78, 79, 80, 81, 82, 87, 88, 90, 93, 96, 97, 100
Offset: 1

Views

Author

James R. Buddenhagen, Apr 21 2020

Keywords

Comments

Among quadratic polynomials in k of the form a*k^2 + a*k - 1 the value a=70 gives the most primes for any a in the range 1<=a<=300, at least up to k=40000. Here a and k are positive integers. Other "good" values of a are a=250, a=99, and a=19.

Examples

			For k=1, 70*k^2 + 70*k - 1 = 70*1^2 + 70*1 - 1 = 139, which is prime, so 1 is in the sequence.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if isprime(70*n^2+70*n-1) then n else NULL end if end proc;
    seq(a(n),n=1..100);
  • Mathematica
    Select[Range@ 100, PrimeQ[70 #^2 + 70 # - 1] &] (* Michael De Vlieger, May 26 2020 *)
Showing 1-5 of 5 results.