login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Numbers whose set of base 7 digits is {0,6}.
2

%I #24 Aug 12 2023 13:44:15

%S 0,6,42,48,294,300,336,342,2058,2064,2100,2106,2352,2358,2394,2400,

%T 14406,14412,14448,14454,14700,14706,14742,14748,16464,16470,16506,

%U 16512,16758,16764,16800,16806,100842,100848,100884,100890,101136

%N Numbers whose set of base 7 digits is {0,6}.

%C n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 7 for every i.

%H Vincenzo Librandi, <a href="/A097253/b097253.txt">Table of n, a(n) for n = 1..200</a>

%F a(n) = 6*A033044(n).

%F a(2n) = 7*a(n), a(2n+1) = a(2n)+6.

%t fQ[n_]:=Union@Join[{0,6},IntegerDigits[n,7]]=={0,6};Select[Range[0,140000],fQ] (* _Vincenzo Librandi_, May 25 2012 *)

%t FromDigits[#,7]&/@Tuples[{0,6},6] (* This program is several thousand times faster than the first program, above. *) (* _Harvey P. Dale_, Aug 12 2023 *)

%o (Magma) [n: n in [0..200000] | Set(IntegerToSequence(n, 7)) subset {0, 6}]; // _Vincenzo Librandi_, May 25 2012

%o (Maxima) a[0]:0$ a[n]:=7*a[floor(n/2)]+3*(1-(-1)^n)$ makelist(a[n], n, 0, 36); /* _Bruno Berselli_, May 25 2012 */

%Y Cf. A001196, A005823, A097251-A097262.

%K nonn,base

%O 1,2

%A _Ray Chandler_, Aug 03 2004

%E Offset corrected by _Arkadiusz Wesolowski_, Nov 09 2013