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!)
A303787 a(n) = Sum_{i=0..m} d(i)*4^i, where Sum_{i=0..m} d(i)*5^i is the base-5 representation of n. 3

%I #50 Jan 03 2021 14:37:08

%S 0,1,2,3,4,4,5,6,7,8,8,9,10,11,12,12,13,14,15,16,16,17,18,19,20,16,17,

%T 18,19,20,20,21,22,23,24,24,25,26,27,28,28,29,30,31,32,32,33,34,35,36,

%U 32,33,34,35,36,36,37,38,39,40,40,41,42,43,44,44,45,46,47,48,48,49,50,51

%N a(n) = Sum_{i=0..m} d(i)*4^i, where Sum_{i=0..m} d(i)*5^i is the base-5 representation of n.

%H Seiichi Manyama, <a href="/A303787/b303787.txt">Table of n, a(n) for n = 0..10000</a>

%e 13 = 23_5, so a(13) = 2*4 + 3 = 11.

%e 14 = 24_5, so a(14) = 2*4 + 4 = 12.

%e 15 = 30_5, so a(15) = 3*4 + 0 = 12.

%e 16 = 31_5, so a(16) = 3*4 + 1 = 13.

%o (Ruby)

%o def f(k, ary)

%o (0..ary.size - 1).inject(0){|s, i| s + ary[i] * k ** i}

%o end

%o def A(k, n)

%o (0..n).map{|i| f(k, i.to_s(k + 1).split('').map(&:to_i).reverse)}

%o end

%o p A(4, 100)

%o (PARI) a(n) = fromdigits(digits(n, 5), 4); \\ _Michel Marcus_, May 02 2018

%o (Julia)

%o function a(n)

%o m, r, b = n, 0, 1

%o while m > 0

%o m, q = divrem(m, 5)

%o r += b * q

%o b *= 4

%o end

%o r end; [a(n) for n in 0:73] |> println # _Peter Luschny_, Jan 03 2021

%Y Sum_{i=0..m} d(i)*b^i, where Sum_{i=0..m} d(i)*(b+1)^i is the base (b+1) representation of n: A065361 (b=2), A215090 (b=3), this sequence (b=4), A303788 (b=5), A303789 (b=6).

%Y Cf. A020654, A037459.

%K nonn,base

%O 0,3

%A _Seiichi Manyama_, Apr 30 2018

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 24 08:48 EDT 2024. Contains 371930 sequences. (Running on oeis4.)