A171946 N-positions for game of UpMark.
0, 2, 4, 5, 6, 8, 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 24, 26, 28, 29, 30, 32, 34, 36, 37, 38, 40, 42, 44, 45, 46, 48, 49, 50, 52, 53, 54, 56, 58, 60, 61, 62, 64, 65, 66, 68, 69, 70, 72, 74, 76, 77, 78, 80, 81, 82, 84, 85, 86, 88, 90, 92, 93, 94, 96, 98
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Aviezri S. Fraenkel, The vile, dopey, evil and odious game players, Discrete Math. 312 (2012), no. 1, 42-46.
Crossrefs
Complement of A171947.
Programs
-
Haskell
import Data.List (delete) a171946 n = a171946_list !! (n-1) a171946_list = 0 : f [2..] where f (w:ws) = w : f (delete (2 * w - 1) ws) -- Reinhard Zumkeller, Oct 26 2014
-
Python
def A171946(n): if n == 1: return 0 def f(x): c, s = n, bin(x-1)[2:] l = len(s) for i in range(l&1,l,2): c += int(s[i])+int('0'+s[:i],2) return c m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Jan 29 2025
Comments