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.

A241718 The number of P-positions in the game of Nim with up to 4 piles, allowing for piles of zero, such that the number of objects in the largest pile is n.

Original entry on oeis.org

1, 7, 13, 43, 25, 79, 133, 211, 49, 151, 253, 379, 457, 607, 757, 931, 97, 295, 493, 715, 889, 1135, 1381, 1651, 1681, 1975, 2269, 2587, 2857, 3199, 3541, 3907, 193, 583, 973, 1387, 1753, 2191, 2629, 3091, 3313, 3799, 4285, 4795, 5257, 5791, 6325
Offset: 0

Views

Author

Tanya Khovanova and Joshua Xiong, Apr 27 2014

Keywords

Comments

This is the first difference of A241522.

Examples

			If the largest pile is 2, then there are 6 positions that are permutations of (0,0,2,2) plus 6 positions that are permutations of (1,1,2,2) and one position (2,2,2,2). Therefore, a(2)=13.
		

Crossrefs

Cf. A241522, A241717 (3 piles), A241731 (5 piles).

Programs

  • Mathematica
    Table[Length[Select[Flatten[Table[{n, k, j, BitXor[n, k, j]}, {n, 0, a}, {k, 0, a}, {j, 0, a}], 2], Max[#] == a &]], {a, 0, 50}]

Formula

If b = floor(log_2(n)) is the number of digits in the binary representation of n and c = n + 1 - 2^b, then a(n) = (12*c-6)*2^b + a(c-1).