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 12 results. Next

A230432 Simple self-inverse permutation of natural numbers: after zero, list each block of A219661(n) numbers in reverse order, from A226061(n+1) to A219665(n).

Original entry on oeis.org

0, 1, 3, 2, 8, 7, 6, 5, 4, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73
Offset: 0

Views

Author

Antti Karttunen, Oct 22 2013

Keywords

Comments

This permutation can be used to map between the sequences A219666 and A230416. E.g. A219666(n) = A230416(a(n)) and vice versa: A230416(n) = A219666(a(n)).

Crossrefs

Analogous sequence for binary system: A218602.

Programs

Formula

a(n) = A219665(A230411(n+1)) - A230431(n) - 1.

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

A255061 Number of steps to reach 0 when starting from (2^n)-2 and iterating the map x -> x - (number of runs in binary representation of x): a(n) = A255072(A000918(n)).

Original entry on oeis.org

0, 1, 3, 6, 11, 20, 36, 65, 118, 215, 393, 721, 1329, 2463, 4589, 8590, 16142, 30434, 57549, 109114, 207388, 395045, 754027, 1441971, 2762764, 5303466, 10200385, 19656528, 37948281, 73384080, 142115376, 275551755, 534790472, 1038702980, 2018626772, 3924923937, 7634733312
Offset: 1

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Comments

Apart from a(1)=1, also gives the positions of ones in A255054.

Crossrefs

One less than A255062.
First differences: A255071.
Apart from a(1)=1, a subsequence of A255059.
Analogous sequences: A218600, A226061.

Programs

Formula

a(n) = A255072(A000918(n)).
a(1) = 0; for n > 1, a(n) = a(n-1) + A255071(n-1).
Other identities. For all n >= 1:
a(n) = A255062(n) - 1.

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

A230410 After a(0)=0, a(n) = A230415(A219666(n),A219666(n-1)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

After zero, a(n) = number of positions where digits in the factorial base representations of successive nodes A219666(n-1) and A219666(n) in the infinite trunk of the factorial beanstalk differ from each other.

Examples

			a(8) = 1, because A219666(8)=23, whose factorial base representation (A007623(23)) is '321', and A219666(7)=17, whose factorial base representation (A007623(17)) is '221', and they differ just in one digit position.
a(9) = 3, because A219666(9)=25, '...01001' in factorial base, which differs from '...0321' in three digit positions.
Note that A226061(4)=8 (A226061(n) tells the position of (n!)-1 in A219666), and 1+2+3 = 6 happens to be both a triangular number (A000217) and a factorial number (A000142).
The next time 1 occurs in this sequence because of this coincidence is at x=A226061(16) (whose value is currently not known), as at that point A219666(x) = 16!-1 = 20922789887999, whose factorial base representation is (15,14,13,12,11,10,9,8,7,6,5,4,3,2,1), and A000217(15) = 120 = A000142(5), which means that A219666(x-1) = A219651(20922789887999) = 20922789887879, whose factorial base representation is (15,14,13,12,11,10,9,8,7,6,4,4,3,2,1), which differs only in one position from the previous.
Of course 1's occur in this sequence for other reasons as well.
		

Crossrefs

Cf. A230415, A230406, A231717, A231719, A232094. A230422 gives the positions of ones.

Programs

  • Mathematica
    nn = 1200; m = 1; While[m! < nn, m++]; m; f[n_] := IntegerDigits[n, MixedRadix[Reverse@ Range[2, m]]]; Join[{0}, Function[w, Count[Subtract @@ Map[PadLeft[#, Max@ Map[Length, w]] &, w], k_ /; k != 0]]@ Map[f@ # &, {#1, #2}] & @@@ Partition[#, 2, 1] &@ TakeWhile[Reverse@ NestWhileList[# - Total@ f@ # &, nn, # > 0 &], # <= 500 &]] (* Michael De Vlieger, Jun 27 2016, Version 10 *)
  • Scheme
    (define (A230410 n) (if (zero? n) n (A230415bi (A219666 n) (A219666 (- n 1))))) ;; Where bi-variate function A230415bi has been given in A230415.

Formula

a(0)=0, and for n>=1, a(n) = A230415(A219666(n),A219666(n-1)).
For all n, a(A226061(n+1)) = A232094(n).

A232096 a(n) = largest m such that m! divides 1+2+...+n; a(n) = A055881(A000217(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 18 2013

Keywords

Crossrefs

A042963 gives the positions of ones and A014601 the positions of larger terms.

Programs

Formula

a(n) = A055881(A000217(n)).
a(n) = A231719(A226061(n+1)). [Not a practical way to compute this sequence, but follows from the definitions]

A219665 One more than the partial sums of A219661.

Original entry on oeis.org

1, 2, 4, 9, 28, 111, 539, 3150, 21623, 172349, 1549897, 15401145, 168011253, 2003304294, 25928878273, 361788001016, 5411160126368, 86353882249912, 1464841397585336, 26323224850512720, 499551889319197566
Offset: 1

Views

Author

Antti Karttunen, May 28 2013

Keywords

Comments

Are there any cases after n>2, for which A219666(a(n)) = n! instead of n!+1 ? (At least for all terms a(3) - a(14) that number is n!+1.)
Compare to the conjecture given at A213710.

Crossrefs

One more than A226061.
Cf. also A213710 (analogous sequence for base-2).

Programs

  • Mathematica
    Accumulate@ Table[Length@ NestWhileList[# - Total@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, 120]]] &, (n + 1)! - 1, # > n! - 1 &] - 1, {n, 0, 8}] + 1 (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)
  • Scheme
    (define (A219665 n) (+ 1 (A226061 n)))

Formula

a(n) = A226061(n)+1 = A219652(n!).

Extensions

Terms a(16) - a(21) computed from the new terms of A219661 by Antti Karttunen, Jun 27 2016

A230406 a(n) = A034968(A219666(n)); after zero, the differences between successive nodes in the infinite trunk of the factorial beanstalk (A219666).

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 2, 5, 6, 2, 3, 2, 5, 5, 6, 2, 4, 5, 6, 7, 4, 5, 6, 7, 5, 5, 7, 10, 2, 3, 2, 5, 5, 6, 2, 4, 5, 6, 7, 4, 5, 6, 7, 5, 5, 6, 9, 8, 7, 10, 2, 4, 5, 6, 7, 4, 5, 6, 7, 5, 5, 6, 8, 6, 8, 8, 7, 10, 11, 4, 5, 6, 7, 5, 5, 6, 8, 6, 8, 8, 7, 10, 12, 10, 11
Offset: 0

Views

Author

Antti Karttunen, Nov 09 2013

Keywords

Comments

Also the first differences of A219666, shifted once right and prepended with zero.
This sequence relates to the factorial base representation (A007623) in the same way as A213712 relates to the binary system.

Crossrefs

Cf. also A230418, A230410.

Programs

Formula

a(n) = A034968(A219666(n)).
a(0) = 0, and for n>=1, a(n) = A219666(n) - A219666(n-1).
a(A226061(n)) = A000217(n-1) for all n.

A231719 After zero, a(n) = largest m such that m! divides the difference between successive nodes A219666(n-1) and A219666(n) in the infinite trunk of the factorial beanstalk.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 12 2013

Keywords

Comments

The first 4 occurs at n=2206. The first 5 occurs at n = 361788001015 = A226061(16).

Crossrefs

Programs

  • Mathematica
    nn = 1200; m = 1; While[Factorial@ m < nn, m++]; m; t = TakeWhile[
    Reverse@ NestList[# - Total@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] &, nn, 182], # <= 1000 &]; {0}~Join~Table[SelectFirst[Reverse@ Range@ 10, Divisible[t[[n]] - t[[n - 1]], #!] &], {n, 2, 87}] (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)
  • Scheme
    (define (A231719 n) (if (zero? n) n (A055881 (A230406 n))))

Formula

a(0)=0 and for n>=1, a(n) = A055881(A230406(n)).
For all n, a(A226061(n+1)) = A232096(n).

A231717 After a(0)=0, a(n) = A231713(A219666(n),A219666(n-1)).

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 3, 1, 6, 3, 3, 3, 2, 1, 6, 2, 3, 1, 3, 5, 3, 1, 3, 6, 2, 2, 3, 10, 3, 3, 3, 2, 1, 6, 2, 3, 1, 3, 5, 3, 1, 3, 6, 2, 1, 3, 5, 5, 3, 10, 2, 3, 1, 3, 5, 3, 1, 3, 6, 2, 1, 2, 4, 2, 4, 5, 3, 3, 9, 3, 1, 3, 6, 2, 1, 2, 4, 2, 4, 5, 3, 2, 4, 3, 10
Offset: 0

Views

Author

Antti Karttunen, Nov 12 2013

Keywords

Comments

For all n, a(A226061(n+1)) = A232095(n). This works because at the positions given by each x=A226061(n+1), it holds that A219666(x) = (n+1)!-1, which has a factorial base representation (A007623) of (n,n-1,n-2,...,3,2,1) whose digit sum (A034968) is the n-th triangular number, A000217(n). This in turn is always a new record as at those points, in each significant digit position so far employed, a maximal digit value (for factorial number system) is used, and thus the preceding term, A219666(x-1) cannot have any larger digits in its factorial base representation, and so the differences between their digits (in matching positions) are all nonnegative.

Crossrefs

A231718 gives the positions of ones.
Cf. also A230410, A231719, A232095.

Programs

Formula

a(0)=0, and for n>=1, a(n) = A231713(A219666(n),A219666(n-1)).
Showing 1-10 of 12 results. Next