login
A225884
Triangular numbers whose binary and decimal reversals are also triangular numbers.
0
0, 1, 3, 6, 120, 153, 300
OFFSET
1,3
COMMENTS
A subsequence of A061455.
a(8), if it exists, is > triangular(10^11) > 5*10^21. - Lars Blomberg, Jan 11 2016
EXAMPLE
BinaryReverse(120) = 15, DecimalReverse(120) = 21. Because 120, 15 and 21 are triangular numbers, 120 is in the sequence.
PROG
(C)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int isTriangular(unsigned long long a) {
unsigned long long sr = sqrt(a*2);
return (sr*(sr+1) == a*2);
}
int main() {
unsigned long long n, tn, t, r;
for (n = tn = 0; tn < (1ULL<<63); tn += ++n) {
for (r=0, t=tn; t; t>>=1) r = r*2 + (t&1);
if (isTriangular(r)==0) continue;
for (r=0, t=tn; t; t/=10) r = r*10 + (t%10);
if (isTriangular(r)==0) continue;
printf("%llu, ", tn);
}
return 0;
}
CROSSREFS
Sequence in context: A157536 A046488 A074880 * A115647 A019437 A365505
KEYWORD
nonn,base,more
AUTHOR
Alex Ratushnyak, May 24 2013
STATUS
approved