login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A276004 a(n) = number of nonzero digits in factorial base representation of n that are hit by more significant digits from left; a(n) = A060502(n) - A060128(n). 6
0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 2, 3, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 0, 0, 1, 2, 1, 1, 0, 0, 1, 2, 1, 1, 0, 1, 1, 2, 1, 2, 0, 0, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,10

COMMENTS

a(n) = Number of times a nonzero digit d_i appears in position i of factorial base representation of n (where the least significant digit is in the position 1) such that there is another nonzero digit d_j in such position j > i that j - d_j = i.

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..40320

Index entries for sequences related to factorial base representation

FORMULA

a(n) = A060502(n) - A060128(n).

a(n) = A000120(2*A275727(n) AND A276010(n)), where AND is a bitwise-and given in A004198.

EXAMPLE

For n=15 ("211" in factorial base) the least significant 1 at position 1 is hit by its immediate left neighbor 1 and also by 2 at position 3, as (2-1) = (3-2) = 1, the position where the least significant 1 itself is. However, this is counted just as one hit, because this sequence gives the number of digits that are hit, instead of number digits that hit, thus a(15)=1.

PROG

(Scheme, two variants)

(define (A276004 n) (- (A060502 n) (A060128 n)))

(define (A276004 n) (let ((fv (list->vector (cons 0 (reverse (n->factbase n)))))) (let loop ((i 1) (c 0)) (if (>= i (vector-length fv)) c (let ((d (vector-ref fv i))) (cond ((zero? d) (loop (+ 1 i) c)) ((zero? (vector-ref fv (- i d))) (loop (+ 1 i) c)) (else (begin (vector-set! fv (- i d) 0) (loop (+ 1 i) (+ 1 c))))))))))

(define (n->factbase n) (let loop ((n n) (fex (if (zero? n) (list 0) (list))) (i 2)) (cond ((zero? n) fex) (else (loop (floor->exact (/ n i)) (cons (modulo n i) fex) (+ 1 i))))))

CROSSREFS

Cf. A000120, A004198, A060128, A060502, A275727, A276010.

Cf. A276005 (indices of zeros), A276006 (of nonzeros).

Differs from A276007 for the first time at n=15, where a(15)=1, while A276004(15)=2.

Sequence in context: A287156 A092510 A117208 * A133300 A178779 A144451

Adjacent sequences:  A276001 A276002 A276003 * A276005 A276006 A276007

KEYWORD

nonn,base

AUTHOR

Antti Karttunen, Aug 17 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 25 05:40 EDT 2019. Contains 326319 sequences. (Running on oeis4.)