OFFSET
0,2
COMMENTS
MATHEMATICA
A367547[n_]:=FromDigits[Boole[CoprimeQ[n, Range[0, n]]]];
Array[A367547, 30, 0] (* Paolo Xausa, Nov 24 2023 *)
PROG
(SageMath) # For Python include 'import math' for math.gcd.
def A367547(n):
cop = [int(gcd(i, n) == 1) for i in range(n + 1)]
return int(''.join(map(str, cop)))
print([A367547(n) for n in range(22)])
(PARI) a(n) = fromdigits(vector(n+1, i, gcd(i-1, n)==1), 10); \\ Michel Marcus, Nov 24 2023
(Python)
from math import gcd
def A367547(n): return sum(10**k for k in range(n+1) if gcd(n, k)==1) # Chai Wah Wu, Nov 24 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Peter Luschny, Nov 22 2023
STATUS
approved