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

A213727 a(n) = 0 if n is in the infinite trunk of the "binary beanstalk", otherwise number of nodes (including leaves and the node n itself) in that finite branch of the beanstalk.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 3, 0, 1, 1, 1, 0, 0, 1, 3, 0, 1, 1, 5, 0, 1, 3, 0, 1, 1, 1, 1, 0, 0, 1, 3, 0, 1, 1, 5, 0, 1, 3, 0, 1, 1, 1, 0, 7, 1, 0, 5, 1, 1, 0, 3, 1, 3, 0, 1, 1, 1, 1, 1, 0, 0, 1, 3, 0, 1, 1, 5, 0, 1, 3, 0, 1, 1, 1, 0, 7, 1, 0, 5, 1, 1, 0, 3
Offset: 0

Views

Author

Antti Karttunen, Nov 01 2012

Keywords

Comments

a(n) tells, for each natural number n, whether it belongs to the infinite trunk of the binary beanstalk (in A179016, when a(n)=0), or if it is one of the terminal nodes (i.e., leaves, A055938, when a(n)=1), or otherwise, when a(n) > 1, tells from how many different numbers one can arrive at this n by repeatedly subtracting their bit-count (A000120) from them (as explained in A071542), and including also n itself as one of the cases.
a(n) is always odd unless it is zero. In particular, each a(A213717(n)) is an odd number greater than one.

Examples

			a(10) = 3 because we include 10 itself ("1010" in binary) and the two numbers n for which it is true that n - A000120(n) = 10, i.e., 12 and 13 ("1100" and "1101" in binary). Furthermore, there do not exist any such numbers for 12 or 13, as both are members of A055938 (see also the comment at A213717).
Similarly, a(22) = 5 as there are the following five cases: 22 itself, 24 as 24-A000120(24) = 24-2 = 22 (note that 24 is in A055938), 25 as 25-A000120(25) = 25-3 = 22, and the two terminal nodes (leaves) branching from 25, that is, 28 & 29 (as 28-A000120(28) = 28-3 = 25, and 29-A000120(29) = 29-4=25).
		

Crossrefs

Cf. A179016.
Analogous sequences computed for other "beanstalk" or similar tree systems: A227643, A230427, A255327.

Formula

If A079559(n)=0, a(n)=1; otherwise, if A213719(n)=1, a(n)=0; otherwise a(n) = 1+a(A213723(n))+a(A213724(n)).
Other identities. For all n:
a(A179016(n)) = 0, a(A055938(n)) = 1, and a(A213717(n)) >= 3.
a(A213717(n)) = (2*A213726(A213717(n)))-1.

A230423 a(n) = smallest natural number x such that x=n+A034968(x), or zero if no such number exists.

Original entry on oeis.org

0, 2, 4, 0, 0, 6, 8, 10, 0, 0, 12, 14, 16, 0, 0, 18, 20, 22, 0, 0, 0, 0, 0, 24, 26, 28, 0, 0, 30, 32, 34, 0, 0, 36, 38, 40, 0, 0, 42, 44, 46, 0, 0, 0, 0, 0, 48, 50, 52, 0, 0, 54, 56, 58, 0, 0, 60, 62, 64, 0, 0, 66, 68, 70, 0, 0, 0, 0, 0, 72, 74, 76, 0, 0, 78
Offset: 0

Views

Author

Antti Karttunen, Oct 31 2013

Keywords

Comments

Also, if n can be partitioned into sum d1*(k1!-1) + d2*(k2!-1) + ... + dj*(kj!-1), where all k's are distinct and greater than one and each di is in range [1,ki] (in other words, if A230412(n)=1), then a(n) = d1*k1! + d2*k2! + ... + dj*kj!. If this is not possible, then n is one of the terms of A219658, and a(n)=0.

Crossrefs

a(A219650(n)) = A005843(n) = 2n. Cf. also A230414, A230424.
Can be used to compute A230425-A230427.
This sequence relates to the factorial base representation (A007623) in a similar way as A213723 relates to the binary system.

Programs

  • Scheme
    (define (A230423 n) (let loop ((k n)) (cond ((= (A219651 k) n) k) ((> k (+ n n)) 0) (else (loop (+ 1 k))))))

Formula

a(n) = 2*A230414(n).

A230424 a(n) = largest natural number x such that x=n+A034968(x), or zero if no such number exists.

Original entry on oeis.org

1, 3, 5, 0, 0, 7, 9, 11, 0, 0, 13, 15, 17, 0, 0, 19, 21, 23, 0, 0, 0, 0, 0, 25, 27, 29, 0, 0, 31, 33, 35, 0, 0, 37, 39, 41, 0, 0, 43, 45, 47, 0, 0, 0, 0, 0, 49, 51, 53, 0, 0, 55, 57, 59, 0, 0, 61, 63, 65, 0, 0, 67, 69, 71, 0, 0, 0, 0, 0, 73, 75, 77, 0, 0, 79
Offset: 0

Views

Author

Antti Karttunen, Oct 31 2013

Keywords

Crossrefs

Cf. A034968, A230414. a(A219650(n)) = A005408(n) = 2n+1.
One more than A230423 at its nonzero points. A219658 gives the positions of zeros. Can be used to compute A230425-A230427.
Analogous sequence for binary system: A213724.

Programs

  • Scheme
    (define (A230424 n) (if (zero? n) 1 (let ((v (A230423 n))) (if (zero? v) v (+ 1 v)))))

Formula

a(n) = A230412(n)*(A230423(n)+1).

A230407 Absolute value of a(n) tells the size of the n-th side-tree ("tendril", A230430(n)) in the factorial beanstalk; the sign tells on which side of the infinite trunk (A219666) it is.

Original entry on oeis.org

0, -1, 1, 3, -5, -1, 3, 1, 3, -5, -1, 7, -1, -5, -1, -5, 5, 5, -5, -11, 1, 3, -11, 1, -3, 3, 1, 3, -5, -1, 7, -1, -5, -1, -5, 5, 5, -5, -11, 1, 3, -21, 1, -3, -3, 9, 1, -1, -5, -1, -5, 5, 5, -5, -11, 1, 3, -21, 1, -3, -3, -11, -1, -9, -3, 5, 5, -5, -11, 1, 3
Offset: 0

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

Positive and negative terms correspond to the tendrils that sprout respectively at the left and right sides of the infinite trunk, when the factorial beanstalk is drawn with the lesser numbers branching to the left. The absolute values give the sizes of those tendrils, with all nodes included: The leaves, the internal vertices as well as the root itself (which is at A230430(n)).
Here a(0) = 0 is a special case, as the infinite trunk starts to grow from its child 1, while the other child is 0 itself. (For both k=0 or k=1 it is true that A219651(k)=0).
This sequence relates to the factorial base representation (A007623) in the same way as A218618 relates to the binary system.

Crossrefs

Partial sums: A230408, A230409.

Programs

Formula

a(n) = ((-1)^A230430(n)) * A230427(A230430(n)).

A230425 a(n)=0 if n is in the infinite trunk of factorial beanstalk (in A219666), otherwise 1 + number of steps to reach the farthest leaf in that finite branch of the beanstalk.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

This sequence relates to the factorial base representation (A007623) in the same way as A213725 relates to the binary system.

Examples

			From 11 sprouts the following finite side-tree of "factorial beanstalk":
    18  19
     \  /
  14  15
   \  /
    11
Its leaves are the numbers 14, 18 and 19 (which all occur in A219658), whose factorial base representations (see A007623) are '210', '300' and '301' respectively. The corresponding parent nodes are obtained by subtracting the sum of factorial base digits, thus we get 18-3 = 15 and also 19-4 = 15, thus 15 ('211' in factorial base) is the parent of 18 and 19. For 14 and 15 we get 14-3 = 15-4 = 11, thus 11 is the parent of both 14 and 15, and the common ancestor of all the numbers 11, 14, 15, 18 and 19.
For numbers not occurring in A219666 this sequence gives one more than the maximum number of steps to reach the most distant leaf in such subtrees. In the above case, there is from 11 only one step to 14, but two steps to both 18 and 19. Thus a(11)=2+1=3. For leaves the result is always 1, for example, a(14) = a(18) = a(19) = 1.
		

Crossrefs

Differs from A230426 for the first time at n=34, where a(n)=3, while A230426(34)=4. Cf. also A230427.
A219658 gives the position of ones in this sequence (which are the leaves of the tree).

Formula

If A230412(n)=0, a(n)=1; otherwise, if n is in A219666, a(n)=0; otherwise a(n) = 1+max(a(A230423(n)), a(A230424(n))).

A230426 a(n)=0 if n is in the infinite trunk of factorial beanstalk (in A219666), otherwise the number of terminal nodes (leaves) in that finite branch of the beanstalk.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

This sequence relates to the factorial base representation (A007623) in the same way as A213726 relates to the binary system.

Examples

			From 11 sprouts the following finite side-tree of "factorial beanstalk":
    18  19
     \  /
  14  15
   \  /
    11
Its leaves are the numbers 14, 18 and 19 (which all occur in A219658), whose factorial base representations (see A007623) are '210', '300' and '301' respectively. The corresponding parent nodes are obtained by subtracting the sum of factorial base digits, thus we get 18-3 = 15 and also 19-4 = 15, thus 15 ('211' in factorial base) is the parent of 18 and 19. For 14 and 15 we get 14-3 = 15-4 = 11, thus 11 is the parent of both 14 and 15, and the common ancestor of all numbers 11, 14, 15, 18 and 19.
For numbers not occurring in A219666 this sequence gives the number of leaves in such subtrees. Thus a(11)=3, a(14)=1 (counting just the leaf 14 itself), a(15)=2 and a(18) = a(19) = 1.
		

Crossrefs

A219658 gives the position of ones in this sequence (which are the leaves of the tree).
Differs from A230425 for the first time at n=34, where a(n)=4, while A230425(34)=3. Cf. also A230427.

Formula

If A230412(n)=0, a(n)=1; otherwise, if n is in A219666, a(n)=0; otherwise a(n) = a(A230423(n)) + a(A230424(n)).
Showing 1-7 of 7 results.