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.

A289506 Write n as a product of primes p_{s_1}*p_{s_2}*p_{s_3}*... where p_i denotes the i-th prime; then a(n) = s_1^2 + s_2^2 + s_3^2 + ...

This page as a plain text file.
%I A289506 #24 Aug 05 2017 19:05:14
%S A289506 0,1,4,2,9,5,16,3,8,10,25,6,36,17,13,4,49,9,64,11,20,26,81,7,18,37,12,
%T A289506 18,100,14,121,5,29,50,25,10,144,65,40,12,169,21,196,27,17,82,225,8,
%U A289506 32,19,53,38,256,13,34,19,68,101,289,15,324,122,24,6
%N A289506 Write n as a product of primes p_{s_1}*p_{s_2}*p_{s_3}*... where p_i denotes the i-th prime; then a(n) = s_1^2 + s_2^2 + s_3^2 + ...
%C A289506 When gcd_j(s_j) = 1, a(n) is the modulus of the determinant whose first row consists of the s_j, and whose remaining rows form a lattice basis for the space of integer solutions of Sum_j s_jx_j = 0. See A289507.
%C A289506 Compare A056239, where the same encoding for integer multisets ('Heinz encoding') is used, but where A056239(n) is the sum, rather than the sum of squares, of the elements of the corresponding multiset (partition).
%C A289506 See also A003963, for which A003963(n) is the product of the elements of the corresponding multiset.
%C A289506 See also A289507, where terms are (Sum_j s_j^2)/gcd_j(s_j) rather than Sum_j s_j^2 (this sequence).
%H A289506 Alois P. Heinz, <a href="/A289506/b289506.txt">Table of n, a(n) for n = 1..20000</a>
%F A289506 For n = Product_k p_k^{r_k}, a(n) = Sum_k k^2 * r_k.
%F A289506 Also a(n) = Sum_j s_j^2, where the multiset of s_j's is the multiset of k's, each with multiplicity r_k.
%e A289506 For n = 12 = 2^2 * 3 = p_1 * p_1 * p_2, the multiset is {1,1,2} and so a(12) = 1^2 + 1^2 + 2^2 = 6.
%e A289506 Also a(1) = 0 as n = 1 indexes the empty multiset.
%e A289506 Further a(p_k) = k^2 and a(2^r) = r.
%p A289506 p:=1:for ind to 1000 do p:=nextprime(p);primeindex[p]:=ind;od: # so primeindex[p]:=k if p is the k-th prime
%p A289506 out:=[0]:for n from 2 to 100 do f:=ifactors(n)[2];
%p A289506 m:=[];for k to nops(f) do pow:=f[k];ind:=primeindex[pow[1]];for e to pow[2] do
%p A289506 m:=[op(m),ind];od;od;out:=[op(out),sum(m[jj]^2,jj=1..nops(m))];
%p A289506 od:print(out);
%p A289506 # second Maple program:
%p A289506 a:= n-> add(numtheory[pi](i[1])^2*i[2], i=ifactors(n)[2]):
%p A289506 seq(a(n), n=1..80);  # _Alois P. Heinz_, Aug 05 2017
%t A289506 Table[Total[FactorInteger[n] /. {p_, e_} /; p > 0 :> e PrimePi[p]^2], {n, 64}] (* _Michael De Vlieger_, Jul 12 2017 *)
%o A289506 (PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, primepi(f[k,1])^2*f[k,2]); \\ _Michel Marcus_, Jul 19 2017
%Y A289506 Cf. A003963, A056239, A289507.
%K A289506 nonn,look,easy
%O A289506 1,3
%A A289506 _Christopher J. Smyth_, Jul 07 2017