OFFSET
0,2
COMMENTS
n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 6 for every i.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..500
FORMULA
a(n) = 5*A033043(n).
a(2n) = 6*a(n), a(2n+1) = a(2n)+5.
MATHEMATICA
fQ[n_]:=Union@Join[{0, 5}, IntegerDigits[n, 6]]=={0, 5}; Select[Range[0, 40000], fQ] (* Vincenzo Librandi, May 25 2012 *)
FromDigits[#, 6]&/@Tuples[{ 0, 5}, 6] (* Harvey P. Dale, Aug 15 2021 *)
PROG
(Magma) [n: n in [0..40000] | Set(IntegerToSequence(n, 6)) subset {0, 5}]; // Vincenzo Librandi, May 25 2012
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ray Chandler, Aug 03 2004
STATUS
approved