(Translated by https://www.hiragana.jp/)
A174962 -id:A174962 - OEIS
login
Search: a174962 -id:a174962
     Sort: relevance | references | number | modified | created      Format: long | short | data
Smallest prime p such that p + n*(n+1)/2 is prime, or 0 if no such prime exists.
+10
3
2, 2, 2, 5, 3, 2, 2, 3, 5, 2, 0, 5, 5, 0, 2, 7, 3, 0, 2, 3, 13, 2, 0, 5, 7, 0, 2, 5, 3, 0, 2, 3, 13, 2, 0, 11, 7, 0, 2, 7, 3, 2, 0, 7, 7, 0, 0, 23, 5, 0, 2, 41, 3, 2, 2, 3, 5, 0, 0, 7, 17, 0, 0, 11, 3, 0, 2, 3, 5, 2, 0, 23, 5, 0, 2, 7, 13, 0, 2, 3, 11, 2, 0, 5, 11, 0, 0, 5, 3, 2, 0, 31, 5, 2, 0, 7, 7, 0, 0
OFFSET
0,1
COMMENTS
n(n+1)/2 = A000217(n).
If n(n+1)/2 is odd, m+n(n+1)/2 can be prime only for m = 2, since otherwise m+n(n+1)/2 is divisible by 2. Hence a(n) = 0 if n(n+1)/2 is odd and 2+n(n+1)/2 is not prime.
For n > 0 also smallest m such that all eigenvalues of the n X n matrix M_m,n are prime, where M_m,n(j,k) = j for j <> k, M_m,n(j,k) = m+j for j = k.
The eigenvalues of M_m,n are m+n(n+1)/2, and m with the multiplicity n-1; cf. reference for proof. Thus all eigenvalues can be prime only if m is prime.
REFERENCES
J.-M. Monier, Algebre et geometrie, exercices corriges. Dunod, 1997, p. 78.
LINKS
EXAMPLE
(in Maple notation)
For n = 1 and m = 2, eigenvals(matrix(1,1, [[3]])) = {3}, so a(1) = 2.
For n = 2 and m = 2, eigenvals(matrix(2,2, [[3,1],[2,4]]) = {2,5} so a(2) = 2.
For n = 3 and m = 2, eigenvals(matrix(3,3, [[3,1,1],[2,4,2],[3,3,5]])) = {2,2,8} and 8 is not prime; for m = 3, eigenvals(matrix(3,3, [[4,1,1],[2,5,2],[3,3,6]])) = {3,3,9} and 9 is not prime; for m = 5, eigenvals(matrix(3,3, [[6,1,1],[2,7,2],[3,3,8]])) = {5,5,11} and 11 is prime, so a(3) = 5;
MAPLE
with(numtheory):for n from 1 to 200 do:nn:=1:for k from 2 to 1000 do: x:=k + n*(n+1)/2:if (type(x, prime)=true)and(type(k, prime)=true)and nn=1 then print(k):nn:=2:else fi:od:od:
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}] (* Jean-François Alcover, Nov 03 2011 *)
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
CROSSREFS
Cf. A000217 (triangular numbers), A174962.
KEYWORD
nonn
AUTHOR
Michel Lagneau, Apr 02 2010
EXTENSIONS
Edited and corrected by Klaus Brockhaus, Apr 10 2010
STATUS
approved
Determinant of the symmetric n X n matrix M_n where M_n(j,k) = n for j = k, M_n(j,n) = n-j, M_n(n,k) = n-k, M_n(j,k) = 0 otherwise.
+10
2
1, 3, 12, 32, -625, -24624, -705894, -19922944, -588305187, -18500000000, -622498190424, -22414085849088, -862029149531797, -35320307409809408, -1537494104003906250, -70904672533321089024, -3454944623172347662151, -177423154932124201844736
OFFSET
1,2
REFERENCES
J.-M. Monier, Algèbre et géometrie, exercices corrigés. Dunod, 1997, p. 78.
LINKS
FORMULA
a(n) = n^n - ((n-1)*n*(2*n-1)/6)*n^(n-2).
EXAMPLE
a(5) = determinant(M_5) = -625 where M_5 is the matrix
[5 0 0 0 4]
[0 5 0 0 3]
[0 0 5 0 2]
[0 0 0 5 1]
[4 3 2 1 5]
MAPLE
with(numtheory):for n from 1 to 25 do:x:=n^n -((n-1)*n*(2*n-1)/6)*n^(n-2):print(x):od:
PROG
(Magma) [ n^n -((n-1)*n*(2*n-1)/6)*n^(n-2): n in [1..18] ]; // Klaus Brockhaus, Apr 11 2010
(Magma) [ Determinant( SymmetricMatrix( &cat[ [ i lt j select 0 else n: i in [1..j] ]: j in [1..n-1] ] cat [ 1+((n-1-k) mod n): k in [1..n] ] ) ): n in [1..18] ]; // Klaus Brockhaus, Apr 11 2010
CROSSREFS
Cf. A174962.
KEYWORD
sign
AUTHOR
Michel Lagneau, Apr 02 2010
EXTENSIONS
Edited by Klaus Brockhaus, Apr 11 2010
STATUS
approved

Search completed in 0.007 seconds