login
A349679
a(n) = n*(n+1)/2 - (n-2)*phi(n)/2 for n >= 2, with a(1)=1.
1
1, 3, 5, 8, 9, 17, 13, 24, 24, 39, 21, 58, 25, 69, 68, 80, 33, 123, 37, 138, 117, 153, 45, 212, 95, 207, 153, 250, 57, 353, 61, 288, 251, 339, 234, 462, 73, 417, 336, 516, 81, 663, 85, 570, 519, 597, 93, 808, 238, 795, 542, 778, 105, 1017, 480, 948, 663, 927, 117, 1366, 121
OFFSET
1,2
COMMENTS
For each k from 1 to n, add k if k shares a common factor > 1 with n, otherwise add 1 (see example).
LINKS
FORMULA
a(n) = A000010(n) + A067392(n). - Amiram Eldar, Nov 26 2021
a(p) = 2p-1 for primes p. - Wesley Ivan Hurt, Nov 28 2021
EXAMPLE
a(6) = 17 since we have 1 + 2 + 3 + 4 + 1 + 6 = 17 for k = 1..6 respectively.
MATHEMATICA
nterms=100; Join[{1}, Table[n(n+1)/2-(n-2)EulerPhi[n]/2, {n, 2, nterms}]] (* Paolo Xausa, Nov 26 2021 *)
PROG
(PARI) a(n) = if (n==1, 1, n*(n+1)/2 - (n-2)*eulerphi(n)/2); \\ Michel Marcus, Nov 25 2021
CROSSREFS
Cf. A000010 (phi), A067392.
Cf. also A345091.
Sequence in context: A032682 A022769 A343114 * A355761 A306948 A067241
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Nov 24 2021
STATUS
approved