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.

A289507 The sum of squares of the elements of a finite multiset of positive integers divided by their gcd, the multiset {s_j} being indexed by n = Product_j p_{s_j}, where p_{s_j} is the s_j-th prime.

This page as a plain text file.
%I A289507 #24 May 05 2019 16:00:04
%S A289507 0,1,2,2,3,5,4,3,4,10,5,6,6,17,13,4,7,9,8,11,10,26,9,7,6,37,6,18,10,
%T A289507 14,11,5,29,50,25,10,12,65,20,12,13,21,14,27,17,82,15,8,8,19,53,38,16,
%U A289507 13,34,19,34,101,17,15,18,122,12,6,15,30,19,51
%N A289507 The sum of squares of the elements of a finite multiset of positive integers divided by their gcd, the multiset {s_j} being indexed by n = Product_j p_{s_j}, where p_{s_j} is the s_j-th prime.
%C A289507 Given an integer linear equation Sum_{j=1..k} e_j x_j = 0, a(n) is also the modulus of the determinant whose first row is e_1, e_2, ..., e_k and whose other k-1 rows form an integral basis for the integer solution space of the equation. Here n = Product_j p_{e_j}, where p_{e_j} is the e_j-th prime.
%C A289507 For the proof, see Links.
%C A289507 Also a(n) = A289506(n) when gcd_j e_j = 1, which occurs for the numbers n in A289509.
%H A289507 Alois P. Heinz, <a href="/A289507/b289507.txt">Table of n, a(n) for n = 1..20000</a>
%H A289507 Christopher J. Smyth, <a href="/A289507/a289507.pdf">A determinant associated to an integer linear equation</a>
%F A289507 a(n) = (Sum_j e_j^2)/gcd_j(e_j), where n = Product_j p_{e_j}.
%e A289507 For n = 63 = 3^2*7 = p_2*p_2*p_4, the corresponding multiset is {2,2,4}, and a(63) = (2^2 + 2^2 + 4^2)/2 = 12. Also the relevant determinant is Det([[2,2,4],[-1,1,0],[-2,0,1]]) = 12.
%p A289507 p:=1: for ind to 1000 do p:=nextprime(p); primeindex[p]:=ind; od:
%p A289507 # so primeindex[p]:=k if p is the k-th prime
%p A289507 out:=[0]: for n from 2 to 100 do f:=ifactors(n)[2];
%p A289507 m:=[];g:=0; for k to nops(f) do pow:=f[k]; ind:=primeindex[pow[1]];g:=gcd(g,ind); for e to pow[2] do
%p A289507 m:=[op(m), ind]; od; od; out:=[op(out), sum(m[jj]^2, jj=1..nops(m))/g];
%p A289507 od:print(out);
%p A289507 # second Maple program:
%p A289507 with(numtheory):
%p A289507 a:= n-> (l-> add(i[1]^2*i[2], i=l)/`if`(n=1, 1, igcd(seq(i[1],
%p A289507          i=l))))(map(i-> [pi(i[1]), i[2]], ifactors(n)[2])):
%p A289507 seq(a(n), n=1..80);  # _Alois P. Heinz_, Aug 05 2017
%t A289507 a[n_] := Module[{m}, m = Table[{p, e} = pe; Table[PrimePi[p], {e}], {pe, FactorInteger[n]}] // Flatten; (m.m)/GCD @@ m]; a[1] = 0; Array[a, 80] (* _Jean-François Alcover_, May 05 2019 *)
%o A289507 (PARI) a(n) = if (n==1, 0, my(f=factor(n)); sum(k=1, #f~, f[k,2]*primepi(f[k,1])^2) /gcd(apply(x->primepi(x), f[,1]))); \\ _Michel Marcus_, Jul 19 2017
%Y A289507 Cf. A289506, A289509.
%Y A289507 Cf. A056239, where the same encoding for integer multisets ('Heinz encoding') is used.
%K A289507 nonn,look
%O A289507 1,3
%A A289507 _Christopher J. Smyth_, Jul 07 2017