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

A040040 Average of twin prime pairs (A014574), divided by 2. Equivalently, 2*a(n)-1 and 2*a(n)+1 are primes.

Original entry on oeis.org

2, 3, 6, 9, 15, 21, 30, 36, 51, 54, 69, 75, 90, 96, 99, 114, 120, 135, 141, 156, 174, 210, 216, 231, 261, 285, 300, 309, 321, 330, 405, 411, 414, 429, 441, 510, 516, 525, 531, 546, 576, 615, 639, 645, 651, 660, 714, 726, 741, 744, 804, 810, 834, 849, 861, 894
Offset: 1

Views

Author

Keywords

Comments

Intersection of A005097 and A006254. - Zak Seidov, Mar 18 2005
The only possible pairs for 2a(n)+-1 are prime/prime (this sequence), not prime/not prime (A104278), prime/notprime (A104279) and not prime/prime (A104280), ... this sequence + A104280 + A104279 + A104278 = the odd numbers.
These numbers are never k mod (2k+1) or (k+1) mod (2k+1) with 2k+1 < a(n). - Jon Perry, Sep 04 2012
Excluding the first term, all remaining terms have digital root 3, 6 or 9. - J. W. Helkenberg, Jul 24 2013
Positive numbers x such that the difference between x^2 and adjacent squares are prime (both x^2-(x-1)^2 and (x+1)^2-x^2 are prime). - Doug Bell, Aug 21 2015

Crossrefs

Cf. A001359, A006512, A014574, A054735, A111046, A045753 (even terms halved), A002822 (terms divided by 3).
Cf. A221310.

Programs

  • Haskell
    a040040 = flip div 2 . a014574  -- Reinhard Zumkeller, Nov 17 2015
  • Maple
    P := select(isprime,[$1..1789]): map(p->(p+1)/2, select(p->member(p+2,P),P)); # Peter Luschny, Mar 03 2011
  • Mathematica
    Select[Range[900], And @@ PrimeQ[{-1, 1} + 2# ] &] (* Ray Chandler, Oct 12 2005 *)
  • PARI
    p=2; forprime(b=3, 1e4, if(b-p==2, print1((p+1)/2", ")); p=b) \\ Altug Alkan, Nov 10 2015
    

Formula

a(n) = A014574(n)/2 = A054735(n+1)/4 = A111046(n+1)/8.
For n > 1, a(n) = 3*A002822(n-1). - Jason Kimberley, Nov 06 2015
A260689(a(n),1) = A264526(a(n)) = 1. - Reinhard Zumkeller, Nov 17 2015
From Michael G. Kaarhus, Aug 19 2022: (Start)
a(n) = (A001359(n) + 1)/2.
a(n) = (A006512(n) - 1)/2.
For n > 1, a(n) = A167379(n-1) * 3/2. (End)

Extensions

More terms from Cino Hilliard, Oct 21 2002
Title corrected by Daniel Forgues, Jun 01 2009
Edited by Daniel Forgues, Jun 21 2009
Comment corrected by Daniel Forgues, Jul 12 2009

A099047 Numbers n such that n-1 and n+1 are both composite.

Original entry on oeis.org

5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 26, 27, 29, 31, 33, 34, 35, 37, 39, 41, 43, 45, 47, 49, 50, 51, 53, 55, 56, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 76, 77, 79, 81, 83, 85, 86, 87, 89, 91, 92, 93, 94, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 116, 117
Offset: 1

Views

Author

Rick L. Shepherd, Nov 13 2004

Keywords

Crossrefs

Programs

A309120 a(n) is the least k > 1 such that n*k is adjacent to a prime.

Original entry on oeis.org

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

Views

Author

Robert Israel, Jul 17 2019

Keywords

Comments

If n is odd then a(n) is even.
a(n) exists by Dirichlet's theorem on primes in arithmetic progressions.

Examples

			a(13)=4 because 4*13+1=53 is prime but none of 2*13-1,2*13+1,3*13-1,3*13+1 are primes.
		

Crossrefs

Programs

  • Maple
    f:= proc(m) local k;
      for k from 2 by 1+(m mod 2) do
        if isprime(k*m-1) or isprime(k*m+1) then return k fi
      od
    end proc:
    map(f, [$1..100]);
  • Mathematica
    a[n_]:=Module[{k=2},While[Not[PrimeQ[k*n-1]||PrimeQ[k*n+1]],k++];k];
    a/@Range[94] (* Ivan N. Ianakiev, Jul 18 2019 *)
  • PARI
    a(n) = my(k=2); while (!isprime(n*k+1) && !isprime(n*k-1), k++); k; \\ Michel Marcus, Jul 19 2019

Formula

a(A104278(n)) > 2 and a(A147820(n)) = 2. - Ivan N. Ianakiev, Jul 18 2019

A130699 Numbers n for which neither 2n-3 nor 2n+3 are primes.

Original entry on oeis.org

6, 9, 12, 15, 18, 21, 24, 26, 27, 30, 33, 36, 39, 42, 44, 45, 48, 51, 54, 57, 59, 60, 61, 63, 66, 69, 72, 75, 78, 79, 81, 84, 86, 87, 90, 93, 96, 99, 102, 103, 105, 106, 108, 109, 111, 114, 117, 120, 123, 125, 126, 128, 129, 131, 132, 135, 138, 141, 144, 146
Offset: 2

Views

Author

W. Neville Holmes, Jul 11 2007

Keywords

Examples

			Not 5 because 7 and 13 are prime, but 6 because neither 9 nor 15 are primes.
		

Crossrefs

Cf. A104278.

Programs

  • Mathematica
    Select[Range[200],NoneTrue[2#+{3,-3},PrimeQ]&] (* The program uses the NoneTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 12 2014 *)
  • PARI
    isok(n) = !isprime(2*n-3) && !isprime(2*n+3) \\ Michel Marcus, Jul 11 2013

Extensions

Missing term 24 added by Michel Marcus, Jul 11 2013

A296304 Numbers whose absolute difference from a square is never a prime.

Original entry on oeis.org

0, 169, 289, 625, 784, 1024, 1444, 1849, 2116, 2209, 3364, 3481, 3600, 3721, 3844, 4489, 5041, 5184, 5329, 5929, 6400, 7225, 7744, 8464, 8649, 8836, 10201, 10404, 10609, 10816, 11449, 11664, 11881, 12100, 13924, 14884, 15129, 15376, 16129, 16900, 17689, 18769
Offset: 1

Views

Author

Jon E. Schoenfield, Dec 10 2017

Keywords

Comments

0 and the squares of numbers k such that 2k+1 and 2k-1 are not primes; i.e., 0 and the squares of the terms of A104278.

Examples

			The absolute difference between any square j^2 and 169 is |j^2 - 169| = |(j-13)*(j+13)| = |j-13|*|j+13|, which cannot be a prime unless one of the two factors |j-13| and |j+13| is 1, i.e., j is -14, -12, 12, or 14; however, in each case, the other factor is nonprime (-27, -25, 25, or 27, respectively), so |j^2 - 169| is not a prime for any integer j. Thus, 169 is in the sequence.
49 - 6^2 = 49 - 36 = 13 (a prime), so 49 is not in the sequence.
		

Crossrefs

Cf. A104278.
Cf. A292990 (Numbers whose absolute difference from a triangular number is never a prime).

Programs

  • GAP
    o := [];; for n in [1..10^4] do if not IsPrime(2*n-1) and not IsPrime(2*n+1) then Add(o,n^2); fi; od;
    sequence := Concatenation([0],o); # Muniru A Asiru, Jan 01 2018
  • Mathematica
    Join[{0}, Select[Range[200], CompositeQ[2# + 1] && CompositeQ[2# - 1]&]^2] (* Jean-François Alcover, Dec 21 2017 *)

Formula

a(1) = 0; for n > 1, A104278(n-1)^2.

A172462 Numbers k such that 2k-3, 2k-1, 2k+1 and 2k+3 are composite.

Original entry on oeis.org

59, 60, 61, 72, 93, 102, 103, 108, 109, 123, 144, 149, 150, 151, 161, 162, 163, 171, 207, 213, 236, 237, 257, 258, 264, 265, 266, 267, 268, 276, 291, 312, 313, 318, 333, 334, 348, 357, 389, 390, 391, 396, 401, 402, 408, 417, 422, 423, 424, 434, 435, 436, 446
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 03 2010

Keywords

Comments

Almost all numbers are in this sequence, by the Prime Number Theorem.

Examples

			a(1)=59 because 2*59-1=117, 2*59+1=119, 2*59-3=115 and 2*59+3=121 are all composite.
		

Crossrefs

Cf. A104278.

Programs

  • Maple
    a := proc (n): if isprime(2*n-3) = false and isprime(2*n-1) = false and isprime(2*n+1) = false and isprime(2*n+3) = false then n else end if end proc: seq(a(n), n = 1 .. 500); # Emeric Deutsch, Feb 15 2010

Extensions

Corrected and extended by Emeric Deutsch, Feb 15 2010
Comment from Charles R Greathouse IV, Mar 25 2010
Showing 1-6 of 6 results.