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

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

A045753 Numbers n such that 4n-1 and 4n+1 are both primes.

Original entry on oeis.org

1, 3, 15, 18, 27, 45, 48, 57, 60, 78, 87, 105, 108, 150, 165, 207, 255, 258, 273, 288, 330, 357, 363, 372, 402, 405, 417, 447, 468, 483, 507, 522, 528, 567, 585, 648, 672, 678, 750, 780, 792, 813, 825, 840, 843, 867, 882, 885, 918, 942, 963, 1005, 1023
Offset: 1

Views

Author

Keywords

Examples

			3 belongs to the sequence because 4*3+1 and 4*3-1 are both primes.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..2000] | IsPrime(4*n+1) and IsPrime(4*n-1)] // Vincenzo Librandi, Nov 18 2010
    
  • Mathematica
    Select[Range[1023], And @@ PrimeQ[{-1, 1} + 4# ] &] (* Ray Chandler, Dec 06 2006 *)
  • PARI
    list(lim)=my(v=List(),p=2); forprime(q=3,4*lim+1, if(q-p==2 && p%4==3, listput(v,q\4)); p=q); Vec(v) \\ Charles R Greathouse IV, Dec 03 2016

Extensions

More terms from Erich Friedman

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

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

A058218 Positive integers that cannot be represented in the form n=5|ab|+a+b for any choice of nonzero integers a and b (positive or negative).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 14, 18, 22, 26, 28, 30, 32, 36, 40, 44, 48, 50, 54, 58, 60, 62, 66, 76, 78, 82, 84, 94, 96, 98, 100, 102, 104, 114, 116, 120, 126, 132, 136, 138, 140, 144, 150, 154, 158, 162, 166, 170, 176, 184, 188, 190, 198, 202, 204, 208, 210, 212, 216, 220
Offset: 1

Views

Author

John W. Layman, Nov 30 2000

Keywords

Comments

All terms except 1 are even. - Robert Israel, Apr 07 2019

Crossrefs

A002822 results if the coefficient 5 in the definition above is replaced by 6.
Includes 2*A124518.

Programs

  • Maple
    filter:= proc(n)
       nops(select(t -> t mod 5 = 1 or t mod 5 = 4, numtheory:-divisors(5*n+1))) = 2
       and nops(select(t -> t mod 5 = 4, numtheory:-divisors(5*n-1)))=1
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Apr 07 2019
  • Mathematica
    filterQ[n_] := Length[Select[Divisors[5 n + 1], Mod[#, 5] == 1 || Mod[#, 5] == 4&]] == 2 && Length[Select[Divisors[5 n - 1], Mod[#, 5] == 4&]] == 1;
    Select[Range[1000], filterQ] (* Jean-François Alcover, Aug 16 2020, after Robert Israel *)

A303550 Numbers k such that abs(60*k^2 - 1710*k + 12150) +- 1 are twin primes.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 38, 41, 50, 56, 57, 64, 66, 69, 75, 81, 85, 86, 90, 93, 98, 103, 106, 119, 121, 133, 136, 141, 143, 146, 150, 181, 182, 189, 195, 202, 207, 208, 212, 215, 218, 219, 225
Offset: 1

Views

Author

Amiram Eldar, Apr 26 2018

Keywords

Comments

The formula was discovered by Andrew T. Gazsi in 1961.
The polynomial can also be given as 30*(2*k - 27)*(k - 15). Its value is negative (-30) at k = 14 and 0 and k = 15.
Beiler erroneously claimed that the polynomial generates twin primes for k = 1 to 20.

Examples

			1 is in the sequence since 60*1^2 - 1710*1 + 12150 = 10500 and (10499, 10501) are twin primes.
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers: The Queen of Mathematics Entertains, 2nd ed., Dover Publications, Inc., New York, 1966, p. 225.
  • Joseph B. Dence and Thomas P. Dence, Elements of the Theory of Numbers, Academic Press, 1999, problem 1.94, p.35.
  • Andrew T. Gazsi, A Formula to Generate Prime Pairs, Recreational Mathematics Magazine, edited by Joseph S. Madachy, Issue 6, December 1961, p. 44.

Crossrefs

Programs

  • Maple
    filter:= proc(n) local k;
      k:= abs(60*n^2-1710*n+12150);
      isprime(k+1) and isprime(k-1)
    end proc:
    select(filter, [$1..300]); # Robert Israel, Jun 19 2018
  • Mathematica
    f[n_] := 60n^2 - 1710n + 12150; aQ[n_]:=PrimeQ[f[n]-1] && PrimeQ[f[n]+1]; Select[Range[225], aQ]
    Select[Range[250],AllTrue[Abs[60#^2-1710#+12150+{1,-1}],PrimeQ]&] (* Harvey P. Dale, May 17 2025 *)
  • PARI
    f(n) = abs(60*n^2 - 1710*n + 12150);
    isok(n) = my(fn=f(n)); isprime(fn-1) && isprime(fn+1); \\ Michel Marcus, Apr 27 2018
Showing 1-9 of 9 results.