The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A269167 Permutation of natural numbers: a(1) = 1, a(A269160(n)) = 2*a(n), a(A269164(n+1)) = 1+(2*a(n)). 3
1, 3, 7, 15, 31, 63, 2, 127, 5, 255, 11, 511, 14, 6, 23, 1023, 29, 13, 47, 2047, 59, 27, 95, 4095, 4, 126, 62, 30, 119, 55, 191, 8191, 9, 253, 125, 61, 239, 111, 383, 16383, 19, 507, 251, 123, 479, 223, 767, 32767, 46, 12, 28, 1022, 22, 510, 39, 254, 1015, 503, 247, 959, 447, 1535, 10, 65535, 93, 25, 57, 2045, 45 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(1) = 1, for n > 1, if A269162(n) > 0 [when n is in A269163], a(n) = 2*a(A269162(n)), otherwise [when n is in A269164], a(n) = 1 + 2*a(A269169(n)-1).
MATHEMATICA
terms = 100; A269160[n_] := BitXor[n, BitOr[2 n, 4 n]]; f[max_] := f[max] = (s = Sort[Table[A269160[n], {n, 0, max}]]; Complement[Range[Last[s]], s][[1 ;; terms]]); f[terms]; f[max = 2 terms]; While[f[max] != f[max/2], max = 2 max]; A269164[n_] := f[max][[n]]; a[1]=1; eq[n_] := a[A269160[n]] == 2*a[n] && a[A269164[n+1]] == 1 + 2*a[n]; A269167 = Array[a, terms-1] /. Solve[Array[eq, terms-1]] // First (* Jean-François Alcover, Feb 23 2016 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A269167 n) (cond ((= 1 n) n) ((not (zero? (A269162 n))) (* 2 (A269167 (A269162 n)))) (else (+ 1 (* 2 (A269167 (- (A269169 n) 1)))))))
CROSSREFS
Inverse: A269168.
Sequence in context: A006739 A119407 A224521 * A261586 A043734 A151359
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 21 2016
STATUS
approved

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 June 5 19:33 EDT 2024. Contains 373110 sequences. (Running on oeis4.)