A030998 Write n in base 7 and juxtapose.
0, 1, 2, 3, 4, 5, 6, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 3, 5, 3, 6, 4, 0, 4, 1, 4, 2, 4, 3, 4, 4, 4, 5, 4, 6, 5, 0, 5, 1, 5, 2, 5, 3, 5, 4, 5, 5, 5, 6, 6, 0, 6, 1, 6, 2, 6, 3, 6, 4, 6, 5, 6, 6
Offset: 0
Crossrefs
Programs
-
Magma
[0]cat &cat[Reverse(IntegerToSequence(n,7)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
-
Mathematica
Flatten[IntegerDigits[#,7]&/@Range[0,60]] (* Harvey P. Dale, Mar 04 2011 *) almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ almostNatural[#, 7] &, 105, 0] (* Robert G. Wilson v, Jun 29 2014 *)
-
Python
from itertools import count, chain, islice from sympy.ntheory.factor_ import digits def A030998_gen(): return chain.from_iterable(digits(m, 7)[1:] for m in count(0)) A030998_list = list(islice(A030998_gen(), 30)) # Chai Wah Wu, Jan 07 2022
Comments