Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A226736 Triangular numbers such that the binary representation is of the form either Tbt or Tt, where T and t are binary representations of triangular numbers with equal binary length, and b is a binary digit: b = 1 or 0. 1
3, 6, 15, 28, 105, 351, 496, 1830, 7140, 30876, 129795, 508536, 2029105, 8260080, 32817151, 33550336, 133179360, 533811475, 2139135936, 8564460003, 34292793216, 137220150385, 549219598080, 2197036652910, 8791800675840, 35164716131980, 140703139101696, 562926884985640 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The binary representation of the triangular number t (least significant bits of a(n)) is allowed to have leading zeros.
The sequence of indices of a(n) begins: 2, 3, 5, 7, 14, 26, 31, 60, 119, 248, 509, 1008, 2014, 4064, 8101, 8191, 16320, 32674, 65408, 130877, 261888, 523870, 1048064, 2096204, 4193280, 8386264, 16775168, 33553744, ...
LINKS
EXAMPLE
105 = (1101001)_2 = (110)_2//(1)_2//(001)_2 is in the sequence, where 105, (110)_2 = 6 and (001)_2=1 are each triangular numbers.
MAPLE
A000217 := proc(n)
n*(n+1) /2 ;
end proc:
isA000217 := proc(n)
local t1;
t1:=floor(sqrt(2*n));
if n = t1*(t1+1)/2 then
true
else
false;
end if;
end proc:
for n from 2 do
tmain := A000217(n) ;
dgs := convert(tmain, base, 2) ;
ndgs := floor(nops(dgs)/2) ;
tlo := [op(1..ndgs, dgs)] ;
if type(nops(dgs), 'even') then
thi := [op(ndgs+1..2*ndgs, dgs)] ;
else
thi := [op(ndgs+2..2*ndgs+1, dgs)] ;
end if;
tlo := add(op(i, tlo)*2^(i-1), i=1..nops(tlo)) ;
if isA000217(tlo) then
thi := add(op(i, thi)*2^(i-1), i=1..nops(thi)) ;
if isA000217(thi) then
printf("%d, \n", tmain) ;
end if;
end if;
end do: # R. J. Mathar, Jun 18 2013
PROG
(C)
#include <stdio.h>
#include <math.h>
typedef unsigned long long U64;
U64 isTriangular(U64 a) { // ! Must be a < (1<<63)
U64 s = sqrt(a*2);
return (s*(s+1) == a*2);
}
int main() {
U64 i, j, n, tn, t, T, prev=0;
for (n = tn = 3; tn > prev; prev = tn, tn += n, ++n) {
for (i = 64, j = tn; j < (1ULL<<63); j += j)
--i; // binary length of tn
j = i >> 1; // TOt or Tt, binary length of t is j
t = tn & ((1ULL<<j)-1);
T = tn >> (j+(i&1));
if (isTriangular(t) && isTriangular(T))
printf("%20llu %10llu %10llu\n", tn, T, t);
}
return 0;
}
CROSSREFS
Sequence in context: A086737 A063834 A139117 * A066708 A034464 A116696
KEYWORD
nonn,base,less
AUTHOR
Alex Ratushnyak, Jun 16 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 11 23:02 EDT 2024. Contains 375842 sequences. (Running on oeis4.)