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.

A340714 a(n) is the sum of (n-2*j) for j < n/2 coprime to n.

This page as a plain text file.
%I A340714 #19 Jan 18 2021 04:35:45
%S A340714 0,0,1,2,4,4,9,8,13,12,25,12,36,24,32,32,64,28,81,40,66,60,121,48,124,
%T A340714 84,121,84,196,56,225,128,170,144,216,108,324,180,240,160,400,120,441,
%U A340714 220,272,264,529,192,513,252,416,312,676,244,560,336,522,420,841,240,900,480,570,512,792,320
%N A340714 a(n) is the sum of (n-2*j) for j < n/2 coprime to n.
%C A340714 Sum of differences j-i for 0 < i < j coprime to n with i+j = n.
%C A340714 If p is an odd prime, a(p^k) = (p-1)*(p^(2*k-1)-1)/4.
%C A340714 Primes in this sequence are a(4) = 2 and a(3^k) = (3^(2*k-1)-1)/2 where 2*k-1 is in A028491.
%H A340714 Robert Israel, <a href="/A340714/b340714.txt">Table of n, a(n) for n = 1..10000</a>
%F A340714 a(n) = A023896(n) - 2*A066840(n) for n >= 3.
%F A340714 a(n) = Sum_{k=1..floor((n-1)/2)} floor(1/gcd(n,n-k)) * (n-2*k). - _Wesley Ivan Hurt_, Jan 18 2021
%e A340714 For n = 10, a(10) = (10-2*1) + (10-2*3) = 12.
%p A340714 f:= proc(n) local j; add(n-2*j, j= select(t -> igcd(t,n)=1, [$1..(n-1)/2])) end proc:
%p A340714 map(f, [$1..100]);
%t A340714 Table[Sum[(n - 2 i) Floor[1/GCD[n - i, n]], {i, Floor[(n-1)/2]}], {n, 80}] (* _Wesley Ivan Hurt_, Jan 18 2021 *)
%Y A340714 Cf. A023896, A028491, A066840.
%K A340714 nonn,look
%O A340714 1,4
%A A340714 _J. M. Bergot_ and _Robert Israel_, Jan 17 2021