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!)
A356385 First differences of A353654 which is numbers with the same number of trailing 0 bits as other 0 bits. 1
2, 4, 3, 5, 7, 4, 5, 5, 10, 8, 4, 5, 13, 8, 10, 6, 10, 8, 4, 5, 9, 20, 16, 8, 10, 14, 8, 10, 6, 10, 8, 4, 5, 25, 16, 20, 12, 20, 16, 8, 10, 10, 20, 16, 8, 10, 14, 8, 10, 6, 10, 8, 4, 5, 17, 40, 32, 16, 20, 28, 16, 20, 12, 20, 16, 8, 10, 26, 16, 20, 12, 20, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = A353654(n+1) - A353654(n) for n > 0.
a(n) = {2^n if n < 3; 5 if d(n+1) = 1; otherwise 2*a(b(c(n+1))) - [d(n) = 1]} where b(n) = A000045(A072649(n) + 3) - n - 1, c(n) = A000045(A072649(n) + 2) - n and where d(n) = A010056(n). Here b(n+1) = A132665(n) + 1 and c(n+1) = A280514(n) for n > 0.
a(A000045(n)-1) = 5 for n > 4.
EXAMPLE
Terms from a(1) up to a(12) are {2, 4, 3, 5, 7, 4, 5, 5, 10, 8, 4, 5}.
Read it in the reverse order: {5, 4, 8, 10, 5, 5, 4, 7, 5, 3, 4, 2}. This is exactly what c(n+1) (for n=21..32) from the formulas section does.
Read F(k) terms (starting from the right side) in the reverse order: {5, 10, 8, 4, 5}, {7, 4, 5}, {3, 5}, {4}, {2}. This is exactly what b(n) (for n=21..32) from the formulas section does when it applied to the result of previous transform.
Combine blocks back to subsequence: {5, 10, 8, 4, 5, 7, 4, 5, 3, 5, 4, 2}.
Multiply each term by 2: {10, 20, 16, 8, 10, 14, 8, 10, 6, 10, 8, 4}.
Subtract 1 from the first term: {9, 20, 16, 8, 10, 14, 8, 10, 6, 10, 8, 4}.
As a result, we get terms from a(21) up to a(32). Same works for terms from a(1) up to a(F(k)-1) -> terms from a(F(k+1)) up to a(F(k+2)-2) for k > 2. Also obviously a(F(k)-1) = 5 for k > 4.
MATHEMATICA
Differences @ Join[{1}, Select[Range[2, 1000], IntegerExponent[#, 2] == Floor[Log2[# - 1]] - DigitCount[# - 1, 2, 1] &]] (* Amiram Eldar, Sep 21 2022 *)
PROG
(PARI) Zeckendorf(n)=my(A=n, B, m=1, v=[1]); while(fibonacci(m+1)<=n, m++); m--; A-=fibonacci(m+1); while(m>1, m--; B=0; if(A-fibonacci(m+1)>=0, A-=fibonacci(m+1); B=1); v=concat(v, B)); v \\ A189920
b1(n)=local(m); if(n<1, 0, m=0; until(fibonacci(m)>n, m++); m-2) \\ A072649
b2(n)=my(A=concat(Zeckendorf(fibonacci(b1(n)+3)-n-1), 0), B, x=3, v=[1]); while(x<=#A, B=0; if(A[x]==1, x++; B=1); v=concat(v, 1-A[x-B]); x++); fromdigits(v, 2) \\ A247648 with rewrite 1 -> 1, 01 -> 0 applied to binary expansion
c1(n)=if(n<5, 4*(n-1) - hammingweight(n-1) + (n==1), my(A=2*b2(n-1) + 1); A*2^(logint(A, 2) - hammingweight(A) + 1)) \\ A353654
a(n)=c1(n+1) - c1(n)
(PARI) isok(k) = if (k==1, 1, (logint(k-1, 2)-hammingweight(k-1) == valuation(k, 2))); \\ A353654
lista(nn) = my(v=select(isok, [1..nn])); vector(#v-1, k, v[k+1] - v[k]); \\ Michel Marcus, Sep 21 2022
(Python 3.10+)
from itertools import pairwise, count, islice
def A356385_gen(): # generator of terms
return map(lambda x:x[1]-x[0], pairwise(filter(lambda n:(~n & n-1).bit_length()<<1 == n.bit_length()-n.bit_count(), count(1))))
A356385_list = list(islice(A356385_gen(), 30)) # Chai Wah Wu, Oct 14 2022
CROSSREFS
Sequence in context: A338835 A210536 A102767 * A336640 A258238 A166266
KEYWORD
nonn,base,changed
AUTHOR
Mikhail Kurkov, Aug 05 2022 [verification needed]
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 April 27 08:58 EDT 2024. Contains 372017 sequences. (Running on oeis4.)