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

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

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

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.

A230431 After the first zero, integers from 0 to A219661(n)-1 followed by integers from 0 to A219661(n+1)-1, etc.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44
Offset: 0

Views

Author

Antti Karttunen, Oct 22 2013

Keywords

Crossrefs

Cf. A219661, A219665, A230411. Used to compute A230432.
Analogous sequence for binary system: A218601.

Programs

Formula

a(0) = a(1) = 0, and for n > 1, a(n) = n - A219665(A230411(n+1)-1).

A213709 Number of steps to go from 2^(n+1)-1 to (2^n)-1 using the iterative process described in A071542.

Original entry on oeis.org

1, 1, 2, 3, 5, 9, 17, 30, 54, 98, 179, 330, 614, 1150, 2162, 4072, 7678, 14496, 27418, 51979, 98800, 188309, 359889, 689649, 1325006, 2552031, 4926589, 9529551, 18463098, 35815293, 69534171, 135069124, 262448803, 510047416, 991381433, 1927317745, 3747885517
Offset: 0

Views

Author

Antti Karttunen, Oct 26 2012

Keywords

Comments

Also, apart from the first term a(0)=1, the number of terms in A179016 whose binary width is n+2 bits and whose second most significant bit is zero. For example, there is one term 4 (100) in three-bit range; two terms 8 (1000) and 11 (1011) in four bit range; three such terms: 16 (10000), 19 (10011) and 23 (10111) in five-bit range; five terms: 32, 35, 39, 42, 46 in six-bit range. This stems from the half-recursive nature of A179016, especially, that for all n >= 4, a(n) also gives the number of steps to go from (2^(n+1) + 2^n + 1) to 2^n using the iterative process described in A071542. Cf. also A226060. - Antti Karttunen, Jun 12 2013
Ratio a(n+1)/a(n) develops as: 1, 2, 1.5, 1.667..., 1.8, 1.889..., 1.765..., 1.8, 1.815..., 1.827..., 1.844..., 1.861..., 1.873..., 1.880..., 1.883..., 1.886..., 1.888..., 1.891..., 1.896..., 1.901..., 1.906..., 1.911..., 1.916..., 1.921..., 1.926..., 1.930..., 1.934..., 1.937..., 1.940..., 1.941..., 1.942..., 1.943..., 1.943..., 1.944..., 1.944..., 1.945..., 1.945..., 1.946..., 1.947..., 1.949..., 1.950..., 1.951..., 1.953..., 1.954..., 1.955..., 1.957..., 1.958... (which seem to converge slowly towards 2; see also comments at A218543).

Examples

			(2^0)-1 (0) is reached from (2^1)-1 (1) with one step by subtracting A000120(1) from 1.
(2^1)-1 (1) is reached from (2^2)-1 (3) with one step by subtracting A000120(3) from 3.
(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.
Thus a(0)=a(1)=1 and a(2)=2.
		

Crossrefs

First differences of A218600 and A213710. First differences of this sequence: A226060.
Analogous sequence for factorial number system: A219661.

Formula

a(n) = A071542((2^(n+1))-1) - A071542((2^n)-1).
a(n) = A218542(n) + A218543(n) = A011782(n) - A213722(n).

Extensions

More terms from Antti Karttunen, Jun 05 2013

A255071 Number of steps required to reach (2^n)-2 from 2^(n+1)-2 by iterating the map x -> x - (number of runs in binary representation of x).

Original entry on oeis.org

1, 2, 3, 5, 9, 16, 29, 53, 97, 178, 328, 608, 1134, 2126, 4001, 7552, 14292, 27115, 51565, 98274, 187657, 358982, 687944, 1320793, 2540702, 4896919, 9456143, 18291753, 35435799, 68731296, 133436379, 259238717, 503912508, 979923792, 1906297165, 3709809375, 7222584181
Offset: 1

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Crossrefs

First differences of A255061 and A255062.
A255069 gives the first differences of this sequence.
Analogous sequences: A213709, A219661.
a(n) differs from A192804(n+1) for the first time at n=11, where a(11) = 328, while A192804(12) = 327.

Programs

  • PARI
    A005811(n) = hammingweight(bitxor(n,n\2));
    A255071(n) = { my(k, i); k = (2^(n+1))-2; i = 1; while(1, k = k - A005811(k); if(!bitand(k+1,k+2),return(i),i++)); };
    for(n=1, 48, write("b255071.txt", n, " ", A255071(n)));
    
  • Scheme
    (define (A255071 n) (- (A255072 (- (expt 2 (+ n 1)) 2)) (A255072 (- (expt 2 n) 2))))
    (define (A255071shifted n) (add (COMPOSE A079944off2 A255056) (A255062 n) (A255061 (+ 1 n))))
    (define (A079944off2 n) (A000035 (floor->exact (/ n (A072376 n))))) ;; Cf.
    A079944.
    ;; Shifted variant gives: (map A255071shifted (iota 16)) --> (0 1 2 3 5 9 16 29 53 97 178 328 608 1134 2126 4001)

Formula

a(n) = A255072((2^(n+1))-2) - A255072((2^n)-2).
a(n) = A255061(n+1) - A255061(n).
a(n) = A255125(n) + A255126(n).
a(n) = A255063(n) + A255064(n).
Other identities and observations:
It seems that a(n) <= A213709(n) for all n >= 1. A254119 gives the difference between these two sequences.
From Antti Karttunen, Feb 21 2015: (Start)
For n>1, a(n-1) = Sum_{k=A255062(n) .. A255061(n+1)} secondmsb(A255056(k)).
Here secondmsb is implemented by the starting offset 2 version of A079944, and effectively gives the second most significant bit in the binary expansion of n. The formula follows from the semi-regular nature of number-of-runs beanstalk, as in the upper half of any next higher range [A255062(n+1) .. A255061(n+2)] of its infinite trunk (A255056), the beanstalk imitates its behavior in the range [A255062(n) .. A255061(n+1)].
(End)

Extensions

a(37) added by Antti Karttunen, Feb 19 2015

A219652 Number of steps to reach 0 starting with n and using the iterated process: x -> x - (sum of digits in factorial expansion of x).

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19
Offset: 0

Views

Author

Antti Karttunen, Nov 25 2012

Keywords

Comments

See A007623 for the factorial number system representation.

Crossrefs

Analogous sequence for binary system: A071542, for Zeckendorf expansion: A219642. Cf. A007623, A034968, A219650, A219651, A219653-A219655, A219659, A219661, A219666.

Programs

  • Mathematica
    nn = 72; m = 1; While[Factorial@ m < nn, m++]; m; Table[Length@ NestWhileList[# - Total@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] &, n, # > 0 &] - 1, {n, 0, nn}] (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)

Formula

a(0)=0; for n>0, a(n) = 1 + a(A219651(n)).

Extensions

Erroneous description corrected by Antti Karttunen, Dec 03 2012

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

A230420 Triangle T(n,k) giving the number of terms of A219666 which have n digits (A084558) in their factorial base expansion and whose most significant digit (A099563) in that base is k.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 6, 5, 4, 4, 22, 19, 16, 14, 12, 94, 82, 73, 65, 59, 55, 479, 432, 395, 362, 336, 314, 293, 2886, 2667, 2482, 2324, 2189, 2073, 1971, 1881, 20276, 19123, 18124, 17249, 16473, 15775, 15140, 14555, 14011, 164224, 156961, 150389, 144378, 138828, 133664, 128831, 124289, 120010, 115974
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;
1, 1;
2, 2, 1;
6, 5, 4, 4;
22, 19, 16, 14, 12;
94, 82, 73, 65, 59, 55;
...
T(4,2) = 5 as only the terms 48, 52, 57, 63 and 70 of A219666 (with factorial base representations 2000, 2020, 2111, 2211 and 2320) have four significant digits in the factorial base, with the most significant digit being 2.
		

Crossrefs

Transpose: A230421. Row sums: A219661. Cf. also A230428, A230429, A219652, A219666.

Programs

Formula

T(n,k) = 1 + A219652(A230429(n,k)) - A219652(A230428(n,k)).
Showing 1-10 of 13 results. Next