login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = n*(n+1)/2 - (n-2)*phi(n)/2 for n >= 2, with a(1)=1.
1

%I #20 Nov 28 2021 10:05:16

%S 1,3,5,8,9,17,13,24,24,39,21,58,25,69,68,80,33,123,37,138,117,153,45,

%T 212,95,207,153,250,57,353,61,288,251,339,234,462,73,417,336,516,81,

%U 663,85,570,519,597,93,808,238,795,542,778,105,1017,480,948,663,927,117,1366,121

%N a(n) = n*(n+1)/2 - (n-2)*phi(n)/2 for n >= 2, with a(1)=1.

%C For each k from 1 to n, add k if k shares a common factor > 1 with n, otherwise add 1 (see example).

%H Antti Karttunen, <a href="/A349679/b349679.txt">Table of n, a(n) for n = 1..20000</a>

%F a(n) = A000010(n) + A067392(n). - _Amiram Eldar_, Nov 26 2021

%F a(p) = 2p-1 for primes p. - _Wesley Ivan Hurt_, Nov 28 2021

%e a(6) = 17 since we have 1 + 2 + 3 + 4 + 1 + 6 = 17 for k = 1..6 respectively.

%t nterms=100;Join[{1},Table[n(n+1)/2-(n-2)EulerPhi[n]/2,{n,2,nterms}]] (* _Paolo Xausa_, Nov 26 2021 *)

%o (PARI) a(n) = if (n==1, 1, n*(n+1)/2 - (n-2)*eulerphi(n)/2); \\ _Michel Marcus_, Nov 25 2021

%Y Cf. A000010 (phi), A067392.

%Y Cf. also A345091.

%K nonn

%O 1,2

%A _Wesley Ivan Hurt_, Nov 24 2021