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-10 of 13 results. Next

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

A063983 Least k such that k*2^n +/- 1 are twin primes.

Original entry on oeis.org

4, 2, 1, 9, 12, 6, 3, 9, 57, 30, 15, 99, 165, 90, 45, 24, 12, 6, 3, 69, 132, 66, 33, 486, 243, 324, 162, 81, 90, 45, 345, 681, 585, 375, 267, 426, 213, 429, 288, 144, 72, 36, 18, 9, 147, 810, 405, 354, 177, 1854, 927, 1125, 1197, 666, 333, 519, 1032, 516, 258, 129, 72
Offset: 0

Views

Author

Robert G. Wilson v, Sep 06 2001

Keywords

Comments

Excluding the first three terms, all remaining terms have digital root 3, 6, or 9. - J. W. Helkenberg, Jul 24 2013

Examples

			a(3) = 9 because 9*2^3 = 72 and 71 and 73 are twin primes.
a(6) = 3 because 3*2^6 = 192 and {191, 193} are twin primes.
a(71) = 630 because 630*2^71 = 1487545442103938242314240 and {1487545442103938242314239, 1487545442103938242314241} are twin primes.
		

References

  • Richard Crandall and Carl Pomerance, 'Prime Numbers: A Computational Perspective,' Springer-Verlag, NY, 2001, page 12.

Crossrefs

Cf. A071256, A060210, A060256. For records see A125848, A125019.
Cf. A076806 (requires odd k).

Programs

  • Mathematica
    Table[Do[s=(2^j)*k; If[PrimeQ[s-1]&&PrimeQ[s+1],Print[{j,k}]], {k,1,2*j^2}],{j,0,100}]; (* outprint of a[j]=k *)
    Do[ k = 1; While[ ! PrimeQ[ k*2^n + 1 ] || ! PrimeQ[ k*2^n - 1 ], k++ ]; Print[ k ], {n, 0, 50} ]
    f[n_] := Block[{k = 1},While[Nand @@ PrimeQ[{-1, 1} + 2^n*k], k++ ];k];Table[f[n], {n, 0, 60}] (* Ray Chandler, Jan 09 2009 *)

Extensions

More terms from Labos Elemer, May 24 2002
Edited by N. J. A. Sloane, Jul 03 2008 at the suggestion of R. J. Mathar

A124519 Numbers k such that 12*k - 1 and 12*k + 1 are twin primes.

Original entry on oeis.org

1, 5, 6, 9, 15, 16, 19, 20, 26, 29, 35, 36, 50, 55, 69, 85, 86, 91, 96, 110, 119, 121, 124, 134, 135, 139, 149, 156, 161, 169, 174, 176, 189, 195, 216, 224, 226, 250, 260, 264, 271, 275, 280, 281, 289, 294, 295, 306, 314, 321, 335, 341, 344, 355, 356, 379, 399
Offset: 1

Views

Author

Artur Jasinski, Nov 04 2006

Keywords

Examples

			1 is in the sequence since 12*1 - 1 = 11 and 12*1 + 1 = 13 are twin primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[400], And @@ PrimeQ[{-1, 1} + 12# ] &] (* Ray Chandler, Nov 16 2006 *)

Extensions

Extended by Ray Chandler, Nov 16 2006

A124522 a(n) = smallest k such that 2nk-1 and 2nk+1 are primes.

Original entry on oeis.org

2, 1, 1, 9, 3, 1, 3, 12, 1, 3, 9, 3, 12, 15, 1, 6, 3, 2, 6, 6, 1, 15, 3, 4, 3, 6, 2, 48, 6, 1, 21, 3, 3, 15, 6, 1, 27, 3, 4, 3, 15, 5, 12, 15, 2, 9, 3, 2, 9, 6, 1, 3, 60, 1, 6, 24, 2, 3, 9, 2, 129, 12, 7, 9, 15, 5, 12, 27, 1, 3, 9, 3, 42, 45, 1, 90, 3, 2, 66, 21, 5, 63, 27, 16, 6, 6, 2, 12, 24, 1, 6
Offset: 1

Views

Author

Artur Jasinski, Nov 04 2006

Keywords

Crossrefs

Programs

  • Maple
    isA001359 := proc(n) RETURN( isprime(n) and isprime(n+2)) ; end: A124522 := proc(n) local k; k :=1 ; while true do if isA001359(2*n*k-1) then RETURN(k) ; fi ; k := k+1 ; od ; end: for n from 1 to 60 do printf("%d,",A124522(n)) ; od ; # R. J. Mathar, Nov 06 2006
  • Mathematica
    f[n_] := Block[{k = 1},While[Nand @@ PrimeQ[{-1, 1} + 2n*k], k++ ];k];Table[f[n], {n, 91}] (* Ray Chandler, Nov 16 2006 *)
    skp[n_]:=Module[{k=1},While[AnyTrue[2n k+{1,-1},CompositeQ],k++];k]; Join[{2},Array[skp,100,2]] (* Harvey P. Dale, Mar 30 2024 *)
  • PARI
    {for(n=1,91,k=1;while(!isprime(2*n*k-1)||!isprime(2*n*k+1),k++);print1(k, ","))}

Extensions

Edited and extended by Klaus Brockhaus and R. J. Mathar, Nov 06 2006

A124518 Numbers k such that 10k-1 and 10k+1 are twin primes.

Original entry on oeis.org

3, 6, 15, 18, 24, 27, 42, 57, 60, 66, 81, 102, 105, 123, 129, 132, 162, 195, 213, 231, 234, 255, 273, 279, 297, 300, 312, 330, 333, 336, 339, 354, 393, 402, 405, 423, 426, 465, 480, 501, 510, 528, 552, 564, 585, 588, 609, 627, 630, 636, 645, 657, 666, 669, 678
Offset: 1

Views

Author

Artur Jasinski, Nov 04 2006

Keywords

Comments

All terms are divisible by 3. - Robert Israel, Apr 07 2019

Crossrefs

Programs

  • Maple
    select(t -> isprime(10*t+1) and isprime(10*t-1), [seq(i,i=3..1000,3)]); # Robert Israel, Apr 07 2019
  • Mathematica
    Select[Range[678], And @@ PrimeQ[{-1, 1} + 10# ] &] (* Ray Chandler, Nov 16 2006 *)

A124065 Numbers k such that 8*k - 1 and 8*k + 1 are twin primes.

Original entry on oeis.org

9, 24, 30, 39, 54, 75, 129, 144, 165, 186, 201, 234, 261, 264, 324, 336, 339, 375, 390, 396, 420, 441, 459, 471, 516, 534, 600, 621, 654, 660, 690, 705, 735, 795, 819, 849, 870, 891, 936, 945, 1011, 1029, 1125, 1155, 1179, 1215, 1221, 1251, 1284, 1395, 1419
Offset: 1

Views

Author

Artur Jasinski, Nov 04 2006

Keywords

Examples

			9 is in the sequence since 8*9 - 1 = 71 and 8*9 + 1 = 73 are twin primes.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..2000] | IsPrime(8*n+1) and IsPrime(8*n-1)] // Vincenzo Librandi, Mar 08 2010
    
  • Mathematica
    Select[Range[1500], And @@ PrimeQ[{-1, 1} + 8# ] &] (* Ray Chandler, Nov 16 2006 *)
  • Python
    from sympy import isprime
    def ok(n): return isprime(8*n - 1) and isprime(8*n + 1)
    print(list(filter(ok, range(1420)))) # Michael S. Branicky, Sep 24 2021

Extensions

Extended by Ray Chandler, Nov 16 2006

A124520 Numbers k such that 14*k - 1 and 14*k + 1 are twin primes.

Original entry on oeis.org

3, 30, 33, 63, 75, 78, 93, 102, 123, 138, 153, 162, 165, 192, 195, 240, 252, 273, 297, 303, 342, 387, 393, 420, 435, 438, 450, 468, 483, 522, 525, 540, 588, 630, 633, 660, 663, 717, 738, 747, 750, 765, 798, 825, 837, 855, 957, 978, 993, 1023, 1032, 1062
Offset: 1

Views

Author

Artur Jasinski, Nov 04 2006

Keywords

Examples

			3 is in the sequence since 14*3 - 1 = 41 and 14*3 + 1 = 43 are twin primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1100], And @@ PrimeQ[{-1, 1} + 14# ] &] (* Ray Chandler, Nov 16 2006 *)

Extensions

Extended by Ray Chandler, Nov 16 2006

A124521 Numbers k such that 16*k - 1 and 16*k + 1 are twin primes.

Original entry on oeis.org

12, 15, 27, 72, 93, 117, 132, 162, 168, 195, 198, 210, 258, 267, 300, 327, 330, 345, 435, 468, 642, 765, 813, 855, 903, 912, 960, 978, 993, 1128, 1143, 1182, 1290, 1350, 1353, 1365, 1392, 1398, 1440, 1632, 1680, 1713, 1737, 1797, 1848, 1860, 1947, 1953, 1962
Offset: 1

Views

Author

Artur Jasinski, Nov 04 2006

Keywords

Examples

			12 is in the sequence since 16*12 - 1 = 191 and 16*12 + 1 = 193 are twin primes.
		

Crossrefs

Programs

  • Maple
    A124521:=n->`if`(isprime(16*n-1) and isprime(16*n+1), n, NULL): seq(A124521(n), n=1..2000); # Wesley Ivan Hurt, Oct 10 2014
  • Mathematica
    Select[Range[2000], And @@ PrimeQ[{-1, 1} + 16# ] &] (* Ray Chandler, Nov 16 2006 *)

Extensions

Extended by Ray Chandler, Nov 16 2006

A365411 Numbers k such that 4*k-1 and 4*k+1 are both prime powers (A246655).

Original entry on oeis.org

1, 2, 3, 6, 7, 12, 15, 18, 20, 27, 42, 45, 48, 57, 60, 78, 87, 90, 105, 108, 150, 165, 182, 207, 210, 255, 258, 273, 288, 330, 342, 357, 363, 372, 402, 405, 417, 447, 462, 468, 483, 507, 522, 528, 552, 567, 585, 600, 648, 672, 678, 750, 780, 792, 813, 825, 840, 843
Offset: 1

Views

Author

Jianing Song, Oct 22 2023

Keywords

Comments

Let b(q) be the number of pairs of consecutive nonzero squares in the finite field F_q for odd prime powers q, then b(q) = b(q') for q < q' if and only if q = 4*k-1 and q' = 4*k+1 for k being a term of this sequence, in which case we have b(q) = b(q') = k-1.

Examples

			6 is a term since 4*6-1 = 23 is a prime, and 4*6+1 = 25 is a prime power.
		

Crossrefs

Cf. A246655, A366502. Supersequence of A045753.
{2*a(n)} is a subsequence of A365416.

Programs

  • PARI
    isA365411(n) = isprimepower(4*n-1) && isprimepower(4*n+1)

A123200 Numbers k such that 1000000*k-1 and 1000000*k+1 are twin primes.

Original entry on oeis.org

24, 30, 198, 345, 348, 432, 438, 471, 492, 609, 669, 774, 777, 858, 864, 1032, 1083, 1125, 1218, 1395, 1536, 1824, 1914, 1929, 2088, 2139, 2301, 2334, 2376, 2418, 2448, 2460, 2544, 2763, 2832, 2970, 3021, 3297, 3369, 3384, 3495, 3528, 3540, 3633, 3777
Offset: 1

Views

Author

Jonathan Vos Post, Nov 05 2006

Keywords

Examples

			a(6) = 432 because 431999999 and 432000001 are primes.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if isprime(10^6*n-1)=true and isprime(10^6*n+1)=true then n else fi end: seq(a(n),n=1..4500); # Emeric Deutsch, Nov 16 2006
  • Mathematica
    Select[Range[3800],AllTrue[#*10^6+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 13 2017 *)

Extensions

More terms from Emeric Deutsch, Nov 16 2006
Showing 1-10 of 13 results. Next