[go: up one dir, main page]

login
Revision History for A174960 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Smallest prime p such that p + n*(n+1)/2 is prime, or 0 if no such prime exists.
(history; published version)
#15 by Charles R Greathouse IV at Thu Sep 08 08:45:51 EDT 2022
PROG

(MAGMAMagma) SmallestP:=function(n) for p in PrimesUpTo(1000) do if IsPrime(p + n*(n+1) div 2) then return p; end if; end for; return 0; end function; [SmallestP(n): n in [0..100]]; // Klaus Brockhaus, Apr 10 2010

(MAGMAMagma) SmallestQ:=function(n) for m in PrimesUpTo(1000) do E:=Eigenvalues(Matrix([&cat[ [j ne k select j else m+j]: k in [1..n]]: j in [1..n] ])); if forall(t){x: x in E | IsPrime(x[1])} then return m; end if; end for; return 0; end function; [2] cat [SmallestQ(n): n in [1..100]]; // Klaus Brockhaus, Apr 10 2010

Discussion
Thu Sep 08
08:45
OEIS Server: https://oeis.org/edit/global/2944
#14 by Jon E. Schoenfield at Sun May 26 03:48:07 EDT 2019
STATUS

editing

approved

#13 by Jon E. Schoenfield at Sun May 26 03:48:05 EDT 2019
REFERENCES

J.-M. Monier, Algebre et geometrie, exercices corriges. Dunod, 1997, p. 78.

STATUS

approved

editing

#12 by Bruno Berselli at Fri Feb 02 02:42:16 EST 2018
STATUS

editing

approved

#11 by Bruno Berselli at Fri Feb 02 02:42:09 EST 2018
NAME

Smallest prime p such that p + n*(n+1)/2 is prime, or 0 if no such prime exists.

PROG

(MAGMA) SmallestP:=function(n) for p in PrimesUpTo(1000) do if IsPrime(p + n*(n+1) div 2) then return p; end if; end for; return 0; end function; [ SmallestP(n): n in [0..100] ]; // Klaus Brockhaus, Apr 10 2010

(MAGMA) SmallestQ:=function(n) for m in PrimesUpTo(1000) do E:=Eigenvalues( Matrix([ &cat[ [j ne k select j else m+j]: k in [1..n] ]: j in [1..n] ]) ); if forall(t){ x: x in E | IsPrime(x[1]) } then return m; end if; end for; return 0; end function; [2] cat [ SmallestQ(n): n in [1..100] ]; // Klaus Brockhaus, Apr 10 2010

STATUS

proposed

editing

#10 by Jon E. Schoenfield at Thu Feb 01 23:59:23 EST 2018
STATUS

editing

proposed

#9 by Jon E. Schoenfield at Thu Feb 01 23:59:20 EST 2018
PROG

(MAGMA) SmallestP:=function(n) for p in PrimesUpTo(1000) do if IsPrime(p + n*(n+1) div 2) then return p; end if; end for; return 0; end function; [ SmallestP(n): n in [0..100] ]; [From // _Klaus Brockhaus, _, Apr 10 2010]

(MAGMA) SmallestQ:=function(n) for m in PrimesUpTo(1000) do E:=Eigenvalues( Matrix([ &cat[ [j ne k select j else m+j]: k in [1..n] ]: j in [1..n] ]) ); if forall(t){ x: x in E | IsPrime(x[1]) } then return m; end if; end for; return 0; end function; [2] cat [ SmallestQ(n): n in [1..100] ]; [From // _Klaus Brockhaus, _, Apr 10 2010]

STATUS

approved

editing

#8 by Charles R Greathouse IV at Thu Nov 21 13:11:55 EST 2013
MATHEMATICA

a[n_] := (p = 2; q = n*(n+1)/2; While[p > 0, If[ PrimeQ[p+q], Break[], p = If[ OddQ[q], 0, NextPrime[p]]]]; p); Table[a[n], {n, 0, 100}] (* From _Jean-François Alcover, _, Nov 03 2011 *)

Discussion
Thu Nov 21
13:11
OEIS Server: https://oeis.org/edit/global/2066
#7 by Russ Cox at Fri Mar 30 18:35:52 EDT 2012
AUTHOR

_Michel Lagneau (mn.lagneau2(AT)orange.fr), _, Apr 02 2010

Discussion
Fri Mar 30
18:35
OEIS Server: https://oeis.org/edit/global/205
#6 by Russ Cox at Fri Mar 30 17:28:07 EDT 2012
EXTENSIONS

Edited and corrected by _Klaus Brockhaus (klaus-brockhaus(AT)t-online.de), _, Apr 10 2010

Discussion
Fri Mar 30
17:28
OEIS Server: https://oeis.org/edit/global/145