login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A367547
Euclid's triangle A217831 represented as binary numbers.
4
0, 11, 10, 110, 1010, 11110, 100010, 1111110, 10101010, 110110110, 1010001010, 11111111110, 100010100010, 1111111111110, 10101000101010, 110100110010110, 1010101010101010, 11111111111111110, 100010100010100010, 1111111111111111110, 10100010101010001010, 110110010110100110110
OFFSET
0,2
COMMENTS
The sequence represents the rows of Euclid's triangle A217831 as unsigned binary integers. If a '0' is prepended to the most significant bit (for n > 1) the terms can also be seen as palindromic binary strings. The decimal representation of the sequence is A367544.
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
Sequence in context: A105028 A331560 A014550 * A070836 A063432 A364121
KEYWORD
nonn,base
AUTHOR
Peter Luschny, Nov 22 2023
STATUS
approved