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

A220689
Triangular numbers generated in A224218. That is, the triangular numbers generated by the operation triangular(i) XOR triangular(i+1) along increasing i.
3
1, 21, 21, 105, 105, 105, 105, 946, 946, 666, 1653, 666, 1378, 946, 1225, 946, 4005, 1378, 4005, 1378, 7381, 1225, 1378, 1653, 2485, 4005, 31125, 4005, 4005, 4005, 2485, 13861, 13861, 5356, 4005, 7381, 5356, 5356, 7381, 4005, 5356, 29161, 12561, 12561, 4186, 4186, 4186, 4186
OFFSET
1,2
FORMULA
a(n) = A000217(A224218(n)) XOR A000217(A224218(n)+1).
MAPLE
read("transforms") ;
A220689 := proc(n)
i := A224218(n) ;
XORnos(A000217(i), A000217(i+1)) ;
end proc: # R. J. Mathar, Apr 23 2013
MATHEMATICA
nmax = 100;
pmax = 2 nmax^2; (* increase coeff 2 if A224218 is too short *)
A224218 = Join[{0}, Flatten[Position[Partition[Accumulate[Range[pmax]], 2, 1], _?(OddQ[Sqrt[1 + 8 BitXor[#[[1]], #[[2]]]]]&), {1}, Heads -> False]]];
a[n_] := Module[{i}, i = A224218[[n]]; BitXor[PolygonalNumber[i], PolygonalNumber[i+1]]];
Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Aug 07 2023, after Harvey P. Dale in A224218 *)
PROG
(Python)
def rootTriangular(a):
sr = 1<<33
while a < sr*(sr+1)//2:
sr>>=1
b = sr>>1
while b:
s = sr+b
if a >= s*(s+1)//2:
sr = s
b>>=1
return sr
for i in range(1<<12):
s = (i*(i+1)//2) ^ ((i+1)*(i+2)//2)
t = rootTriangular(s)
if s == t*(t+1)//2:
print(str(s), end=', ')
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Apr 13 2013
STATUS
approved