login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A202298
If A is the n X n matrix containing the first n^2 primes, a(n) is the sum of the elements of the square of A.
1
4, 155, 3702, 39933, 244676, 1046455, 3635046, 10406049, 26595892, 60712839, 128248632, 253217949, 472633812, 837636667, 1431878468, 2356057659, 3756191658, 5844567389, 8865989698, 13147819241, 19100995732, 27324708263, 38402817766, 53116446341, 72537301810, 97894517685
OFFSET
1,1
LINKS
FORMULA
a(n) = Sum_{j=1..n} (Sum_{i=1..n} prime(i+n*(j-1)) * Sum_{i=1..n} prime(j+n*(i-1))). - Robert Israel, Jan 11 2024
EXAMPLE
M2 = [2,3; 5,7], M2*M2 = [19,27; 45,64], so a(2) = 19 + 27 + 45 + 64 = 155.
MAPLE
A202298 := proc(n)
local A, A2, r, c ;
A := Matrix(n, n) ;
for r from 0 to n-1 do
for c from 0 to n-1 do
A[r+1, c+1] := ithprime(1+r*n+c) ;
end do:
end do:
A2 := A^2 ;
add(add(A2[r, c], r=1..n), c=1..n) ;
end proc: # R. J. Mathar, Feb 09 2017
# alternative
N:= 50: # for a(1)..a(N)
P:= [seq(ithprime(i), i=1..N^2)]:
f:= proc(n) local M, e, u; M:= Matrix(n, n, P[1..n^2]);
e:= Vector(n, 1);
e^%T . (M . (M . e));
end proc:
map(f, [$1..N]); # Robert Israel, Jan 11 2024
PROG
(PARI) a(n) = my(m = matrix(n, n, i, j, prime((i-1)*n+j))); my(mm = m^2); sum(k=1, n, vecsum(mm[k, ])); \\ Michel Marcus, Jan 28 2017
CROSSREFS
Sequence in context: A303898 A370230 A093977 * A003736 A354285 A210837
KEYWORD
nonn
AUTHOR
Stephen Balaban, Dec 15 2011
EXTENSIONS
More terms from Michel Marcus, Jan 28 2017
STATUS
approved