A322582 a(n) = n - A003958(n), where A003958 is fully multiplicative with a(p) = (p-1).
0, 1, 1, 3, 1, 4, 1, 7, 5, 6, 1, 10, 1, 8, 7, 15, 1, 14, 1, 16, 9, 12, 1, 22, 9, 14, 19, 22, 1, 22, 1, 31, 13, 18, 11, 32, 1, 20, 15, 36, 1, 30, 1, 34, 29, 24, 1, 46, 13, 34, 19, 40, 1, 46, 15, 50, 21, 30, 1, 52, 1, 32, 39, 63, 17, 46, 1, 52, 25, 46, 1, 68, 1, 38, 43, 58, 17, 54, 1, 76, 65, 42, 1, 72, 21, 44, 31, 78, 1
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384
Crossrefs
Programs
-
Mathematica
a[1] = 0; a[n_] := n - Times @@ ((First[#] - 1)^Last[#] & /@ FactorInteger[n]); Array[a, 60] (* Amiram Eldar, Dec 17 2018 *)
-
PARI
A003958(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1]--); factorback(f); }; A322582(n) = (n-A003958(n));
-
PARI
A020639(n) = if(1==n, n, (factor(n)[1, 1])); A322582(n) = { my(s=0, m=1, spf); while(n>1, spf = A020639(n); n /= spf; s += m*n; m *= (spf-1)); (s); }; \\ (Compare to the similar programs given in A003415 and A348507) - Antti Karttunen, Nov 07 2021
Formula
a(n) = n - A003958(n).
From Antti Karttunen, Nov 07 2021: (Start)
For n > 1, a(n) = a(A032742(n))*(A020639(n)-1) + A032742(n). [See the comment above and compare with Reinhard Zumkeller's May 09 2011 formula for A003415]
(End)
Comments