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.

A072514 Sum of n mod k for k in {1...n} with gcd(k,n) > 1.

This page as a plain text file.
%I A072514 #23 May 19 2025 16:21:38
%S A072514 0,0,0,0,0,2,0,2,3,8,0,9,0,16,17,16,0,27,0,31,31,44,0,52,20,56,36,69,
%T A072514 0,92,0,72,77,102,68,127,0,128,97,152,0,192,0,165,153,196,0,230,56,
%U A072514 231,170,237,0,319,154,290,211,302,0,421,0,334,273,334,192,478,0,411,317
%N A072514 Sum of n mod k for k in {1...n} with gcd(k,n) > 1.
%C A072514 Previous name was: Sum of the remainders when n is divided by unrelated numbers (numbers which are neither coprime to n nor divide n).
%H A072514 Paolo P. Lava, <a href="/A072514/b072514.txt">Table of n, a(n) for n = 1..1000</a>
%F A072514 From _Ridouane Oudra_, May 14 2025: (Start)
%F A072514 a(n) = A004125(n) - A067439(n).
%F A072514 a(n) = Sum_{d|n, d>1} d*A067439(n/d).
%F A072514 a(p) = 0, for p prime.
%F A072514 a(p*q) = p*A067439(q) + q*A067439(p), for p and q two distinct prime numbers.
%F A072514 a(p^k) = p*A004125(p^(k-1)), for p a prime and k >= 0. (End)
%e A072514 a(18) = 27: the unrelated numbers to 18 are 4, 8, 10, 12, 14, 15 and 16. The remainders when 18 is divided by these numbers are 2, 2, 8, 6, 4, 3 and 2 whose sum is 27.
%p A072514 seq(add(n mod k, k=select(j->gcd(j,n)>1, [$1..n])),n=1..69); # _Peter Luschny_, Oct 01 2014
%t A072514 snmk[n_]:=Total[Mod[n,Complement[Complement[Range[n],Divisors[n]], Select[ Range[n], CoprimeQ[ #,n]&]]]]; Array[snmk,70] (* _Harvey P. Dale_, Dec 09 2018 *)
%o A072514 (PARI) lista(nn) = vector(nn, n, sum(i=1, n, (n % i)*(gcd(n, i) != 1))); \\ _Michel Marcus_, Oct 01 2014
%Y A072514 Cf. A004125, A067439, A008683, A111490.
%K A072514 nonn
%O A072514 1,6
%A A072514 _Amarnath Murthy_, Jul 30 2002
%E A072514 Corrected and extended by _David Garber_, Oct 22 2002
%E A072514 New name from Robert Israel, Oct 01 2014