A125019 Records in A063983 if the initial 4 is ignored (cf. A125848).
2, 9, 12, 57, 99, 165, 486, 681, 810, 1854
Offset: 1
Keywords
Extensions
Corrected and extended by R. J. Mathar, Nov 29 2006
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.
3 belongs to the sequence because 4*3+1 and 4*3-1 are both primes.
[n: n in [1..2000] | IsPrime(4*n+1) and IsPrime(4*n-1)] // Vincenzo Librandi, Nov 18 2010
Select[Range[1023], And @@ PrimeQ[{-1, 1} + 4# ] &] (* Ray Chandler, Dec 06 2006 *)
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
1 is in the sequence since 12*1 - 1 = 11 and 12*1 + 1 = 13 are twin primes.
Select[Range[400], And @@ PrimeQ[{-1, 1} + 12# ] &] (* Ray Chandler, Nov 16 2006 *)
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
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 *)
{for(n=1,91,k=1;while(!isprime(2*n*k-1)||!isprime(2*n*k+1),k++);print1(k, ","))}
k = 1; Do[ While[p = Table[2*i*k + 1, {i, 1, n}]; Union[ PrimeQ[p]] != {True}, k++ ]; Print[k], {n, 1, 15}] (* Robert G. Wilson v *)
for(n=1,6,s=1; while(sum(i=1,n,isprime(2*s*i+1))
select(t -> isprime(10*t+1) and isprime(10*t-1), [seq(i,i=3..1000,3)]); # Robert Israel, Apr 07 2019
Select[Range[678], And @@ PrimeQ[{-1, 1} + 10# ] &] (* Ray Chandler, Nov 16 2006 *)
9 is in the sequence since 8*9 - 1 = 71 and 8*9 + 1 = 73 are twin primes.
[n: n in [1..2000] | IsPrime(8*n+1) and IsPrime(8*n-1)] // Vincenzo Librandi, Mar 08 2010
Select[Range[1500], And @@ PrimeQ[{-1, 1} + 8# ] &] (* Ray Chandler, Nov 16 2006 *)
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
A064215 := proc(n) for k from 1 do if isprime(k*6^n-1) and isprime(k*6^n+1) then return k; end if; end do: end proc: # R. J. Mathar, Sep 17 2015
Table[ k = 1; While[ ! PrimeQ[ k*6^n + 1 ] || ! PrimeQ[ k*6^n - 1 ], k++ ]; k, {n, 50} ]
Do[ k = 1; While[ ! PrimeQ[ k*3^n + 1 ] || ! PrimeQ[ k*3^n - 1 ], k++ ]; Print[ k ], {n, 0, 50} ]
{ for (n=0, 225, k=0; p=3^n; until (isprime(k*p - 1) && isprime(k*p + 1), k+=2); write("b064213.txt", n, " ", k); ) } \\ Harry J. Smith, Sep 10 2009
Comments