cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A225884 Triangular numbers whose binary and decimal reversals are also triangular numbers.

Original entry on oeis.org

0, 1, 3, 6, 120, 153, 300
Offset: 1

Views

Author

Alex Ratushnyak, May 24 2013

Keywords

Comments

A subsequence of A061455.
a(8), if it exists, is > triangular(10^11) > 5*10^21. - Lars Blomberg, Jan 11 2016

Examples

			BinaryReverse(120) = 15, DecimalReverse(120) = 21. Because 120, 15 and 21 are triangular numbers, 120 is in the sequence.
		

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    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;
    }