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.

Showing 1-6 of 6 results.

A230421 Triangle A230420 transposed.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 4, 4, 5, 6, 12, 14, 16, 19, 22, 55, 59, 65, 73, 82, 94, 293, 314, 336, 362, 395, 432, 479, 1881, 1971, 2073, 2189, 2324, 2482, 2667, 2886, 14011, 14555, 15140, 15775, 16473, 17249, 18124, 19123, 20276, 115974, 120010, 124289, 128831, 133664, 138828, 144378, 150389, 156961, 164224
Offset: 1

Views

Author

Antti Karttunen, Oct 18 2013

Keywords

Examples

			The first rows of this triangular table are:
1;
1, 1;
1, 2, 2;
4, 4, 5, 6;
12, 14, 16, 19, 22;
55, 59, 65, 73, 82, 94;
...
		

Crossrefs

Transpose: A230420. Row sums: A219661.

Programs

Formula

a(n) = A230420(A038722(n)).

A219666 The infinite trunk of factorial expansion beanstalk. The only infinite sequence such that a(n-1) = a(n) - sum of digits in factorial expansion of a(n).

Original entry on oeis.org

0, 1, 2, 5, 7, 10, 12, 17, 23, 25, 28, 30, 35, 40, 46, 48, 52, 57, 63, 70, 74, 79, 85, 92, 97, 102, 109, 119, 121, 124, 126, 131, 136, 142, 144, 148, 153, 159, 166, 170, 175, 181, 188, 193, 198, 204, 213, 221, 228, 238, 240, 244, 249, 255, 262, 266, 271, 277
Offset: 0

Views

Author

Antti Karttunen, Nov 25 2012

Keywords

Comments

a(n) tells in what number we end in n steps, when we start climbing up the infinite trunk of the "factorial beanstalk" from its root (zero).
There are many finite sequences such as 0,1,2,4; 0,1,2,5,6; etc. obeying the same condition (see A219659) and as the length increases, so (necessarily) does the similarity to this infinite sequence.
See A007623 for the factorial number system representation.

Crossrefs

Cf. A007623, A034968, A219651, A230411, A226061. For all n, A219652(a(n)) = n and A219653(n) <= a(n) <= A219655(n).
Characteristic function: Χ_A219666(n) = A230418(n+1)-A230418(n).
The first differences: A230406.
Subsets: A230428 & A230429.
Analogous sequence for binary system: A179016, for Fibonacci number system: A219648.

Programs

  • Mathematica
    nn = 10^3; m = 1; While[m! < Floor[6 nn/5], m++]; m; t = TakeWhile[Reverse@ NestWhileList[# - Total@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] &, Floor[6 nn/5], # > 0 &], # <= nn &] (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)
  • Scheme
    ;; Memoizing definec-macro from Antti Karttunen's IntSeq-library
    (definec (A219666 n) (cond ((<= n 2) n) ((= (A226061 (A230411 n)) n) (- (A000142 (A230411 n)) 1)) (else (- (A219666 (+ n 1)) (A034968 (A219666 (+ n 1)))))))
    ;; Another variant, utilizing A230416 (which gives a more convenient way to compute large number of terms of this sequence):
    (define (A219666 n) (A230416 (A230432 n)))
    ;; This function is for checking whether n belongs to this sequence:
    (define (inA219666? n) (or (zero? n) (= 1 (- (A230418 (+ 1 n)) (A230418 n)))))

Formula

a(0) = 0, a(1) = 1, and for n>1, if A226061(A230411(n)) = n then a(n) = A230411(n)!-1, otherwise a(n) = a(n+1) - A034968(a(n+1)).
a(n) = A230416(A230432(n)).

A099563 a(0) = 0; for n > 0, a(n) = final nonzero number in the sequence n, f(n,2), f(f(n,2),3), f(f(f(n,2),3),4),..., where f(n,d) = floor(n/d); the most significant digit in the factorial base representation of n.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 0

Views

Author

John W. Layman, Oct 22 2004

Keywords

Comments

Records in {a(n)} occur at {1,4,18,96,600,4320,35280,322560,3265920,...}, which appears to be n*n! = A001563(n).
The most significant digit in the factorial expansion of n (A007623). Proof: The algorithm that computes the factorial expansion of n, generates the successive digits by repeatedly dividing the previous quotient with successively larger divisors (the remainders give the digits), starting from n itself and divisor 2. As a corollary we find that A001563 indeed gives the positions of the records. - Antti Karttunen, Jan 01 2007.

Examples

			For n=15, f(15,2) = floor(15/2)=7, f(7,3)=2, f(2,4)=0, so a(15)=2.
From _Antti Karttunen_, Dec 24 2015: (Start)
Example illustrating the role of this sequence in factorial base representation:
   n  A007623(n)       a(n) [= the most significant digit].
   0 =   0               0
   1 =   1               1
   2 =  10               1
   3 =  11               1
   4 =  20               2
   5 =  21               2
   6 = 100               1
   7 = 101               1
   8 = 110               1
   9 = 111               1
  10 = 120               1
  11 = 121               1
  12 = 200               2
  13 = 201               2
  14 = 210               2
  15 = 211               2
  16 = 220               2
  17 = 221               2
  18 = 300               3
  etc.
Note that there is no any upper bound for the size of digits in this representation.
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[Floor[n/#] &@ (k = 1; While[(k + 1)! <= n, k++]; k!), {n, 0, 120}] (* Michael De Vlieger, Aug 30 2016 *)
  • PARI
    A099563(n) = { my(i=2,dig=0); until(0==n, dig = n % i; n = (n - dig)/i; i++); return(dig); }; \\ Antti Karttunen, Dec 24 2015
    
  • Python
    def a(n):
        i=2
        d=0
        while n:
            d=n%i
            n=(n - d)//i
            i+=1
        return d
    print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 21 2017, after PARI code
  • Scheme
    (define (A099563 n) (let loop ((n n) (i 2)) (let* ((dig (modulo n i)) (next-n (/ (- n dig) i))) (if (zero? next-n) dig (loop next-n (+ 1 i))))))
    (definec (A099563 n) (cond ((zero? n) n) ((= 1 (A265333 n)) 1) (else (+ 1 (A099563 (A257684 n)))))) ;; Based on given recurrence, using the memoization-macro definec
    ;; Antti Karttunen, Dec 24-25 2015
    

Formula

From Antti Karttunen, Dec 25 2015: (Start)
a(0) = 0; for n >= 1, if A265333(n) = 1 [when n is one of the terms of A265334], a(n) = 1, otherwise 1 + a(A257684(n)).
Other identities. For all n >= 0:
a(A001563(n)) = n. [Sequence works as a left inverse for A001563.]
a(n) = A257686(n) / A048764(n).
(End)

Extensions

a(0) = 0 prepended and the alternative description added to the name-field by Antti Karttunen, Dec 24 2015

A219661 Number of steps to go from (n+1)!-1 to n!-1 with map x -> x - (sum of digits in factorial base representation of x).

Original entry on oeis.org

1, 2, 5, 19, 83, 428, 2611, 18473, 150726, 1377548, 13851248, 152610108, 1835293041, 23925573979, 335859122743, 5049372125352, 80942722123544, 1378487515335424, 24858383452927384, 473228664468684846
Offset: 1

Views

Author

Antti Karttunen, Dec 03 2012

Keywords

Examples

			(1!)-1 (0) is reached from (2!)-1 (1) with one step by subtracting A034968(1) from 1.
(2!)-1 (1) is reached from (3!)-1 (5) with two steps by first subtracting A034968(5) from 5 -> 2, and then subtracting A034968(2) from 2 -> 1.
(3!)-1 (5) is reached from (4!)-1 (23) with five steps by repeatedly subtracting the sum of digits in factorial expansion as: 23 - 6 = 17, 17 - 5 = 12, 12 - 2 = 10, 10 - 3 = 7, 7 - 2 = 5.
Thus a(1)=1, a(2)=2 and a(3)=5.
		

Crossrefs

Row sums of A230420 and A230421.
Cf. also A213709 (analogous sequence for base-2), A261234 (for base-3).

Programs

  • Mathematica
    Table[Length@ NestWhileList[# - Total@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, 120]]] &, (n + 1)! - 1, # > n! - 1 &] - 1, {n, 0, 8}] (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)
  • Scheme
    (define (A219661 n) (if (zero? n) n (let loop ((i (-1+ (A000142 (1+ n)))) (steps 1)) (cond ((isA000142? (1+ (A219651 i))) steps) (else (loop (A219651 i) (1+ steps)))))))
    (define (isA000142? n) (and (> n 0) (let loop ((n n) (i 2)) (cond ((= 1 n) #t) ((not (zero? (modulo n i))) #f) (else (loop (/ n i) (1+ i)))))))
    ;; Alternative definition:
    (define (A219661 n) (- (A219652 (-1+ (A000142 (1+ n)))) (A219652 (-1+ (A000142 n)))))

Formula

a(n) = A219652((n+1)!-1) - A219652(n!-1).
a(n) = A219662(n) + A219663(n).

Extensions

Terms a(16) - a(20) computed with Hiroaki Yamanouchi's Python-program by Antti Karttunen, Jun 27 2016

A230428 Triangle T(n,k) giving the smallest term in "the infinite trunk of factorial beanstalk" (A219666) whose factorial base representation contains n digits (A084558) and the most significant such digit (A099563) is k.

Original entry on oeis.org

1, 2, 5, 7, 12, 23, 25, 48, 74, 97, 121, 240, 362, 481, 605, 721, 1440, 2162, 2881, 3605, 4326, 5041, 10080, 15122, 20161, 25205, 30246, 35288, 40321, 80640, 120962, 161281, 201605, 241926, 282248, 322568, 362881, 725760, 1088642, 1451521, 1814405, 2177286, 2540168, 2903048, 3265923
Offset: 1

Views

Author

Antti Karttunen, Oct 18 2013

Keywords

Examples

			The first rows of this triangular table are:
1;
2, 5;
7, 12, 23;
25, 48, 74, 97;
121, 240, 362, 481, 605;
...
T(3,1) = 7 as 7 has factorial base representation 101, which is the smallest such three digit term in A219666 beginning with factorial base digit 1 (in other words, for which A084558(x)=3 and A099563(x)=1).
T(3,2) = 12 as 12 has factorial base representation 200, which is the smallest such three digit term in A219666 beginning with factorial base digit 2.
T(3,3) = 23 as 23 has factorial base representation 321, which is the smallest such three digit term in A219666 beginning with factorial base digit 3.
		

Crossrefs

Subset of A219666. Corresponding largest terms: A230429. Cf. also A230420.

Programs

  • Scheme
    (define (A230428 n) (if (< n 3) n (let ((k (A002260 n))) (let loop ((i (A230429 n)) (prev_i 0)) (cond ((not (= (A099563 i) k)) prev_i) (else (loop (A219651 i) i)))))))

A230429 Triangle T(n,k) giving the largest member of "the infinite trunk of factorial beanstalk" (A219666) whose factorial base representation contains n digits (A084558) and the most significant such digit (A099563) is k.

Original entry on oeis.org

1, 2, 5, 10, 17, 23, 46, 70, 92, 119, 238, 358, 476, 597, 719, 1438, 2158, 2876, 3597, 4319, 5039, 10078, 15118, 20156, 25197, 30239, 35279, 40319, 80638, 120958, 161276, 201597, 241919, 282239, 322558, 362879, 725758, 1088638, 1451516, 1814397, 2177279, 2540159, 2903038, 3265912, 3628799
Offset: 1

Views

Author

Antti Karttunen, Oct 18 2013

Keywords

Comments

See A007623 for the factorial number system representation.

Examples

			The first rows of this triangular table are:
1;
2, 5;
10, 17, 23;
46, 70, 92, 119;
238, 358, 476, 597, 719;
...
T(3,1) = 10 as 10 has factorial base representation 120, which is the largest such three digit term in A219666 beginning with factorial base digit 1 (in other words, for which A084558(x)=3 and A099563(x)=1).
T(3,2) = 17 as 17 has factorial base representation 221, which is the largest such three digit term in A219666 beginning with factorial base digit 2.
T(3,3) = 23 as 23 has factorial base representation 321, which is the largest such three digit term in A219666 beginning with factorial base digit 3.
		

Crossrefs

Subset of A219666. Corresponding smallest terms: A230428. Can be used to compute A230420. Right edge: A033312.

Programs

Showing 1-6 of 6 results.