reviewed
approved
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”).
reviewed
approved
proposed
reviewed
editing
proposed
def T(a, b): return ((a + b)**2 + 3*a + b)//2
for n in range(0, 21): print ([A(k, n - k) for k in range(0, n + 1)] ) # Indranil Ghosh, May 21 2017
approved
editing
for n in xrangerange(0, 21): print [A(k, n - k) for k in xrangerange(0, n + 1)] # Indranil Ghosh, May 21 2017
reviewed
approved
proposed
reviewed
editing
proposed
T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitXor[n, k], k]; Table[A[k, n - k ], {n, 0, 20}, {k, 0, n}] // Flatten (* Indranil Ghosh, May 21 2017 *)
(Python)
def T(a, b): return ((a + b)**2 + 3*a + b)/2
def A(n, k): return T(n^k, k)
for n in xrange(0, 21): print [A(k, n - k) for k in xrange(0, n + 1)] # Indranil Ghosh, May 21 2017
approved
editing
proposed
approved