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.

A037095 "Sloping binary representation" of powers of 3 (A000244), slope = -1.

This page as a plain text file.
%I A037095 #33 Jul 08 2025 21:04:54
%S A037095 1,1,3,1,3,9,11,17,19,25,123,65,195,169,171,753,435,249,2267,4065,
%T A037095 8163,841,843,31313,29651,39769,38331,30081,160643,49769,53867,563377,
%U A037095 700659,1611961,760731,1207073,5668771,5566345,11844619,8699025,10386067,55868313
%N A037095 "Sloping binary representation" of powers of 3 (A000244), slope = -1.
%H A037095 Alois P. Heinz, <a href="/A037095/b037095.txt">Table of n, a(n) for n = 0..2000</a>
%F A037095 a(n) = A339601(A000244(n)). - _Antti Karttunen_, Dec 09 2020
%e A037095 When powers of 3 are written in binary (see A004656), under each other as:
%e A037095   000000000001 (1)
%e A037095   000000000011 (3)
%e A037095   000000001001 (9)
%e A037095   000000011011 (27)
%e A037095   000001010001 (81)
%e A037095   000011110011 (243)
%e A037095   001011011001 (729)
%e A037095   100010001011 (2187)
%e A037095 and one collects their bits from the column-0 to NW-direction (from the least to the most significant end), one gets 1 (1), 01 (1), 011 (3), 0001 (1), 00011 (3), 001001 (9), etc. (See A105033 for similar transformation done on nonnegative integers, A001477).
%p A037095 A037095:= n-> add(bit_n(3^(n-i), i)*(2^i), i=0..n):
%p A037095 bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2):
%p A037095 seq(A037095(n), n=0..41);
%p A037095 # second Maple program:
%p A037095 b:= proc(n) option remember; `if`(n=0, 1, (p->
%p A037095        expand((p-(p mod 2))*x/2)+3^n)(b(n-1)))
%p A037095     end:
%p A037095 a:= n-> subs(x=2, b(n) mod 2):
%p A037095 seq(a(n), n=0..42);  # _Alois P. Heinz_, Dec 10 2020
%o A037095 (PARI)
%o A037095 A339601(n) = { my(m=1, s=0); while(n>=m, s += bitand(m,n); m <<= 1; n \= 3); (s); };
%o A037095 A037095(n) = A339601(3^n); \\ _Antti Karttunen_, Dec 09 2020
%o A037095 (PARI)
%o A037095 BINSLOPE(f) = n -> sum(i=0,n,bitand(2^(n-i),f(i))); \\ General transformation for these kinds of sequences.
%o A037095 A037095 = BINSLOPE(n -> 3^n); \\ And its application to A000244. - _Antti Karttunen_, Dec 09 2020
%Y A037095 Cf. A105033, A000244, A037093, A037094, A037096, A037097, A339601.
%K A037095 nonn,base
%O A037095 0,3
%A A037095 _Antti Karttunen_, Jan 28 1999
%E A037095 Entry revised Dec 29 2007
%E A037095 More terms from _Sean A. Irvine_, Dec 08 2020