A325645 "Sloping quinary numbers": write numbers in quinary under each other (right-justified), read diagonals in upward direction, convert to decimal.
0, 1, 2, 3, 9, 5, 6, 7, 8, 14, 10, 11, 12, 13, 19, 15, 16, 17, 18, 24, 20, 21, 22, 48, 29, 25, 26, 27, 28, 34, 30, 31, 32, 33, 39, 35, 36, 37, 38, 44, 40, 41, 42, 43, 49, 45, 46, 47, 73, 54, 50, 51, 52, 53, 59, 55, 56, 57, 58, 64, 60, 61, 62, 63, 69, 65, 66, 67, 68, 74, 70, 71
Offset: 0
Links
- Seiichi Manyama, Table of n, a(n) for n = 0..10000
- Wikipedia, Quinary
Crossrefs
Programs
-
Ruby
def A(m, n) ary = [0] n.times{|i| (m ** i - i..m ** (i + 1) - i - 2).each{|j| ary << (0..i).inject(0){|s, k| s + (j + k).to_s(m)[-1 - k].to_i * m ** k} } } ary end p A(5, 3)