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.

A024631 n written in fractional base 4/3.

This page as a plain text file.
%I A024631 #29 Sep 23 2022 02:33:57
%S A024631 0,1,2,3,30,31,32,33,320,321,322,323,3210,3211,3212,3213,32100,32101,
%T A024631 32102,32103,32130,32131,32132,32133,321020,321021,321022,321023,
%U A024631 321310,321311,321312,321313,3210200,3210201,3210202,3210203,3210230,3210231
%N A024631 n written in fractional base 4/3.
%H A024631 G. C. Greubel, <a href="/A024631/b024631.txt">Table of n, a(n) for n = 0..1000</a>
%H A024631 K. Burde, <a href="http://dx.doi.org/10.1016/0022-314X(87)90078-3">Das Problem der Abzählreime und Zahlentwicklungen mit gebrochenen Basen [The problem of counting rhymes and number expansions with fractional bases]</a>, J. Number Theory 26(2) (1987), 192-209. [The author deals with the representation of n in fractional bases k/(k-1) and its relation to counting-off games (variations of Josephus problem). Here k = 4. See the review in MathSciNet (MR0889384) by R. G. Stoneham.]
%H A024631 <a href="/index/J#Josephus">Index entries for sequences related to the Josephus Problem</a>
%F A024631 To represent a number in base b, if a digit is greater than or equal to b, subtract b and carry 1. In fractional base a/b, subtract a and carry b.
%p A024631 a:= proc(n) `if`(n<1, 0, irem(n, 4, 'q')+a(3*q)*10) end:
%p A024631 seq(a(n), n=0..45);  # _Alois P. Heinz_, Aug 20 2019
%t A024631 p:= 4; q:= 3; a[n_]:= a[n]= If[n==0, 0, 10*a[q*Floor[n/p]] + Mod[n, p]]; Table[a[n], {n,0,40}] (* _G. C. Greubel_, Aug 20 2019 *)
%o A024631 (PARI) a(n) = my(p=4, q=3); if(n==0,0, 10*a(q*(n\p)) + (n%p));
%o A024631 vector(40, n, n--; a(n)) \\ _G. C. Greubel_, Aug 20 2019
%o A024631 (Sage)
%o A024631 def basepqExpansion(p, q, n):
%o A024631     L, i = [n], 1
%o A024631     while L[i-1] >= p:
%o A024631         x=L[i-1]
%o A024631         L[i-1]=x.mod(p)
%o A024631         L.append(q*(x//p))
%o A024631         i+=1
%o A024631     return Integer(''.join(str(x) for x in reversed(L)))
%o A024631 [basepqExpansion(4,3,n) for n in [0..40]] # _G. C. Greubel_, Aug 20 2019
%Y A024631 Cf. A244041 (sum of digits).
%Y A024631 Cf. A024629 (base 3/2).
%K A024631 nonn,base,easy
%O A024631 0,3
%A A024631 _David W. Wilson_