OFFSET
0,6
COMMENTS
LINKS
Peter Luschny, Strong coprimality.
EXAMPLE
a(11) = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 - 1 - 2 - 5 - 10 = 37.
MAPLE
with(numtheory):
A181831 := n -> `if`(n<2, 0, n*phi(n)/2-sigma(n-1)):
MATHEMATICA
Join[{0, 0}, Table[Total[Select[Range[n], CoprimeQ[#, n]&&!Divisible[n-1, #]&]], {n, 2, 50}]] (* Harvey P. Dale, Apr 09 2013 *)
PROG
(SageMath)
def isstrongprimeto(k, n): return not(k.divides(n-1)) and gcd(k, n) == 1
def a(n): return sum(k for k in srange(n + 1) if isstrongprimeto(k, n))
print([a(n) for n in range(51)])
# Alternative:
def a(n): return 0 if n < 2 else n*euler_phi(n)//2 - sigma(n - 1, 1)
# Peter Luschny, Dec 03 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 17 2010
EXTENSIONS
a(0) corrected by Peter Luschny, Dec 03 2023
STATUS
approved