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.

A246831 a(n) is the concatenation of n and 3n in binary.

This page as a plain text file.
%I A246831 #18 May 22 2025 10:21:40
%S A246831 0,7,22,57,76,95,210,245,280,315,350,737,804,871,938,1005,1072,1139,
%T A246831 1206,1273,1340,1407,2882,3013,3144,3275,3406,3537,3668,3799,3930,
%U A246831 4061,4192,4323,4454,4585,4716,4847,4978,5109,5240,5371,5502,11137,11396,11655
%N A246831 a(n) is the concatenation of n and 3n in binary.
%H A246831 Alois P. Heinz, <a href="/A246831/b246831.txt">Table of n, a(n) for n = 0..10000</a>
%F A246831 a(n) = A246830(2n,n).
%e A246831 a(0) = (0|0)_2 = 0.
%e A246831 a(1) = (1|11)_2 = 7.
%e A246831 a(2) = (10|110)_2 = 22.
%e A246831 a(3) = (11|1001)_2 = 57.
%e A246831 a(4) = (100|1100)_2 = 76.
%e A246831 a(5) = (101|1111)_2 = 95.
%p A246831 f:= proc(i, j) local r, h, k; r:=0; h:=0; k:=j;
%p A246831       while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; k:=i;
%p A246831       while k>0 do r:=r+2^h*irem(k, 2, 'k'); h:=h+1 od; r
%p A246831     end:
%p A246831 a:= n-> f(n, 3*n):
%p A246831 seq(a(n), n=0..60);
%o A246831 (Python)
%o A246831 def A246831(n):
%o A246831     return int(bin(n)[2:]+bin(3*n)[2:],2) # _Chai Wah Wu_, Sep 05 2014
%Y A246831 Cf. A246830. Column k=3 of A246834.
%K A246831 nonn,base
%O A246831 0,2
%A A246831 _Alois P. Heinz_, Sep 04 2014