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!)
A024638 n written in fractional base 6/5. 3

%I #40 Aug 08 2023 07:58:52

%S 0,1,2,3,4,5,50,51,52,53,54,55,540,541,542,543,544,545,5430,5431,5432,

%T 5433,5434,5435,54320,54321,54322,54323,54324,54325,543210,543211,

%U 543212,543213,543214,543215,5432100,5432101,5432102,5432103,5432104,5432105,5432150

%N n written in fractional base 6/5.

%H Andrew Howroyd, <a href="/A024638/b024638.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Ba#base_fractional">Index entries for sequences related to fractional bases</a>

%F To represent a number in base b, if a digit exceeds b, subtract b and carry 1. In fractional base a/b, subtract a and carry b.

%p a:= proc(n) `if`(n<1, 0, irem(n, 6, 'q')+a(5*q)*10) end:

%p seq(a(n), n=0..45); # _Alois P. Heinz_, Aug 19 2019

%t a[n_]:= If[n==0, 0, 10*a[5*Floor[n/6]] + Mod[n, 6]]; Table[a[n], {n, 0, 50}] (* _G. C. Greubel_, Aug 19 2019 *)

%o (Sage)

%o def basepqExpansion(p, q, n):

%o L, i = [n], 1

%o while L[i-1] >= p:

%o x = L[i-1]

%o L[i-1] = x.mod(p)

%o L.append(q*floor(x/p))

%o i += 1

%o L.reverse()

%o return Integer(''.join(map(str, L)))

%o [basepqExpansion(6,5,i) for i in [0..50]] # _Tom Edgar_, _Hailey R. Olafson_, and _James Van Alstine_, Jul 18 2014; modified and corrected by _Peter Luschny_, Aug 19 2019

%o (PARI) a(n) = {if(n<1, 0, a(n\6 * 5) * 10 + n%6)}; \\ _Andrew Howroyd_, Aug 19 2019

%Y Cf. A245321, A245399.

%Y Cf. A024629.

%K nonn,base

%O 0,3

%A _David W. Wilson_

%E Terms a(42) and beyond from _Andrew Howroyd_, Aug 19 2019

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 April 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)