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.

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.

This page as a plain text file.
%I A202298 #37 Jan 12 2024 10:05:11
%S A202298 4,155,3702,39933,244676,1046455,3635046,10406049,26595892,60712839,
%T A202298 128248632,253217949,472633812,837636667,1431878468,2356057659,
%U A202298 3756191658,5844567389,8865989698,13147819241,19100995732,27324708263,38402817766,53116446341,72537301810,97894517685
%N 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.
%H A202298 Robert Israel, <a href="/A202298/b202298.txt">Table of n, a(n) for n = 1..1000</a>
%F A202298 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
%e A202298 M2 = [2,3; 5,7], M2*M2 = [19,27; 45,64], so a(2) = 19 + 27 + 45 + 64 = 155.
%p A202298 A202298 := proc(n)
%p A202298     local A,A2,r,c ;
%p A202298     A := Matrix(n, n) ;
%p A202298     for r from 0 to n-1 do
%p A202298     for c from 0 to n-1 do
%p A202298         A[r+1,c+1] := ithprime(1+r*n+c) ;
%p A202298     end do:
%p A202298     end do:
%p A202298     A2 := A^2 ;
%p A202298     add(add(A2[r,c],r=1..n),c=1..n) ;
%p A202298 end proc: # _R. J. Mathar_, Feb 09 2017
%p A202298 # alternative
%p A202298 N:= 50: # for a(1)..a(N)
%p A202298 P:= [seq(ithprime(i),i=1..N^2)]:
%p A202298 f:= proc(n) local M,e,u; M:= Matrix(n,n,P[1..n^2]);
%p A202298    e:= Vector(n,1);
%p A202298    e^%T . (M . (M . e));
%p A202298 end proc:
%p A202298 map(f, [$1..N]); # _Robert Israel_, Jan 11 2024
%o A202298 (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
%Y A202298 Cf. A000040, A109724.
%K A202298 nonn
%O A202298 1,1
%A A202298 _Stephen Balaban_, Dec 15 2011
%E A202298 More terms from _Michel Marcus_, Jan 28 2017