%I #10 Oct 25 2014 14:46:43
%S 0,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,2,2,3,2,4,2,5,2,6,2,7,2,8,3,3,4,3,5,
%T 3,6,3,7,3,8,4,4,5,4,6,4,7,4,8,5,5,6,5,7,5,8,6,6,7,6,8,7,7,8,8,9,18,
%U 10,11,9,22,9,24,10,13,9,28,9,30,10,14,11,13,10,15,9,38,12,11,14,13,11,15
%N a(n+1) gives the number of occurrences of the last digit of a(n) in octal base so far, up to and including a(n), with a(0)=0.
%C This is the octal version of _Eric Angelini_'s A248034.
%H Antti Karttunen, <a href="/A249068/b249068.txt">Table of n, a(n) for n = 0..32768</a>
%e 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.
%o (MIT/GNU Scheme with memoizing definec-macro from _Antti Karttunen_'s IntSeq-library)
%o (definec (A249068 n) (if (zero? n) n (vector-ref (A249068aux_digit_counts (- n 1)) (modulo (A249068 (- n 1)) 8))))
%o (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)))))))))
%Y Cf. A248034 (analogous sequence in base-10), A007094 (octal representation of n).
%K nonn,base
%O 0,4
%A _Antti Karttunen_, Oct 21 2014
|