login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A097251 Numbers whose set of base 5 digits is {0,4}. 13

%I #35 Feb 18 2024 07:58:10

%S 0,4,20,24,100,104,120,124,500,504,520,524,600,604,620,624,2500,2504,

%T 2520,2524,2600,2604,2620,2624,3000,3004,3020,3024,3100,3104,3120,

%U 3124,12500,12504,12520,12524,12600,12604,12620,12624,13000,13004,13020

%N Numbers whose set of base 5 digits is {0,4}.

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

%C The first 2^n terms of the sequence could be obtained using the Cantor-like process for the segment [0,5^n-1]. For example, for n=1 we have [0, {1,2,3},4] such that numbers outside of braces are the first 2 terms of the sequence; for n=2 we have [0, {1,2,3}, 4, {5,...,19}, 20, {21,22,23}, 24] such that the numbers outside of braces are the first 4 terms of the sequence, etc. - _Vladimir Shevelev_, Dec 17 2012

%H Vincenzo Librandi, <a href="/A097251/b097251.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = 4*A033042(n).

%F a(2n) = 5*a(n), a(2n+1) = a(2n)+4.

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

%t FromDigits[#,5]&/@Tuples[{0,4},6] (* _Harvey P. Dale_, Feb 01 2015 *)

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

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

%o (PARI) a(n) = 4*fromdigits(binary(n),5); \\ _Kevin Ryde_, Jun 03 2020

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

%K nonn,base

%O 0,2

%A _Ray Chandler_, Aug 03 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 14:13 EDT 2024. Contains 371960 sequences. (Running on oeis4.)