cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A257079 The least nonzero digit missing from the factorial representation (A007623) of n.

This page as a plain text file.
%I A257079 #19 Dec 23 2024 14:53:44
%S A257079 1,2,2,2,1,3,2,2,2,2,3,3,1,3,3,3,1,3,1,2,2,2,1,4,2,2,2,2,3,3,2,2,2,2,
%T A257079 3,3,3,3,3,3,3,3,2,2,2,2,4,4,1,3,3,3,1,3,3,3,3,3,3,3,1,3,3,3,1,3,1,4,
%U A257079 4,4,1,4,1,2,2,2,1,4,2,2,2,2,4,4,1,4,4,4,1,4,1,2,2,2,1,4,1,2,2,2,1,3,2,2,2,2,3,3,1,3,3,3,1,3,1,2,2,2,1,5,2
%N A257079 The least nonzero digit missing from the factorial representation (A007623) of n.
%H A257079 Antti Karttunen, <a href="/A257079/b257079.txt">Table of n, a(n) for n = 0..10080</a>
%H A257079 Eric Angelini, et al., <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2015-April/014728.html">"Multiply by the fantom digit", Discussion on Seqfan-list</a>.
%F A257079 Other identities:
%F A257079 For all n >= 1, a(A033312(n)) = n. [n! - 1 gives the first position where n appears. Note also how the digits in factorial base representation may get arbitrarily large values.]
%e A257079 The least digit > 0 missing from the factorial representation (A007623) of zero, "0", is 1, thus a(0) = 1.
%e A257079 The least digit > 0 missing from the factorial representation of one, "1", is 2, thus a(1) = 2.
%e A257079 The least digit > 0 missing from the factorial representation of 21, "311", is 2, thus a(21) = 2.
%t A257079 a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; Min[Complement[Range[Max[s]+1], s]]]; a[0] = 1; Array[a, 100, 0] (* _Amiram Eldar_, Jan 24 2024 *)
%o A257079 (Scheme)
%o A257079 (define (A257079 n) (let loop ((digs (uniq (sort (n->factbase n) <))) (mnp 1)) (cond ((null? digs) mnp) ((zero? (car digs)) (loop (cdr digs) mnp)) ((= (car digs) mnp) (loop (cdr digs) (+ 1 mnp))) (else mnp))))
%o A257079 ;; Convert an integer to a factorial expansion list:
%o A257079 (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))))))
%o A257079 (define (uniq lista) (let loop ((lista lista) (z (list))) (cond ((null? lista) (reverse! z)) ((and (pair? z) (equal? (car z) (car lista))) (loop (cdr lista) z)) (else (loop (cdr lista) (cons (car lista) z))))))
%Y A257079 Cf. A007623, A257080.
%Y A257079 Cf. A033312 (the positions of records from a(1) onward.)
%Y A257079 Cf. A255411 (the positions of ones.)
%K A257079 nonn,base
%O A257079 0,2
%A A257079 _Antti Karttunen_, Apr 15 2015