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-10 of 14 results. Next

A219655 Greatest inverse of A219652; a(n) = maximal i such that A219652(i) = n.

Original entry on oeis.org

0, 1, 3, 5, 7, 11, 15, 19, 23, 25, 29, 33, 37, 41, 47, 51, 55, 59, 65, 71, 77, 83, 89, 95, 101, 107, 115, 119, 121, 125, 129, 133, 137, 143, 147, 151, 155, 161, 167, 173, 179, 185, 191, 197, 203, 211, 217, 225, 233, 239, 243, 247, 251, 257, 263, 269, 275, 281
Offset: 0

Views

Author

Antti Karttunen, Nov 25 2012

Keywords

Crossrefs

Cf. A219653 for the least inverse. A219654 gives the first differences.
This sequence is based on factorial number system: A007623. Analogous sequence for binary system: A173601, for Zeckendorf expansion: A219645.

Formula

a(n) = A219653(n) + A219654(n) - 1.

A219653 Least inverse of A219652; a(n) = minimal i such that A219652(i) = n.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 16, 20, 24, 26, 30, 34, 38, 42, 48, 52, 56, 60, 66, 72, 78, 84, 90, 96, 102, 108, 116, 120, 122, 126, 130, 134, 138, 144, 148, 152, 156, 162, 168, 174, 180, 186, 192, 198, 204, 212, 218, 226, 234, 240, 244, 248, 252, 258, 264, 270, 276
Offset: 0

Views

Author

Antti Karttunen, Nov 25 2012

Keywords

Crossrefs

Cf. A219655 for the greatest inverse. A219654 gives the first differences.
This sequence is based on Factorial number system: A007623. Analogous sequence for binary system: A213708 and for Zeckendorf expansion: A219643. Cf. A219652, A219659, A219666.

A219662 Number of times an even number is encountered, when going from (n+1)!-1 to n!-1 using the iterative process described in A219652.

Original entry on oeis.org

1, 1, 2, 10, 49, 268, 1505, 9667, 81891, 779193, 7726623, 80770479, 921442854, 11621384700, 159894957124
Offset: 1

Views

Author

Antti Karttunen, Dec 03 2012

Keywords

Comments

At least for n=7, 8, 9 and 10, a(n) is equal to a(n+1) when taken modulo n.

Examples

			(1!)-1 (0) is reached from (2!)-1 (1) with one step by subtracting A034968(1) from 1. Zero is an even number, so a(1)=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. Two is an even number, but one is not, so a(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. Of these only 12 and 10 are even numbers, so a(3)=2.
		

Crossrefs

Programs

  • Scheme
    (definec (A219662 n) (if (< n 2) n (let loop ((i (- (A000142 (1+ n)) (A000217 n) 1)) (s 0)) (cond ((isA000142? (1+ i)) (+ s (- 1 (modulo i 2)))) (else (loop (A219651 i) (+ s (- 1 (modulo i 2)))))))))
    (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)))))))

Formula

a(n) = A219661(n) - A219663(n).

A219663 Number of times an odd number is encountered, when going from (n+1)!-1 to n!-1 using the iterative process described in A219652.

Original entry on oeis.org

0, 1, 3, 9, 34, 160, 1106, 8806, 68835, 598355, 6124625, 71839629, 913850187, 12304189279, 175964165619
Offset: 1

Views

Author

Antti Karttunen, Dec 03 2012

Keywords

Comments

Ratio a(n)/A219662(n) develops as follows:
0, 1, 1.5, 0.9, 0.694..., 0.597..., 0.735..., 0.911..., 0.841..., 0.768..., 0.793..., 0.889..., 0.992..., 1.059..., 1.100...
Compare this to how the ratio A218543(n)/A218542(n) develops (ratios listed in entry A218543) and see also the associated graphs plotted by OEIS Server.

Examples

			(1!)-1 (0) is reached from (2!)-1 (1) with one step by subtracting A034968(1) from 1. Zero is not an odd number, so a(1)=0.
(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. Two is not an odd number, but one is, so a(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. Of these (after 23) only 17, 7 and 5 are odd numbers, so a(3)=3.
		

Crossrefs

Programs

  • Scheme
    (definec (A219663 n) (if (< n 2) 0 (let loop ((i (- (A000142 (1+ n)) (A000217 n) 1)) (s 0)) (cond ((isA000142? (1+ i)) (+ s (modulo i 2))) (else (loop (A219651 i) (+ s (modulo i 2))))))))
    (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)))))))

Formula

a(n) = A219661(n) - A219662(n).

A219654 Run lengths in A219652.

Original entry on oeis.org

1, 1, 2, 2, 2, 4, 4, 4, 4, 2, 4, 4, 4, 4, 6, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 8, 4, 2, 4, 4, 4, 4, 6, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 8, 8, 6, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 8, 8, 6, 8, 10, 6, 6, 6, 6, 6, 6, 6, 8, 6, 8, 8, 6, 8, 10, 8, 10, 12, 6
Offset: 0

Views

Author

Antti Karttunen, Nov 25 2012

Keywords

Comments

a(n) tells from how many starting values one can end to 0 in n steps, with the iterative process described in A219652 (if going around in 0->0 loop is disallowed).

Crossrefs

a(n) = 1+(A219655(n)-A219653(n)). This sequence is based on Factorial number system: A007623. Analogous sequence for binary system: A086876, for Zeckendorf expansion: A219644. Cf. A219652, A219659, A219666.

Formula

a(n) = A219653(n+1)-A219653(n). (The first differences of A219653).

A219656 Partial sums of A219652.

Original entry on oeis.org

0, 1, 3, 5, 8, 11, 15, 19, 24, 29, 34, 39, 45, 51, 57, 63, 70, 77, 84, 91, 99, 107, 115, 123, 132, 141, 151, 161, 171, 181, 192, 203, 214, 225, 237, 249, 261, 273, 286, 299, 312, 325, 339, 353, 367, 381, 395, 409, 424, 439, 454, 469, 485, 501, 517, 533, 550
Offset: 0

Views

Author

Antti Karttunen, Nov 25 2012

Keywords

Crossrefs

Used to compute A219657. Analogous sequence for binary system: A213706, for Zeckendorf expansion: A219646.

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)).

A219651 a(n) = n minus (sum of digits in factorial base expansion of n).

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 5, 5, 6, 6, 7, 7, 10, 10, 11, 11, 12, 12, 15, 15, 16, 16, 17, 17, 23, 23, 24, 24, 25, 25, 28, 28, 29, 29, 30, 30, 33, 33, 34, 34, 35, 35, 38, 38, 39, 39, 40, 40, 46, 46, 47, 47, 48, 48, 51, 51, 52, 52, 53, 53, 56, 56, 57, 57, 58, 58, 61, 61
Offset: 0

Views

Author

Antti Karttunen, Nov 25 2012

Keywords

Comments

See A007623 for the factorial base number system representation.

Crossrefs

Bisection: A219650. Analogous sequence for binary system: A011371, for Zeckendorf expansion: A219641.

Programs

  • Mathematica
    (* First run program for A007623 to define factBaseIntDs *) Table[n - Plus@@factBaseIntDs[n], {n, 0, 99}] (* Alonso del Arte, Nov 25 2012 *)
  • Python
    from itertools import count
    def A219651(n):
        c, f = 0, 1
        for i in count(2):
            f *= i
            if f>n:
                break
            c += (i-1)*(n//f)
        return c # Chai Wah Wu, Oct 11 2024
  • Scheme
    (define (A219651 n) (- n (A034968 n)))
    

Formula

a(n) = n - A034968(n).

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

A226061 Partial sums of A219661.

Original entry on oeis.org

0, 1, 3, 8, 27, 110, 538, 3149, 21622, 172348, 1549896, 15401144, 168011252, 2003304293, 25928878272, 361788001015, 5411160126367, 86353882249911, 1464841397585335, 26323224850512719, 499551889319197565
Offset: 1

Views

Author

Antti Karttunen, May 28 2013

Keywords

Comments

a(n) tells the position of (n!)-1 in A219666.

Crossrefs

One less than A219665.
Analogous sequence for binary system: A218600.
Cf. also A230410, A231719.

Programs

  • Mathematica
    Accumulate@ 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 *)

Formula

a(n) = a(n-1) + A219661(n-1) with a(1) = 0.
a(n) = A219652(n!-1).
a(n) = A219665(n) - 1.

Extensions

Terms a(16) - a(21) computed from the new terms of A219661 by Antti Karttunen, Jun 27 2016
Showing 1-10 of 14 results. Next