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

A085090 If 2n-1 is prime then a(n) = 2n-1, otherwise a(n) = 0.

Original entry on oeis.org

0, 3, 5, 7, 0, 11, 13, 0, 17, 19, 0, 23, 0, 0, 29, 31, 0, 0, 37, 0, 41, 43, 0, 47, 0, 0, 53, 0, 0, 59, 61, 0, 0, 67, 0, 71, 73, 0, 0, 79, 0, 83, 0, 0, 89, 0, 0, 0, 97, 0, 101, 103, 0, 107, 109, 0, 113, 0, 0, 0, 0, 0, 0, 127, 0, 131, 0, 0, 137, 139, 0, 0, 0, 0, 149, 151, 0, 0, 157, 0, 0, 163
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jul 02 2003

Keywords

Comments

Previous name was: Starting with n+(n-1) go on adding n-2, then n-3, etc. until one gets a prime; a(n) = smallest prime in n+(n-1)+(n-2)+...+(n-i) (with the least i that gives a prime), or 0 if no such prime exists.

Examples

			a(8) = 0 as there is no prime in the partial sum of the finite sequence 8,7,6,5,4,3,2,1.
a(7) = 13 = 7 + 6.
		

Crossrefs

Cf. A122845.

Programs

  • Magma
    DoubleFactorial:=func< n | &*[n..2 by -2] >; [ DoubleFactorial(-5 + 4*n) mod (-1 + 2*n)^2: n in [1..90]]; // Vincenzo Librandi, Oct 04 2018
    
  • Magma
    [IsPrime(2*n-1) select 2*n-1 else 0: n in [1..90]]; // Bruno Berselli, Oct 05 2018
  • Mathematica
    apr[n_]:=Module[{cl=Select[Rest[Accumulate[Range[n,1,-1]]],PrimeQ, 1]}, If[cl=={},0,First[cl]]]; Array[apr,100] (* Harvey P. Dale, Jun 01 2012 *)
    b[n_] := Mod[(-5 + 4 n)!!, (-1 + 2 n)^2]; a = Array[b, 82] (* Fred Daniel Kline, Oct 04 2018; Thomas Ordowski's formula with adjusted index *)
  • PARI
    a(n) = if (isprime(p=2*n-1), p, 0); \\ Michel Marcus, Aug 09 2018
    

Formula

If 2n-1 is prime then a(n) = 2n-1, otherwise a(n) = 0. - David Wasserman, Jan 25 2005
a(A098090(n)-1)=2*A098090(n)-3; a(n)=(2*n-1)*A101264(n-1). - Reinhard Zumkeller, Sep 14 2006
a(n+1) = (4n-1)!! mod (2n+1)^2; by Gauss generalization of the Wilson's theorem. - Thomas Ordowski, Jul 23 2016

Extensions

More terms from David Wasserman, Jan 25 2005
New name using formula from David Wasserman, Joerg Arndt, Jul 24 2016

A288313 Let b(k) denote A056240(k); the sequence lists numbers b(2*n) where for all m > n, b(2*m) > b(2*n).

Original entry on oeis.org

2, 4, 8, 15, 21, 33, 39, 51, 57, 69, 87, 93, 111, 123, 129, 141, 159, 177, 183, 201, 213, 219, 237, 249, 267, 291, 303, 309, 321, 327, 339, 381, 393, 411, 417, 447, 453, 471, 489, 501, 519, 537, 543, 573, 579, 591, 597, 633, 669, 681, 687, 699, 717, 723, 753, 771, 789, 807, 813, 831, 843
Offset: 1

Views

Author

David James Sycamore, Jun 07 2017

Keywords

Comments

This is an ascending subsequence of A056240 with even argument terms.
After the first three (even) terms, a(1) = b(2) = 2, a(2) = b(4) = 4, a(3) = b(6) = 8 respectively, all subsequent terms are odd (semiprime) numbers of the form 3*r, for r = primes 5, 7, 11, 13, .... The graph of all odd-valued terms a(n) for n >= 4 is a straight line (y = 3*x - 9), corresponding to b(2*n) = 3*(2*n) - 9 = 3*(2*n - 3) = 3*r, where r = 2*n - 3 is prime, and n is in sequence A098090. The sequence a(n) for n >= 4 is identical term for term to A001748(n) for n >= 3. In other words, for n >= 4, a(n) = 3*A000040(n-1).
If, for any even number n >= 6, n - 3 is prime, then A056240(n) belongs to this sequence.

Examples

			a(1) = 2 is included because for all n > 1, b(2n) > 2; likewise a(2) = b(4) = 4, and a(3) = b(6) = 8 are included. The first odd term, a(4) = b(8) = 15, is included since for all n > 4, b(2n) > 15. b(12) = 35 is not in this sequence because b(14) = 33 < 35, and only ascending terms are permitted.
		

Crossrefs

Cf. A000040, A001748, A056240, A098090. Essentially the same as A063534.

Programs

  • Mathematica
    Join[{2, 4, 8}, 3*Prime[Range[3, 100]]] (* Paolo Xausa, Apr 16 2024 *)

Formula

a(1) = 2, a(2) = 4, a(3) = 8, and for n >= 4, a(n) = 3*A000040(n-1).

Extensions

Offset changed to 1 and entry edited to reflect this change by Michel Marcus, Jul 03 2017

A065305 Triangular array giving means of two odd primes: T(n,k) = (n-th prime + k-th prime)/2, n >= k >= 2.

Original entry on oeis.org

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

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Oct 29 2001

Keywords

Examples

			3; 4,5; 5,6,7; 7,8,9,11; ...
		

Crossrefs

Cf. A065306.
a(n, k) = A065342(n, k)/2 [but note different offsets]
Cf. A098090 (left edge), A065091 (right edge), A000040.

Programs

  • Haskell
    import Data.List (inits)
    a065305 n k = a065305_tabl !! (n-2) !! (k - 1)
    a065305_row n = a065305_tabl !! (n-2)
    a065305_tabl = zipWith (map . (flip div 2 .) . (+))
                           a065091_list $ tail $ inits a065091_list
    -- Reinhard Zumkeller, Aug 02 2015, Jan 30 2012
  • Maple
    seq(seq((ithprime(i)+ithprime(j))/2,j=2..i),i=2..20)

A153043 Numbers n > 1 such that 2*n-3 is not a prime.

Original entry on oeis.org

2, 6, 9, 12, 14, 15, 18, 19, 21, 24, 26, 27, 29, 30, 33, 34, 36, 39, 40, 42, 44, 45, 47, 48, 49, 51, 54, 57, 59, 60, 61, 62, 63, 64, 66, 68, 69, 72, 73, 74, 75, 78, 79, 81, 82, 84, 86, 87, 89, 90, 93, 94, 95, 96, 99, 102, 103, 104, 105, 106, 108, 109, 110
Offset: 1

Views

Author

Vincenzo Librandi, Dec 17 2008

Keywords

Comments

One more than the associated value in A104275. - R. J. Mathar, Jan 05 2011
2*A155705(m,n)-3 = (2n+1)*(2m+1) are nonprime: all A155705(.,.) are in this sequence.
The terms after a(1) are the values of 2*h*k + k + h + 2, where h and k are positive integers. - Vincenzo Librandi, Jan 19 2013

Crossrefs

Programs

A047949 a(n) is the largest m such that n-m and n+m are both primes, or -1 if no such m exists.

Original entry on oeis.org

0, 0, 1, 2, 1, 4, 5, 4, 7, 8, 7, 10, 9, 8, 13, 14, 13, 12, 17, 16, 19, 20, 19, 22, 21, 20, 25, 24, 23, 28, 29, 28, 27, 32, 31, 34, 35, 34, 33, 38, 37, 40, 39, 38, 43, 42, 41, 30, 47, 46, 49, 50, 49, 52, 53, 52, 55, 54, 53, 48, 51, 50, 45, 62, 61, 64, 63, 62, 67, 68, 67, 66
Offset: 2

Views

Author

Keywords

Comments

A067076 is a subsequence of this sequence: when 2m+3 is prime a(m+3) = m. Moreover, it is the subsequence of records (maximal increasing subsequence): let m=a(n), with p=n-m and q=p+2m both odd primes > 3; now 3+2(m+(p-3)/2)=q and hence a(3+m+(p-3)/2) >= m+(p-3)/2 > m = a(n) but 3+m+(p-3)/2 < n. - Jason Kimberley, Aug 30 2012 and Oct 10 2012
Goldbach's conjecture says a(n) >= 0 for all n. - Robert Israel, Apr 15 2015
a(n) is the Goldbach partition of 2n which results in the maximum spread divided by 2. - Robert G. Wilson v, Jun 18 2018

Examples

			49-30=19 and 49+30=79 are primes, so a(49)=30.
		

Crossrefs

Programs

  • Haskell
    a047949 n = if null qs then -1 else head qs  where
       qs = [m | m <- [n, n-1 .. 0], a010051' (n+m) == 1, a010051' (n-m) == 1]
    -- Reinhard Zumkeller, Nov 02 2015
  • Maple
    a:= proc(n)
    local k;
      for k from n - 1 to 0 by -2 do
         if isprime(n+k) and isprime(n-k) then return(k) fi
    od:
    -1
    end proc:
    0, seq(a(n),n=3..1000); # Robert Israel, Apr 16 2015
  • Mathematica
    a[2] = a[3] = 0; a[n_] := (For[m = n - 2, m >= 0, m--, If[PrimeQ[n - m] && PrimeQ[n + m], Break[]]]; m); Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Sep 04 2013 *)
    lm[n_]:=Module[{m=n-2},While[!AllTrue[n+{m,-m},PrimeQ],m--];m]; Join[{0,0}, Array[ lm,70,4]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 03 2014 *)
    f[n_] := Block[{q = 2}, While[q <= n && !PrimeQ[2n -q], q = NextPrime@ q]; n - q]; Array[f, 72, 2] (* Robert G. Wilson v, Jun 18 2018 *)
  • PARI
    a(n) = {if (n==2 || n==3, return (0)); my(m = 1, lastm = -1, do = 1); while (do, if (isprime(n-m) && isprime(n+m), lastm = m); m++; if (m == n - 1, do = 0);); return (lastm);} \\ Michel Marcus, Jun 09 2013
    
  • PARI
    a(n)=if(n<4,0,forprime(p=3,n-1,if(isprime(2*n-p),return(n-p)));-1) \\ Ralf Stephan, Dec 29 2013
    

Formula

a(n) = n - A020481(n).
a(n) = (A020482(n) - A020481(n))/2. - Gionata Neri, Apr 15 2015

Extensions

Corrected by Harvey P. Dale, Dec 21 2000

A182138 Irregular triangle T, read by rows, in which row n lists the distances between n and the two primes whose sum makes 2n in decreasing order (Goldbach conjecture).

Original entry on oeis.org

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

Views

Author

Jean COHEN, Apr 16 2012

Keywords

Comments

The Goldbach conjecture is that for any even integer 2n>=4, at least one pair of primes p and q exist such that p+q=2n. The present numbers listed here are the distances d between each prime and n, the half of the even integer 2n: d=n-p=q-n with p <= q.
See the link section for plots I added. - Jason Kimberley, Oct 04 2012
Each nonzero entry d of row n is coprime to n. For otherwise n+d would be composite. - Jason Kimberley, Oct 10 2012

Examples

			n=2, 2n=4, 4=2+2, p=q=2 -> d=0.
n=18, 2n=36, four prime pairs have a sum of 36: 5+31, 7+29, 13+23, 17+19, with the four distances d being 13=18-5=31-18, 11=18-7=29-18, 5=18-13=23-18, 1=18-17=19-18.
Triangle begins:
  0;
  0;
  1;
  2, 0;
  1;
  4, 0;
  5, 3;
  4, 2;
  7, 3;
  8, 6, 0;
		

Crossrefs

Cf. A045917 (row lengths), A047949 (first column), A047160 (last elements of rows).
Cf. A184995.

Programs

Formula

T(n,i) = n - A184995(n,i). - Jason Kimberley, Sep 25 2012

A073273 a(n) = floor(sqrt(prime(n)*prime(n+2))).

Original entry on oeis.org

3, 4, 7, 9, 13, 15, 19, 23, 26, 32, 35, 39, 43, 47, 52, 56, 62, 65, 69, 74, 77, 83, 89, 94, 99, 103, 105, 109, 117, 121, 131, 134, 142, 144, 152, 156, 161, 167, 172, 176, 184, 186, 193, 195, 203, 210, 218, 225, 229, 233, 236, 244, 248, 256, 262, 266, 272, 275
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 22 2002

Keywords

Comments

A000040(n) < a(n) < A000040(n+2).

Examples

			prime(10)*prime(12) = 29*37 = 1073 = 32*32+49, therefore a(10)=32; A073274(10) = prime(11)-a(10) = 31-32 = -1.
		

Crossrefs

Programs

  • Magma
    [Floor(Sqrt(NthPrime(n)*NthPrime(n+2))): n in [1..60]]; // Vincenzo Librandi, Dec 12 2015
    
  • Mathematica
    Table[Floor[Sqrt[Prime[n] Prime[n + 2]]], {n, 60}] (* Vincenzo Librandi, Dec 12 2015 *)
  • PARI
    a(n) = sqrtint(prime(n)*prime(n+2)); \\ Michel Marcus, Dec 12 2015

Formula

a(n) = A098090(A028310(n - 1)) + A089038(n). - Miko Labalan, Dec 12 2015

A255707 Least number k > 0 such that (2*n-1)^k - 2 is prime, or 0 if no such number exists.

Original entry on oeis.org

0, 2, 1, 1, 1, 4, 1, 1, 6, 1, 1, 24, 1, 2, 2, 1, 1, 2, 2, 1, 4, 1, 1, 2, 1, 8, 4, 1, 12, 4, 1, 1, 8, 3, 1, 2, 1, 1, 2, 38, 1, 4, 1, 4, 2, 1, 2, 4, 747, 1, 4, 1, 1, 2, 1, 1, 10, 1, 2, 2, 2, 6, 42, 2, 1, 2, 1, 2, 10, 1, 1, 4, 2, 16, 50, 1, 1, 2, 22, 1, 2, 38
Offset: 1

Views

Author

Robert Price, Mar 02 2015

Keywords

Crossrefs

Programs

  • Mathematica
    lst = {0}; For[n = 2, n ≤ 143, n++, For[k = 1, k >= 1, k++, If[PrimeQ[(2*n - 1)^k - 2], AppendTo[lst, k]; Break[]]]]; lst
  • PARI
    a(n)=if(n==1,return(0));k=1;while(k,if(ispseudoprime((2*n-1)^k-2),return(k));k++)
    vector(50,n,a(n)) \\ Derek Orr, Mar 03 2015

Formula

a(A098090(n)) = 1. - Michel Marcus, Mar 03 2015

A122845 Triangle read by rows, 3<=k<=n: T(n,k) = smallest prime p such that 2*k-p and 2*n-p are prime, T(n,k) = 0 if no such p exists.

Original entry on oeis.org

3, 3, 3, 3, 3, 3, 0, 5, 5, 5, 3, 3, 3, 7, 3, 3, 3, 3, 5, 3, 3, 0, 5, 5, 5, 7, 5, 5, 3, 3, 3, 7, 3, 3, 7, 3, 3, 3, 3, 5, 3, 3, 5, 3, 3, 0, 5, 5, 5, 7, 5, 5, 7, 5, 5, 3, 3, 3, 7, 3, 3, 7, 3, 3, 7, 3, 0, 5, 5, 5, 11, 5, 5, 17, 5, 5, 23, 5, 0, 0, 7, 7, 7, 11, 7, 7, 11, 7, 7, 11, 7, 3, 3, 3, 0, 3, 3, 13, 3, 3, 13
Offset: 3

Views

Author

Reinhard Zumkeller, Sep 14 2006

Keywords

Crossrefs

Cf. A098090.

Programs

  • Mathematica
    T[n_, k_] := Module[{p}, For[p = 2, p < 2n && p < 2k, p = NextPrime[p], If[PrimeQ[2n - p] && PrimeQ[2k - p], Return[p]]]; 0];
    Table[T[n, k], {n, 3, 16}, {k, 3, n}] // Flatten (* Jean-François Alcover, Sep 22 2021 *)

Formula

T(A098090(n),3) = 2*A098090(n) - A085090(A098090(n)-1) = 3.

A143836 Triangle read by rows: T(r,c) = (prime(r+2) + prime(c+1))/2.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 8, 9, 10, 12, 10, 11, 12, 14, 15, 11, 12, 13, 15, 16, 18, 13, 14, 15, 17, 18, 20, 21, 16, 17, 18, 20, 21, 23, 24, 26, 17, 18, 19, 21, 22, 24, 25, 27, 30, 20, 21, 22, 24, 25, 27, 28, 30, 33, 34, 22, 23, 24, 26, 27, 29, 30, 32, 35, 36, 39, 23, 24, 25, 27, 28, 30, 31, 33, 36, 37, 40, 42
Offset: 1

Views

Author

Pierre CAMI, Sep 02 2008

Keywords

Comments

The number of appearances of m >= 1 in this sequence is A061357(m). Conjecture: Every integer >= 4 appears at least once in this sequence. - Ya-Ping Lu, Mar 05 2023
The number of composites between 3 and (r+2)-th prime missing from Row 1 through Row r in the triangle is A334810(r+2). - Ya-Ping Lu, Mar 24 2023

Examples

			Triangle begins:
   4;
   5,  6;
   7,  8,  9;
   8,  9, 10, 12;
  10, 11, 12, 14, 15;
  ...
		

Crossrefs

Cf. A098090 (1st column, except 1st term), A024675 (right diagonal).

Programs

  • PARI
    T(r,c) = (prime(r+2) + prime(c+1))/2; \\ Michel Marcus, Mar 07 2023

Extensions

Name simplified by Ya-Ping Lu, Mar 05 2023
Previous Showing 21-30 of 33 results. Next