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!)
A225884 Triangular numbers whose binary and decimal reversals are also triangular numbers. 0

%I #27 Jan 11 2016 03:55:17

%S 0,1,3,6,120,153,300

%N Triangular numbers whose binary and decimal reversals are also triangular numbers.

%C A subsequence of A061455.

%C a(8), if it exists, is > triangular(10^11) > 5*10^21. - _Lars Blomberg_, Jan 11 2016

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

%o (C)

%o #include <stdio.h>

%o #include <stdlib.h>

%o #include <math.h>

%o int isTriangular(unsigned long long a) {

%o unsigned long long sr = sqrt(a*2);

%o return (sr*(sr+1) == a*2);

%o }

%o int main() {

%o unsigned long long n, tn, t, r;

%o for (n = tn = 0; tn < (1ULL<<63); tn += ++n) {

%o for (r=0, t=tn; t; t>>=1) r = r*2 + (t&1);

%o if (isTriangular(r)==0) continue;

%o for (r=0, t=tn; t; t/=10) r = r*10 + (t%10);

%o if (isTriangular(r)==0) continue;

%o printf("%llu, ", tn);

%o }

%o return 0;

%o }

%Y Cf. A000217, A061455.

%K nonn,base,more

%O 1,3

%A _Alex Ratushnyak_, May 24 2013

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 6 12:42 EDT 2024. Contains 375712 sequences. (Running on oeis4.)