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

A060587 A ternary code: inverse of A060583.

Original entry on oeis.org

0, 2, 1, 8, 7, 6, 4, 3, 5, 24, 26, 25, 23, 22, 21, 19, 18, 20, 12, 14, 13, 11, 10, 9, 16, 15, 17, 72, 74, 73, 80, 79, 78, 76, 75, 77, 69, 71, 70, 68, 67, 66, 64, 63, 65, 57, 59, 58, 56, 55, 54, 61, 60, 62, 36, 38, 37, 44, 43, 42, 40, 39, 41, 33, 35, 34, 32, 31, 30, 28, 27, 29
Offset: 0

Views

Author

Henry Bottomley, Apr 04 2001

Keywords

Comments

Write n in base 3, then (working from left to right) if the k-th digit of n is equal to the digit to the left of it then this is the k-th digit of a(n), otherwise the k-th digit of a(n) is the element of {0,1,2} which has not just been compared, then read result as a base 3 number.

Examples

			a(76) = 46 since 76 written in base 3 is 2211; this gives a first digit of 1( = 3-2-0), a second digit of 2( = 2 = 2), a third digit of 0( = 3-1-2) and a fourth digit of 1( = 1 = 1); 1201 base 3 is 46.
		

Crossrefs

Formula

a(n) = 3a([n/3])+(-[n/3]-n mod 3) = 3a([n/3]) + A060588(n).
a(n) = A253586(n,floor(n/3)) = A253587(n,floor(n/3)). - Alois P. Heinz, Jan 09 2015

A060586 Minimum number of moves required to reach position n starting from 0 in Tower of Hanoi (with three pegs: 0,1,2), where with position n written in base 3, xyz means smallest disk is on peg z, second smallest is on peg y, third smallest on peg x, etc. and leading zeros indicate largest disks are all on peg 0.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Apr 04 2001

Keywords

Examples

			a(46) = 10 since 46 written in base 3 is 1201 (i.e. with the smallest and fourth smallest disks on the first peg, the third smallest disk on the second peg and the second smallest and any other disks on the zeroth peg) and the optimal moves starting from position 0 go through positions 2, 12, 11, 211, 210, 220, 222, 1222, 1220, 1210 taking ten moves.
		

Crossrefs

k appears A001316(k) times in the sequence.

Formula

a(n) = A060585(A060583(n)).

A060582 If the final digit of n in base 3 is the same as a([n/3]) then this digit, otherwise a(n)= mod 3-sum of these two digits, with a(0)=0.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Apr 04 2001

Keywords

Examples

			a(4)=0 since a([4/3])=a(1)=2, (4 mod 3)=1 and 3-2-1=0. a(5)=2 since a([5/3])=a(1)=2 and (5 mod 3)=2.
		

Crossrefs

Cf. A060588.

Formula

a(n) =(-a([n/3])-n) mod 3 =A060583(n) mod 3.
Showing 1-3 of 3 results.