|
|
|
|
#35 by Chai Wah Wu at Wed Sep 11 17:29:52 EDT 2024
|
|
|
Discussion
|
Wed Sep 11
| 19:21
| Kevin Ryde: The guts is a predicate test. Should offer that as a function. Let the user wrap it under multi layers of maps and filters.
|
| 19:28
| Kevin Ryde: (There's a bit-twiddle for going straight from n to a(n), based on choosing 1 or 0 at each bit position according as whether n is big enough for the number of terms skipped by choosing 1.)
|
|
|
|
#34 by Chai Wah Wu at Wed Sep 11 17:29:41 EDT 2024
|
| PROG
|
(Python)
from itertools import count, islice
def A131323_gen(startvalue=3): # generator of terms >= startvalue
return map(lambda n:(n<<1)+1, filter(lambda n:(~(n+1)&n).bit_length()&1, count(max(startvalue>>1, 1))))
A131323_list = list(islice(A131323_gen(), 30)) # Chai Wah Wu, Sep 11 2024
|
| STATUS
|
approved
editing
|
|
|
|
|
A075326
|
|
Anti-Fibonacci numbers: start with a(0) = 0, and extend by the rule that the next term is the sum of the two smallest numbers that are not in the sequence nor were used to form an earlier sum.
(history;
published version)
|
|
|
#79 by Chai Wah Wu at Wed Sep 11 16:08:28 EDT 2024
|
|
|
|
#78 by Chai Wah Wu at Wed Sep 11 16:08:18 EDT 2024
|
| PROG
|
def A075326(n): return 5*n-1-2+int((n|(~((m:=n-1>>1)+1)&m).bit_length())&1^1) if n else 0 # Chai Wah Wu, Sep 11 2024
|
| STATUS
|
proposed
editing
|
|
|
|
#77 by Chai Wah Wu at Wed Sep 11 16:06:10 EDT 2024
|
|
|
|
#76 by Chai Wah Wu at Wed Sep 11 16:06:05 EDT 2024
|
| PROG
|
def A075326(n): return 5*n+(--2 if (+int((n|(~((m:=n-1>>1)+1)&m).bit_length())&1 else -^1) if n else 0 # Chai Wah Wu, Sep 11 2024
|
| STATUS
|
reviewed
editing
|
|
|
|
|
|
|
#22 by Chai Wah Wu at Wed Sep 11 15:34:36 EDT 2024
|
|
|
|
#21 by Chai Wah Wu at Wed Sep 11 15:34:28 EDT 2024
|
| PROG
|
def A249032(n): return 4+int((n+1|(~((m:=n>>1)+1)&m).bit_length())&1^1)+int((n|(~((mk:=n-1>>1)+1)&mk).bit_length())&1) if n else 3 # Chai Wah Wu, Sep 11 2024
|
| STATUS
|
proposed
editing
|
|
|
|
#20 by Chai Wah Wu at Wed Sep 11 15:33:22 EDT 2024
|
|
|
|
#19 by Chai Wah Wu at Wed Sep 11 15:33:15 EDT 2024
|
| PROG
|
def A249032(n): return 54+int((n+1|(~((m:=n>>1)+1)&m).bit_length())&1^1)-)+int((n|(~((m:=n-1>>1)+1)&m).bit_length())&1^1) if n else 3 # Chai Wah Wu, Sep 11 2024
|
| STATUS
|
proposed
editing
|
|
|
|