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-7 of 7 results.

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

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

A218543 Number of times when an odd number is encountered, when going from 2^(n+1)-1 to (2^n)-1 using the iterative process described in A071542.

Original entry on oeis.org

0, 1, 1, 2, 3, 6, 9, 18, 31, 54, 93, 167, 306, 574, 1088, 2081, 3998, 7696, 14792, 28335, 54049, 102742, 194948, 369955, 703335, 1340834, 2563781, 4915378, 9444799, 18180238, 35047841, 67660623, 130806130, 253252243, 491034479, 953404380, 1853513715, 3607440034
Offset: 0

Views

Author

Antti Karttunen, Nov 02 2012

Keywords

Comments

Ratio a(n)/A213709(n) develops as: 0, 1, 0.5, 0.666..., 0.6, 0.666..., 0.529..., 0.6, 0.574..., 0.551..., 0.520..., 0.506..., 0.498..., 0.499..., 0.503..., 0.511..., 0.521..., 0.531..., 0.539..., 0.545..., 0.547..., 0.546..., 0.542..., 0.536..., 0.531..., 0.525..., 0.520..., 0.516..., 0.512..., 0.508..., 0.504..., 0.501..., 0.498..., 0.497..., 0.495..., 0.495..., 0.495..., 0.495..., 0.495..., 0.496..., 0.496..., 0.497..., 0.497..., 0.498..., 0.498..., 0.498..., 0.497..., 0.497...
Ratio a(n)/A218542(n) develops as follows from n>=2 onward:
1, 2, 1.5, 2, 1.125, 1.5, 1.348..., 1.227..., 1.081..., 1.025..., 0.994..., 0.997..., 1.013..., 1.045..., 1.086..., 1.132..., 1.172..., 1.198..., 1.208..., 1.201..., 1.182..., 1.157..., 1.131..., 1.107..., 1.085..., 1.065..., 1.047..., 1.031..., 1.016..., 1.004..., 0.994..., 0.986..., 0.981..., 0.979..., 0.978..., 0.979..., 0.981..., 0.983..., 0.986..., 0.988..., 0.989..., 0.990..., 0.991..., 0.991..., 0.989..., 0.987...
Observation: A179016 seems to alternatively slightly favor the odd numbers and then again the even numbers, at least for the terms computed so far.
Please plot this sequence against A218542 in the "ratio mode" (given as a link) to see how smoothly (almost "continuously") the ratios given above develop.
What is the reason for that smoothness? (Conjecture: The distribution of "tendrils", i.e. finite subtrees in the beanstalk and its almost fractal nature? Cf: A218787.)

Examples

			(2^0)-1 (0) is reached from (2^1)-1 (1) with one step by subtracting A000120(1) from 1. Zero is not an odd number, so a(0)=0.
(2^1)-1 (1) is reached from (2^2)-1 (3) with one step by subtracting A000120(3) from 3. One is an odd number, so a(1)=1.
(2^2)-1 (3) is reached from (2^3)-1 (7) with two steps by first subtracting A000120(7) from 7 -> 4, and then subtracting A000120(4) from 4 -> 3. Four is not an odd number, but three is, so a(2)=1.
		

Crossrefs

a(n) = A213709(n)-A218542(n). Cf. A213733, A218787, A218789.
Analogous sequence for factorial number system: A219663.

Formula

a(n) = Sum_{i=A218600(n) .. (A218600(n+1)-1)} A213729(i)

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

A230409 Partial sums of A230407.

Original entry on oeis.org

0, -1, 0, 3, -2, -3, 0, 1, 4, -1, -2, 5, 4, -1, -2, -7, -2, 3, -2, -13, -12, -9, -20, -19, -22, -19, -18, -15, -20, -21, -14, -15, -20, -21, -26, -21, -16, -21, -32, -31, -28, -49, -48, -51, -54, -45, -44, -45, -50, -51, -56, -51, -46, -51, -62, -61, -58, -79
Offset: 0

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

The term a(n) indicates approximately the "balance" of the factorial beanstalk (cf. A219666) at n steps up from the root, which in turn correlates with the behavior of such sequences as A219662 and A219663.
This sequence relates to the factorial base representation (A007623) in the same way as A218789 relates to the binary system.
Question: When will a negative term occur next time, after a(251) = -41 ?

Crossrefs

Formula

a(0) = 0, a(n) = a(n-1) + A230407(n).

A231723 a(n) = the difference between the n-th node of the infinite trunk of the factorial beanstalk (A219666(n)) and the smallest integer (A219653(n)) which is as many A219651-iteration steps distanced from the root (zero); a(n) = A219666(n) - A219653(n).

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 0, 1, 3, 1, 2, 0, 1, 2, 4, 0, 0, 1, 3, 4, 2, 1, 1, 2, 1, 0, 1, 3, 1, 2, 0, 1, 2, 4, 0, 0, 1, 3, 4, 2, 1, 1, 2, 1, 0, 0, 1, 3, 2, 4, 0, 0, 1, 3, 4, 2, 1, 1, 2, 1, 0, 0, 0, 0, 0, 0, 1, 3, 4, 2, 1, 1, 2, 1, 0, 0, 0, 0, 0, 0, 1, 3, 5, 7, 8, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Nov 13 2013

Keywords

Comments

For all n, the following holds: A219653(n) <= A219666(n) <= A219655(n). This sequence gives the distance of the node n in the infinite trunk of factorial beanstalk (A219666(n)) from the left (lesser) edge of the A219654(n) wide window which it at that point must pass through.
This sequence relates to the factorial base representation (A007623) in the same way as A218603 relates to the binary system and similar remarks apply here.

Crossrefs

Programs

Formula

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

A231724 a(n) = the difference between the n-th node of the infinite trunk of the factorial beanstalk (A219666(n)) and the greatest integer (A219655(n)) which is as many A219651-iteration steps distanced from the root (zero); a(n) = A219655(n) - A219666(n).

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 3, 2, 0, 0, 1, 3, 2, 1, 1, 3, 3, 2, 2, 1, 3, 4, 4, 3, 4, 5, 6, 0, 0, 1, 3, 2, 1, 1, 3, 3, 2, 2, 1, 3, 4, 4, 3, 4, 5, 7, 4, 4, 5, 1, 3, 3, 2, 2, 1, 3, 4, 4, 3, 4, 5, 7, 5, 7, 7, 5, 6, 6, 1, 3, 4, 4, 3, 4, 5, 7, 5, 7, 7, 5, 6, 6, 2, 2, 3, 4, 5
Offset: 0

Views

Author

Antti Karttunen, Nov 13 2013

Keywords

Comments

For all n, the following holds: A219653(n) <= A219666(n) <= A219655(n). This sequence gives the distance of the node n in the infinite trunk of factorial beanstalk (A219666(n)) from the right (greater) edge of the A219654(n) wide window which it at that point must pass through.
This sequence relates to the factorial base representation (A007623) in the same way as A218604 relates to the binary system and similar remarks apply here.

Crossrefs

Programs

Formula

a(n) = A219655(n) - A219666(n).
A219654(n) = a(n) + A231723(n) + 1.
Showing 1-7 of 7 results.