[go: up one dir, main page]

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!)
A361640 a(0) = 0, a(1) = 1; thereafter let b be the least power of 2 that does not appear in the binary expansions of a(n-2) and a(n-1), then a(n) is the smallest multiple of b that is not yet in the sequence. 2

%I #17 Mar 21 2023 09:23:27

%S 0,1,2,4,3,8,12,5,6,16,7,24,32,9,10,20,11,64,28,13,14,48,15,128,80,17,

%T 18,36,19,40,44,21,22,56,23,192,72,25,26,52,27,256,60,29,30,96,31,384,

%U 160,33,34,68,35,88,76,37,38,104,39,112,120,41,42,84,43

%N a(0) = 0, a(1) = 1; thereafter let b be the least power of 2 that does not appear in the binary expansions of a(n-2) and a(n-1), then a(n) is the smallest multiple of b that is not yet in the sequence.

%C This sequence is a variant of A359804; here we consider binary expansions, there prime factorizations.

%C All powers of 2 appear in the sequence, in ascending order.

%C This sequence is a permutation of the nonnegative integers (with inverse A361641): an odd term is always followed by two even terms, and after two even terms we can choose the least value not yet in the sequence.

%H Rémy Sigrist, <a href="/A361640/b361640.txt">Table of n, a(n) for n = 0..8192</a>

%H Rémy Sigrist, <a href="/A361640/a361640.gp.txt">PARI program</a>

%H Michael De Vlieger, <a href="/A361640/a361640.png">Log log scatterplot of a(n)</a>, n = 1..2^20.

%H Michael De Vlieger, <a href="/A361640/a361640_1.png">Log log scatterplot of a(n)</a>, n = 1..2^14, showing primes in red, composite prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue.

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%e The first terms, in decimal and in binary, alongside the corresponding b's, are:

%e n a(n) bin(a(n)) b

%e -- ---- --------- ---

%e 0 0 0 N/A

%e 1 1 1 N/A

%e 2 2 10 2

%e 3 4 100 4

%e 4 3 11 1

%e 5 8 1000 8

%e 6 12 1100 4

%e 7 5 101 1

%e 8 6 110 2

%e 9 16 10000 8

%e 10 7 111 1

%e 11 24 11000 8

%e 12 32 100000 32

%t nn = 120; c[_] = False; q[_] = 1;

%t f[n_] := f[n] = -1 + Position[Reverse@ IntegerDigits[n, 2], 1][[All, 1]];

%t a[1] = 0; a[2] = 1; c[0] = c[1] = True; i = f[0]; j = f[1];

%t Do[(k = q[#]; While[c[k #], k++]; q[#] = k; k *= #) &[

%t 2^First@ Complement[Range[0, Max[#] + 1], #] &[Union[i, j]]];

%t Set[{a[n], c[k], i, j}, {k, True, j, f[k]}], {n, 3, nn}];

%t Array[a, nn] (* _Michael De Vlieger_, Mar 20 2023 *)

%o (PARI) See Links section.

%Y Cf. A006519, A359804, A361641 (inverse).

%K nonn,base

%O 0,3

%A _Rémy Sigrist_, Mar 19 2023

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 August 30 02:56 EDT 2024. Contains 375521 sequences. (Running on oeis4.)