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 31-40 of 64 results. Next

A081759 Numbers n such that 5n+6 is prime.

Original entry on oeis.org

1, 5, 7, 11, 13, 19, 25, 29, 35, 37, 41, 47, 49, 53, 55, 61, 65, 79, 83, 85, 91, 97, 103, 107, 113, 119, 125, 127, 131, 137, 139, 149, 151, 161, 163, 175, 181, 187, 193, 197, 203, 205, 209, 211, 217, 229, 233, 235, 239, 245, 257, 259, 263, 271, 275, 289
Offset: 1

Views

Author

Giovanni Teofilatto, Nov 21 2003

Keywords

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

Programs

  • Magma
    [n: n in [0..300]| IsPrime(5*n + 6)]; // Vincenzo Librandi, Oct 16 2012
    
  • Maple
    A081759 := proc(n) option remember: local k: if(n=1)then return 1: fi: for k from procname(n-1)+1 do if(isprime(5*k+6))then return k: fi: od: end: seq(A081759(n),n=1..100); # Nathaniel Johnston, May 28 2011
  • Mathematica
    Select[Range[300], PrimeQ[5# + 6] &] (* Ray Chandler, Dec 06 2006 *)
  • PARI
    is(n)=isprime(5*n+6) \\ Charles R Greathouse IV, Feb 17 2017

Formula

a(n) = 2*A024912(n) - 1.

Extensions

Corrected by Ray Chandler, Nov 22 2003

A082749 Difference between the sum of next prime(n) natural numbers and the sum of next n primes.

Original entry on oeis.org

1, 4, 9, 10, 54, 71, 191, 236, 446, 1025, 1310, 2259, 3245, 3820, 5048, 7321, 10060, 11473, 15328, 18358, 20381, 25672, 30222, 36561, 46367, 53031, 58108, 65444, 70971, 78391, 104184, 116542, 133095, 142728, 169931, 181324, 203429, 226622
Offset: 1

Views

Author

Amarnath Murthy, Apr 17 2003

Keywords

Comments

Group the natural numbers with prime(n) elements in each group. (1,2),(3,4,5),(6,7,8,9,10),(11,12,13,14,15,16,17),... The sum corresponding the groups is 3,12,40,98,... Group the prime numbers such that the n-th group contains n primes. (2),(3,5),(7,11,13),(17,19,23,29),... The sum corresponding the groups is 2,8,31,88,... The required difference is 1,4,9,10,...
The following sequences (allowing offset of first term) all appear to have the same parity: A034953, triangular numbers with prime indices; A054269, length of period of continued fraction for sqrt(p), p prime; A082749, difference between the sum of next prime(n) natural numbers and the sum of next n primes; A006254, numbers n such that 2n-1 is prime; A067076, 2n+3 is a prime. - Jeremy Gardiner, Sep 10 2004

Programs

  • Mathematica
    Module[{nn=80,trms=40,c,nat,pr},c=(nn(nn+1))/2;nat=Total/@TakeList[Range[c],Prime[Range[trms]]];pr=Total/@TakeList[Prime[Range[c]], Range[trms]]; Differences/@ Thread[{pr,nat}]]//Flatten (* Harvey P. Dale, Apr 13 2025 *)

Formula

a(n) = ((A061802(n-1) + 1)*A000040(n))/2 - A007468(n). - Gionata Neri, May 17 2015

Extensions

More terms from Ray Chandler, May 13 2003

A139606 a(n) = 15*n + 6.

Original entry on oeis.org

6, 21, 36, 51, 66, 81, 96, 111, 126, 141, 156, 171, 186, 201, 216, 231, 246, 261, 276, 291, 306, 321, 336, 351, 366, 381, 396, 411, 426, 441, 456, 471, 486, 501, 516, 531, 546, 561, 576, 591, 606, 621, 636, 651, 666, 681, 696, 711, 726, 741, 756, 771, 786
Offset: 0

Views

Author

Omar E. Pol, Apr 27 2008

Keywords

Comments

Numbers of the 6th column of positive numbers in the square array of nonnegative and polygonal numbers A139600.
6th transversal numbers (or 6-transversal numbers): (A000217(6)-6)*n + 6.

References

  • A. H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 189. - From N. J. A. Sloane, Dec 01 2012

Crossrefs

Programs

Formula

a(n) = A057145(n+2,6).
G.f.: 3*(2+3*x)/(x-1)^2 . - R. J. Mathar, Jul 28 2016
From Elmo R. Oliveira, Apr 12 2024: (Start)
E.g.f.: 3*exp(x)*(2 + 5*x).
a(n) = 3*A016873(n) = A008597(n) + 6.
a(n) = 2*a(n-1) - a(n-2) for n >= 2. (End)

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

A087915 Even numbers k such that 2*k+3 is a prime.

Original entry on oeis.org

0, 2, 4, 8, 10, 14, 20, 22, 28, 32, 34, 38, 40, 50, 52, 62, 64, 68, 74, 80, 82, 88, 94, 98, 104, 110, 112, 118, 124, 130, 134, 140, 152, 154, 164, 172, 178, 182, 188, 190, 208, 214, 218, 220, 230, 232, 238, 242, 244, 248, 250, 260, 272, 280, 284, 292, 298, 302
Offset: 1

Views

Author

Giovanni Teofilatto, Oct 18 2003

Keywords

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

A subset of A067076.
Cf. A002145.
a(n) = A089193(n)-5.

Programs

  • Mathematica
    Select[Range[0,350,2],PrimeQ[2#+3]&] (* Harvey P. Dale, Jan 12 2012 *)

Extensions

More terms from Ray Chandler, Oct 19 2003
Offset corrected by Arkadiusz Wesolowski, Aug 09 2011

A078444 Floor of geometric mean of two consecutive primes.

Original entry on oeis.org

2, 3, 5, 8, 11, 14, 17, 20, 25, 29, 33, 38, 41, 44, 49, 55, 59, 63, 68, 71, 75, 80, 85, 92, 98, 101, 104, 107, 110, 119, 128, 133, 137, 143, 149, 153, 159, 164, 169, 175, 179, 185, 191, 194, 197, 204, 216, 224, 227, 230, 235, 239, 245, 253, 259, 265, 269, 273, 278
Offset: 1

Views

Author

Lior Manor, Dec 31 2002

Keywords

Comments

For n > 1, a(n) = prime(n) iff prime(n) and prime(n+1) are twin primes.

Examples

			a(7) = floor(sqrt(prime(7)*prime(8))) = 17.
		

Crossrefs

Programs

  • Magma
    [Floor(Sqrt(NthPrime(n)*NthPrime(n+1))): n in [1..60]]; // Vincenzo Librandi, Dec 12 2015
    
  • Maple
    seq(floor(sqrt(ithprime(i)*ithprime(i+1))), i=1..100); # Robert Israel, Dec 12 2015
  • Mathematica
    Table[Floor[Sqrt[Prime[n] Prime[n + 1]]], {n, 60}] (* Vincenzo Librandi, Dec 12 2015 *)
    Table[Ceiling[(Prime[n] + Prime[n + 1])/2 - 1], {n, 100}] (* Miko Labalan, Dec 14 2015 *)
  • PARI
    a(n) = sqrtint(prime(n)*prime(n+1)); \\ Michel Marcus, Dec 12 2015

Formula

a(n) = floor(sqrt(prime(n)*prime(n+1))).
From Miko Labalan, Dec 12 2015: (Start)
a(n) = A006254(A028310(n - 1)) + A067076(n);
a(n) = A067076(A028310(n - 1)) + A006254(n);
a(n) = A005097(A028310(n - 1)) + A005097(n).
(End)
For n >= 2 these formulas are equivalent to sqrt(prime(n)*prime(n+1)) > (prime(n)+prime(n+1))/2 - 1, and thus to A001223(n) <= 2 + 2*sqrt(2*prime(n)). This would be implied by Andrica's conjecture, but is as yet unproven. - Robert Israel, Dec 13 2015

A337767 Array T(n,k) (n >= 1, k >= 1) read by upward antidiagonals and defined as follows. Let N(p,i) denote the result of applying "nextprime" i times to p; T(n,k) = smallest prime p such that N(p,n) - p = 2*k, or 0 if no such prime exists.

Original entry on oeis.org

3, 0, 7, 0, 3, 23, 0, 0, 5, 89, 0, 0, 0, 23, 139, 0, 0, 0, 3, 19, 199, 0, 0, 0, 0, 7, 47, 113, 0, 0, 0, 0, 3, 17, 83, 1831, 0, 0, 0, 0, 0, 5, 23, 211, 523, 0, 0, 0, 0, 0, 0, 17, 43, 109, 887, 0, 0, 0, 0, 0, 0, 3, 13, 79, 317, 1129, 0, 0, 0, 0, 0, 0, 0, 7, 19, 107, 619, 1669
Offset: 1

Views

Author

Robert G. Wilson v, Sep 19 2020

Keywords

Comments

The positive entries in each row and column are distinct.
Number of zeros right of 3 are 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 1, 3, 3, 3, 6, 5, 5, 4, 6, ..., .
Number of zeros in the n-th row are 0, 1, 3, 4, 6, 7, 10, 13, 14, 17, 18, 20, 22, 25, 28, 30, 32, 36, 37, 40, 45, 47, 51, 52, 55, ..., .
The usual convention in the OEIS is to use -1 in the "escape clause" - that is, when "no such terms exists". It is probably too late to change this sequence, but it should not be cited as a role model for other sequences. - N. J. A. Sloane, Jan 19 2021
a(1416), a(1637), and a(1753) were provided by Brian Kehrig. - Martin Raab, Jun 28 2024

Examples

			The initial rows of the array are:
  3, 7, 23, 89, 139, 199, 113, 1831, 523, 887, 1129, 1669, 2477, 2971, 4297, ...
  0, 3, 5, 23, 19, 47, 83, 211, 109, 317, 619,  199, 1373, 1123, 1627, 4751, ...
  0, 0, 0,  3,  7, 17, 23,  43,  79, 107, 109,  113,  197,  199,  317,  509, ...
  0, 0, 0,  0,  3,  5, 17,  13,  19,  47,  79,   73,  113,  109,  193,  317, ...
  0, 0, 0,  0,  0,  0,  3,   7,  11,  17,  19,   43,   71,   73,  107,  191, ...
  0, 0, 0,  0,  0,  0,  0,   3,   5,  11,   7,   13,   41,   31,   67,  107, ...
  0, 0, 0,  0,  0,  0,  0,   0,   0,   3,   0,    5,   11,   13,   23,   47, ...
  0, 0, 0,  0,  0,  0,  0,   0,   0,   0,   0,    0,    3,    0,    7,   29, ...
  0, 0, 0,  0,  0,  0,  0,   0,   0,   0,   0,    0,    0,    3,    0,    5, ...
The initial antidiagonals are:
  [3]
  [0, 7]
  [0, 3, 23]
  [0, 0, 5, 89]
  [0, 0, 0, 23, 139]
  [0, 0, 0, 3, 19, 199]
  [0, 0, 0, 0, 7, 47, 113]
  [0, 0, 0, 0, 3, 17, 83, 1831]
  [0, 0, 0, 0, 0, 5, 23, 211, 523]
  [0, 0, 0, 0, 0, 0, 17, 43, 109, 887]
  [0, 0, 0, 0, 0, 0, 3, 13, 79, 317, 1129]
  ...
		

Crossrefs

Cf. A000230, A144103, A339943, A339944 (rows 1 to 4), A086153.

Programs

  • Mathematica
    t[r_, c_] := If[ 2c <= Prime[r + 2] - 5, 0, Block[{p = 3}, While[ NextPrime[p, r] != 2c + p && p < 52000000, p = NextPrime@ p]; If[p > 52000000, 0, p]]]; Table[ t[r -c +1, c], {r, 11}, {c, r}] // Flatten

Formula

T(n,k) = 0 if prime(n+2)-5 <= 2k. A089038.
T(n,k) = 3 if prime(n+2) = 2k+6. A067076.

Extensions

Entry revised by N. J. A. Sloane, Nov 07 2020
Deleted a-file and b-file because entries were unreliable. - N. J. A. Sloane, Nov 01 2021

A008507 Number of odd composite numbers less than n-th odd prime.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 3, 5, 5, 7, 8, 8, 9, 11, 13, 13, 15, 16, 16, 18, 19, 21, 24, 25, 25, 26, 26, 27, 33, 34, 36, 36, 40, 40, 42, 44, 45, 47, 49, 49, 53, 53, 54, 54, 59, 64, 65, 65, 66, 68, 68, 72, 74, 76, 78, 78, 80, 81, 81, 85, 91, 92, 92, 93, 99, 101, 105, 105, 106, 108, 111, 113, 115, 116, 118
Offset: 1

Views

Author

Gary Findley (chfindley(AT)alpha.nlu.edu)

Keywords

Comments

a(n) = A067076(n) - n + 1. - Vincenzo Librandi, Feb 02 2013
For n>=4, a(n) = k+1, where A000217(j) is the smallest triangular number such that A000217(j) - A033286(n+1) also is a triangular number, i.e., A000217(k). Example n=29, a(29) = 27: A033286(30) = 3390, A000217(86) = 3741. 3741-3390 = 351 = A000217(26); k=26, 26+1 = 27. - Bob Selcoe, Apr 12 2016

Crossrefs

Cf. A067076.
Cf. A000040 (prime numbers), A000217 (triangular numbers), A033286 (n*prime(n)).
Partial sums of A100820.

Formula

[(Odd Primes - 1)/2] - n for n > 0, or A005097(n) - A000027(n). For example, A005097(1) - A000027(1) = 1 - 1 = 0, A005097(2) - A000027(2) = 2 - 2 = 0, A005097(9) - A000027(9) = 14 - 9 = 5. - William A. Tedeschi, Apr 25 2008

Extensions

More terms from David W. Wilson, Jan 13 2000

A098033 Parity of p*(p+1)/2 for n-th prime p.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 1

Views

Author

Jeremy Gardiner, Sep 10 2004

Keywords

Comments

The following sequences (possibly with a different offset for first term) all appear to have the same parity: A034953 = triangular numbers with prime indices; A054269 = length of period of continued fraction for sqrt(p), p prime; A082749 = difference between the sum of the next prime(n) natural numbers and the sum of the next n primes; A006254 = numbers n such that 2n-1 is prime; A067076 = numbers n such that 2n+3 is a prime.
Analogous to the prime race (mod 3). - Robert G. Wilson v, Sep 17 2004
See also A089253 = 2n-5 is a prime.
For n > 1, if A000040(n) == 1 (mod 4), then a(n) = 1, otherwise a(n)=0, so (for n>1) also a(n) = number of representations of A000040(n) as a difference of hexagonal numbers (A000384) (cf. [Nyblom, p. 262]). - L. Edson Jeffery, Feb 16 2013

Examples

			a(1) = parity of (2*(2+1)/2 = 3) = 1 (odd).
		

Crossrefs

Programs

Formula

a(n) = parity of p*(p+1)/2 for n-th prime p.
a(n) = 1 - A100672(n), n > 1. - Steven G. Johnson (stevenj(AT)math.mit.edu), Sep 18 2008
For n > 1, a(n) = (prime(n) mod 4) mod 3. - Gary Detlefs, Oct 27 2011

Extensions

More terms from Robert G. Wilson v, Sep 17 2004
Previous Showing 31-40 of 64 results. Next