[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A249068
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.
2
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, 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, 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
OFFSET
0,4
COMMENTS
This is the octal version of Eric Angelini's A248034.
LINKS
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
Cf. A248034 (analogous sequence in base-10), A007094 (octal representation of n).
Sequence in context: A378359 A162520 A342703 * A308073 A090331 A338759
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Oct 21 2014
STATUS
approved