A088151 Value of n-th digit in ternary representation of n^n.
1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 2, 1, 2, 2, 0, 0, 1, 1, 1, 0, 2, 1, 1, 0, 0, 1, 0, 1, 1, 1, 2, 0, 2, 0, 2, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 2, 2, 2, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 2, 2, 1, 0, 0, 0, 0, 1, 1, 2, 1, 2, 1, 0, 0, 1, 1, 0, 2, 2, 0, 0, 0, 2, 1, 1, 0, 0, 1, 2, 0, 0, 1, 1
Offset: 0
Examples
n=7, 7^7=3110367 -> '1112211200121', '111221-------': a(7)=1.
Links
- Eric Weisstein's World of Mathematics, Ternary
Formula
a(n) = floor(n^n / 3^n) mod 3.
Comments