OFFSET
1,2
COMMENTS
Apart from the initial term, identical to A054634.
Should not be merged with A054634 because there are many sequences which depend on this sequence starting with a 1. - N. J. A. Sloane, Jan 30 2010
An irregular table in which the n-th row lists the base-8 digits of n. - Jason Kimberley, Dec 07 2012
The base-8 Champernowne constant: it is normal in base 8. - Jason Kimberley, Dec 07 2012
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
seq(op(ListTools:-Reverse(convert(n, base, 8))), n=1..100); # Robert Israel, Nov 12 2024
MATHEMATICA
Flatten[ IntegerDigits[ Range[40], 8]] (* or *)
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[#, 8] &, 105] (* Robert G. Wilson v, Jun 29 2014 *)
PROG
(Magma) &cat[Reverse(IntegerToSequence(n, 8)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
(Python)
from itertools import count, islice
from sympy.ntheory.factor_ import digits
def A031035_gen(): return (d for m in count(1) for d in digits(m, 8)[1:])
(Python)
from oeis_sequences.OEISsequences import bisection, bsearch
def A031035(n):
def g(x): return x+(m:=(x.bit_length()+2)//3)*(x+1)-((1<<3*(m-1))-1<<3)//7 if x else 1
def f(x): return n+1+bsearch(g, x)
return int((s:=oct(a:=bisection(f, n+1, n+1)-n)[2:])[n-1-a*(k:=len(s))+((1<<3*k)-1)//7]) # Chai Wah Wu, Mar 02 2026
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved
