OFFSET
0,4
COMMENTS
This is the octal version of Eric Angelini's A248034.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..32768
EXAMPLE
For n=16, we see that a(15) = 8, '10' in octal, and '0' has occurred just twice in the octal representations of terms a(0) .. a(15), namely in a(0) = 0 (which is also zero when read in octal base) and a(15), thus a(16) = 2.
PROG
(MIT/GNU Scheme with memoizing definec-macro from Antti Karttunen's IntSeq-library)
(definec (A249068 n) (if (zero? n) n (vector-ref (A249068aux_digit_counts (- n 1)) (modulo (A249068 (- n 1)) 8))))
(definec (A249068aux_digit_counts n) (cond ((zero? n) (vector 1 0 0 0 0 0 0 0)) (else (let loop ((digcounts-for-n (vector-copy (A249068aux_digit_counts (- n 1)))) (n (A249068 n))) (cond ((zero? n) digcounts-for-n) (else (vector-set! digcounts-for-n (modulo n 8) (+ 1 (vector-ref digcounts-for-n (modulo n 8)))) (loop digcounts-for-n (floor->exact (/ n 8)))))))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Oct 21 2014
STATUS
approved