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 15 for every i.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = 14*A033051(n).
a(2n) = 15*a(n), a(2n+1) = a(2n)+14.
MATHEMATICA
f[n_] := FromDigits[ IntegerDigits[n, 2] /. {1 -> 14}, 15]; Array[f, 33, 0] (* or *)
FromDigits[#, 15] & /@ Tuples[{0, 14}, 6] (* Harvey P. Dale, Sep 22 2011 *) (* or much slower *)
fQ[n_] := Union@ Join[{0, 14}, IntegerDigits[n, 15]] == {0, 14}; Select[ Range[0, 10634414 ], fQ] (* Robert G. Wilson v, May 12 2012 *)
PROG
(Magma) [n: n in [0..4500000] | Set(IntegerToSequence(n, 15)) subset {0, 14}]; // Vincenzo Librandi, Jun 05 2012
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ray Chandler, Aug 03 2004
STATUS
approved