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.

A265204 Sum of phi(i) over squarefree numbers i <= n.

This page as a plain text file.
%I A265204 #26 Dec 24 2015 10:18:53
%S A265204 1,2,4,4,8,10,16,16,16,20,30,30,42,48,56,56,72,72,90,90,102,112,134,
%T A265204 134,134,146,146,146,174,182,212,212,232,248,272,272,308,326,350,350,
%U A265204 390,402,444,444,444,466,512,512,512,512,544,544,596,596,636,636,672,700,758,758,818,848,848,848,896,916,982,982,1026,1050
%N A265204 Sum of phi(i) over squarefree numbers i <= n.
%C A265204 Partial sums of absolute values of A097945. - _Robert Israel_, Dec 10 2015
%H A265204 Robert Israel, <a href="/A265204/b265204.txt">Table of n, a(n) for n = 1..10000</a>
%p A265204 with(numtheory):
%p A265204 a:= proc(n) option remember; `if`(n=0, 0, a(n-1))+
%p A265204       `if`(issqrfree(n), phi(n), 0)
%p A265204     end:
%p A265204 seq(a(n), n=1..70);  # _Alois P. Heinz_, Dec 04 2015
%p A265204 N:= 1000: # to get a(1) to a(N)
%p A265204 V:= Vector(N, 1):
%p A265204 Primes:= select(isprime, [2,seq(i,i=3..N,2)]):
%p A265204 for p in Primes do
%p A265204   J1:= [seq(i,i=p..N,p)];
%p A265204   J2:= [seq(i,i=p^2..N,p^2)];
%p A265204   V[J1]:= V[J1] * (p-1);
%p A265204   V[J2]:= 0;
%p A265204 od:
%p A265204 ListTools[PartialSums](convert(V,list)); # _Robert Israel_, Dec 10 2015
%t A265204 Table[Sum[EulerPhi@ i, {i, Select[Range@ n, SquareFreeQ]}], {n, 70}] (* _Michael De Vlieger_, Dec 10 2015 *)
%o A265204 (PARI) a(n) = sum(i=1, n, eulerphi(i)*issquarefree(i)) \\ _Anders Hellström_, Dec 04 2015
%o A265204 (Perl) use ntheory ":all"; sub an { vecsum(map { is_square_free($_) ? euler_phi($_) : () } 1..shift); } say an($_) for 1..70; # _Dana Jacobsen_, Dec 10 2015
%Y A265204 Cf. A000010, A097945.
%K A265204 nonn
%O A265204 1,2
%A A265204 _Jeffrey Shallit_, Dec 04 2015