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”).

A367544
Euclid's triangle A217831 represented as decimal numbers.
6
0, 3, 2, 6, 10, 30, 34, 126, 170, 438, 650, 2046, 2210, 8190, 10794, 27030, 43690, 131070, 141474, 524286, 666250, 1781046, 2794154, 8388606, 9054370, 32472030, 44731050, 115043766, 176859690, 536870910, 545925250, 2147483646, 2863311530, 7358604726, 11453115050
OFFSET
0,2
COMMENTS
The decimal equivalents of A367547.
FORMULA
a(n) = Sum_{k=0..n} 2^k * |(n - k | k)|, where (a | b) denotes the Kronecker symbol.
a(n) = Sum_{k=0..n} [gcd(k, n) = 1] * 2^k, where [] is the Iverson bracket.
MAPLE
KS := (n, k) -> NumberTheory:-KroneckerSymbol(n, k):
A367544 := n -> local k; add(2^k * abs(KS(n - k, k)), k = 0..n):
seq(A367544(n), n = 0..34);
MATHEMATICA
A367544[n_]:=FromDigits[Boole[CoprimeQ[n, Range[0, n]]], 2];
Array[A367544, 50, 0] (* Paolo Xausa, Nov 24 2023 *)
PROG
(SageMath) # For Python include 'import math' for math.gcd.
def a(n):
cop = [int(gcd(i, n) == 1) for i in range(n + 1)]
return sum(p * 2^k for k, p in enumerate(cop))
print([a(n) for n in range(35)])
(PARI) a(n) = sum(k=0, n, 2^k*abs(kronecker(n-k, k))); \\ Michel Marcus, Nov 23 2023
(PARI) a(n) = fromdigits(vector(n+1, i, gcd(i-1, n)==1), 2); \\ Michel Marcus, Nov 24 2023
(Python)
from math import gcd
def A367544(n): return sum(1<<k for k in range(n+1) if gcd(n, k)==1) # Chai Wah Wu, Nov 24 2023
KEYWORD
nonn,base
AUTHOR
Peter Luschny, Nov 22 2023
STATUS
approved