cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 478 results. Next

A035263 Trajectory of 1 under the morphism 0 -> 11, 1 -> 10; parity of 2-adic valuation of 2n: a(n) = A000035(A001511(n)).

Original entry on oeis.org

1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1
Offset: 1

Views

Author

Keywords

Comments

First Feigenbaum symbolic (or period-doubling) sequence, corresponding to the accumulation point of the 2^{k} cycles through successive bifurcations.
To construct the sequence: start with 1 and concatenate: 1,1, then change the last term (1->0; 0->1) gives: 1,0. Concatenate those 2 terms: 1,0,1,0, change the last term: 1,0,1,1. Concatenate those 4 terms: 1,0,1,1,1,0,1,1 change the last term: 1,0,1,1,1,0,1,0, etc. - Benoit Cloitre, Dec 17 2002
Let T denote the present sequence. Here is another way to construct T. Start with the sequence S = 1,0,1,,1,0,1,,1,0,1,,1,0,1,,... and fill in the successive holes with the successive terms of the sequence T (from paper by Allouche et al.). - Emeric Deutsch, Jan 08 2003 [Note that if we fill in the holes with the terms of S itself, we get A141260. - N. J. A. Sloane, Jan 14 2009]
From N. J. A. Sloane, Feb 27 2009: (Start)
In more detail: define S to be 1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1,0,1___...
If we fill the holes with S we get A141260:
1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0,
........1.........0.........1.........1.........0.......1.........1.........0...
- the result is
1..0..1.1.1..0..1.0.1..0..1.1.1..0..1.1.1..0..1.0.1.... = A141260.
But instead, if we define T recursively by filling the holes in S with the terms of T itself, we get A035263:
1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0, 1___1, 0,
........1.........0.........1.........1.........1.......0.........1.........0...
- the result is
1..0..1.1.1..0..1.0.1..0..1.1.1..0..1.1.1..0..1.1.1.0.1.0.1..0..1.1.1..0..1.0.1.. = A035263. (End)
Characteristic function of A003159, i.e., A035263(n)=1 if n is in A003159 and A035263(n)=0 otherwise (from paper by Allouche et al.). - Emeric Deutsch, Jan 15 2003
This is the sequence of R (=1), L (=0) moves in the Towers of Hanoi puzzle: R, L, R, R, R, L, R, L, R, L, R, R, R, ... - Gary W. Adamson, Sep 21 2003
Manfred Schroeder, p. 279 states, "... the kneading sequences for unimodal maps in the binary notation, 0, 1, 0, 1, 1, 1, 0, 1..., are obtained from the Morse-Thue sequence by taking sums mod 2 of adjacent elements." On p. 278, in the chapter "Self-Similarity in the Logistic Parabola", he writes, "Is there a closer connection between the Morse-Thue sequence and the symbolic dynamics of the superstable orbits? There is indeed. To see this, let us replace R by 1 and C and L by 0." - Gary W. Adamson, Sep 21 2003
Partial sums modulo 2 of the sequence 1, a(1), a(1), a(2), a(2), a(3), a(3), a(4), a(4), a(5), a(5), a(6), a(6), ... . - Philippe Deléham, Jan 02 2004
Parity of A007913, A065882 and A065883. - Philippe Deléham, Mar 28 2004
The length of n-th run of 1's in this sequence is A080426(n). - Philippe Deléham, Apr 19 2004
Also parity of A005043, A005773, A026378, A104455, A117641. - Philippe Deléham, Apr 28 2007
Equals parity of the Towers of Hanoi, or ruler sequence (A001511), where the Towers of Hanoi sequence (1, 2, 1, 3, 1, 2, 1, 4, ...) denotes the disc moved, labeled (1, 2, 3, ...) starting from the top; and the parity of (1, 2, 1, 3, ...) denotes the direction of the move, CW or CCW. The frequency of CW moves converges to 2/3. - Gary W. Adamson, May 11 2007
A conjectured identity relating to the partition sequence, A000041: p(x) = A(x) * A(x^2) when A(x) = the Euler transform of A035263 = polcoeff A174065: (1 + x + x^2 + 2x^3 + 3x^4 + 4x^5 + ...). - Gary W. Adamson, Mar 21 2010
a(n) is 1 if the number of trailing zeros in the binary representation of n is even. - Ralf Stephan, Aug 22 2013
From Gary W. Adamson, Mar 25 2015: (Start)
A conjectured identity relating to the partition sequence, A000041 as polcoeff p(x); A003159, and its characteristic function A035263: (1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, ...); and A036554 indicating n-th terms with zeros in A035263: (2, 6, 8, 10, 14, 18, 22, ...).
The conjecture states that p(x) = A(x) = A(x^2) when A(x) = polcoeffA174065 = the Euler transform of A035263 = 1/(1-x)*(1-x^3)*(1-x^4)*(1-x^5)*... = (1 + x + x^2 + 2x^3 + 3x^4 + 4x^5 + ...) and the aerated variant = the Euler transform of the complement of A035263: 1/(1-x^2)*(1-x^6)*(1-x^8)*... = (1 + x^2 + x^4 + 2x^6 + 3x^8 + 4x^10 + ...).
(End)
The conjecture above was proved by Jean-Paul Allouche on Dec 21 2013.
Regarded as a column vector, this sequence is the product of A047999 (Sierpinski's gasket) regarded as an infinite lower triangular matrix and A036497 (the Fredholm-Rueppel sequence) where the 1's have alternating signs, 1, -1, 0, 1, 0, 0, 0, -1, .... - Gary W. Adamson, Jun 02 2021
The numbers of 1's through n (A050292) can be determined by starting with the binary (say for 19 = 1 0 0 1 1) and writing: next term is twice current term if 0, otherwise twice plus 1. The result is 1, 2, 4, 9, 19. Take the difference row, = 1, 1, 2, 5, 10; and add the odd-indexed terms from the right: 5, 4, 3, 2, 1 = 10 + 2 + 1 = 13. The algorithm is the basis for determining the disc configurations in the tower of Hanoi game, as shown in the Jul 24 2021 comment of A060572. - Gary W. Adamson, Jul 28 2021

References

  • Karamanos, Kostas. "From symbolic dynamics to a digital approach." International Journal of Bifurcation and Chaos 11.06 (2001): 1683-1694. (Full version. See p. 1685)
  • Karamanos, K. (2000). From symbolic dynamics to a digital approach: chaos and transcendence. In Michel Planat (Ed.), Noise, Oscillators and Algebraic Randomness (Lecture Notes in Physics, pp. 357-371). Springer, Berlin, Heidelberg. (Short version. See p. 359)
  • Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W. H. Freeman, 1991
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 892, column 2, Note on p. 84, part (a).

Crossrefs

Parity of A001511. Anti-parity of A007814.
Absolute values of first differences of A010060. Apart from signs, same as A029883. Essentially the same as A056832.
Swapping 0 and 1 gives A096268.
Cf. A033485, A050292 (partial sums), A089608, A088172, A019300, A039982, A073675, A121701, A141260, A000041, A174065, A220466, A154269 (Mobius transform).
Limit of A317957(n) for large n.

Programs

  • Haskell
    import Data.Bits (xor)
    a035263 n = a035263_list !! (n-1)
    a035263_list = zipWith xor a010060_list $ tail a010060_list
    -- Reinhard Zumkeller, Mar 01 2012
    
  • Maple
    nmax:=105: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := (p+1) mod 2 od: od: seq(a(n), n=1..nmax); # Johannes W. Meijer, Feb 07 2013
    A035263 := n -> 1 - padic[ordp](n, 2) mod 2:
    seq(A035263(n), n=1..105); # Peter Luschny, Oct 02 2018
  • Mathematica
    a[n_] := a[n] = If[ EvenQ[n], 1 - a[n/2], 1]; Table[ a[n], {n, 1, 105}] (* Or *)
    Rest[ CoefficientList[ Series[ Sum[ x^(2^k)/(1 + (-1)^k*x^(2^k)), {k, 0, 20}], {x, 0, 105}], x]]
    f[1] := True; f[x_] := Xor[f[x - 1], f[Floor[x/2]]]; a[x_] := Boole[f[x]] (* Ben Branman, Oct 04 2010 *)
    a[n_] := If[n == 0, 0, 1 - Mod[ IntegerExponent[n, 2], 2]]; (* Jean-François Alcover, Jul 19 2013, after Michael Somos *)
    Nest[ Flatten[# /. {0 -> {1, 1}, 1 -> {1, 0}}] &, {0}, 7] (* Robert G. Wilson v, Jul 23 2014 *)
    SubstitutionSystem[{0->{1,1},1->{1,0}},1,{7}][[1]] (* Harvey P. Dale, Jun 06 2022 *)
  • PARI
    {a(n) = if( n==0, 0, 1 - valuation(n, 2)%2)}; /* Michael Somos, Sep 04 2006 */
    
  • PARI
    {a(n) = if( n==0, 0, n = abs(n); subst( Pol(binary(n)) - Pol(binary(n-1)), x, 1)%2)}; /* Michael Somos, Sep 04 2006 */
    
  • PARI
    {a(n) = if( n==0, 0, n = abs(n); direuler(p=2, n, 1 / (1 - X^((p<3) + 1)))[n])}; /* Michael Somos, Sep 04 2006 */
    
  • Python
    def A035263(n): return (n&-n).bit_length()&1 # Chai Wah Wu, Jan 09 2023
  • Scheme
    (define (A035263 n) (let loop ((n n) (i 1)) (cond ((odd? n) (modulo i 2)) (else (loop (/ n 2) (+ 1 i)))))) ;; (Use mod instead of modulo in R6RS) Antti Karttunen, Sep 11 2017
    

Formula

Absolute values of first differences (A029883) of Thue-Morse sequence (A001285 or A010060). Self-similar under 10->1 and 11->0.
Series expansion: (1/x) * Sum_{i>=0} (-1)^(i+1)*x^(2^i)/(x^(2^i)-1). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 17 2003
a(n) = Sum_{k>=0} (-1)^k*(floor((n+1)/2^k)-floor(n/2^k)). - Benoit Cloitre, Jun 03 2003
Another g.f.: Sum_{k>=0} x^(2^k)/(1+(-1)^k*x^(2^k)). - Ralf Stephan, Jun 13 2003
a(2*n) = 1-a(n), a(2*n+1) = 1. - Ralf Stephan, Jun 13 2003
a(n) = parity of A033485(n). - Philippe Deléham, Aug 13 2003
Equals A088172 mod 2, where A088172 = 1, 2, 3, 7, 13, 26, 53, 106, 211, 422, 845, ... (first differences of A019300). - Gary W. Adamson, Sep 21 2003
a(n) = a(n-1) - (-1)^n*a(floor(n/2)). - Benoit Cloitre, Dec 02 2003
a(1) = 1 and a(n) = abs(a(n-1) - a(floor(n/2))). - Benoit Cloitre, Dec 02 2003
a(n) = 1 - A096268(n+1); A050292 gives partial sums. - Reinhard Zumkeller, Aug 16 2006
Multiplicative with a(2^k) = 1 - (k mod 2), a(p^k) = 1, p > 2. Dirichlet g.f.: Product_{n = 4 or an odd prime} (1/(1-1/n^s)). - Christian G. Bower, May 18 2005
a(-n) = a(n). a(0)=0. - Michael Somos, Sep 04 2006
Dirichlet g.f.: zeta(s)*2^s/(2^s+1). - Ralf Stephan, Jun 17 2007
a(n+1) = a(n) XOR a(ceiling(n/2)), a(1) = 1. - Reinhard Zumkeller, Jun 11 2009
Let D(x) be the generating function, then D(x) + D(x^2) == x/(1-x). - Joerg Arndt, May 11 2010
a(n) = A010060(n) XOR A010060(n+1); a(A079523(n)) = 0; a(A121539(n)) = 1. - Reinhard Zumkeller, Mar 01 2012
a((2*n-1)*2^p) = (p+1) mod 2, p >= 0 and n >= 1. - Johannes W. Meijer, Feb 07 2013
a(n) = A000035(A001511(n)). - Omar E. Pol, Oct 29 2013
a(n) = 2-A056832(n) = (5-A089608(n))/4. - Antti Karttunen, Sep 11 2017, after Benoit Cloitre
For n >= 0, a(n+1) = M(2n) mod 2 where M(n) is the Motzkin number A001006 (see Deutsch and Sagan 2006 link). - David Callan, Oct 02 2018
a(n) = A038712(n) mod 3. - Kevin Ryde, Jul 11 2019
Given any n in the form (k * 2^m, k odd), extract k and m. Categorize the results into two outcomes of (k, m, even or odd). If (k, m) is (odd, even) substitute 1. If (odd, odd), denote the result 0. Example: 5 = (5 * 2^0), (odd, even, = 1). (6 = 3 * 2^1), (odd, odd, = 0). - Gary W. Adamson, Jun 23 2021

Extensions

Alternative description added to the name by Antti Karttunen, Sep 11 2017

A286161 Compound filter: a(n) = T(A001511(n), A046523(n)), where T(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 5, 2, 18, 2, 23, 2, 59, 7, 23, 2, 94, 2, 23, 16, 195, 2, 80, 2, 94, 16, 23, 2, 355, 7, 23, 29, 94, 2, 467, 2, 672, 16, 23, 16, 706, 2, 23, 16, 355, 2, 467, 2, 94, 67, 23, 2, 1331, 7, 80, 16, 94, 2, 302, 16, 355, 16, 23, 2, 1894, 2, 23, 67, 2422, 16, 467, 2, 94, 16, 467, 2, 2779, 2, 23, 67, 94, 16, 467, 2, 1331, 121, 23, 2, 1894, 16, 23, 16, 355, 2, 1832
Offset: 1

Views

Author

Antti Karttunen, May 04 2017

Keywords

Crossrefs

Programs

  • PARI
    A001511(n) = (1+valuation(n,2));
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    A286161(n) = (2 + ((A001511(n)+A046523(n))^2) - A001511(n) - 3*A046523(n))/2;
    for(n=1, 10000, write("b286161.txt", n, " ", A286161(n)));
    
  • Python
    from sympy import factorint
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a001511(n): return 2 + bin(n - 1)[2:].count("1") - bin(n)[2:].count("1")
    def a(n): return T(a001511(n), a046523(n)) # Indranil Ghosh, May 06 2017
  • Scheme
    (define (A286161 n) (* (/ 1 2) (+ (expt (+ (A001511 n) (A046523 n)) 2) (- (A001511 n)) (- (* 3 (A046523 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A001511(n)+A046523(n))^2) - A001511(n) - 3*A046523(n)).

A286162 Compound filter: a(n) = T(A001511(n), A278222(n)), where T(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

2, 5, 7, 9, 16, 12, 29, 14, 16, 23, 67, 18, 67, 38, 121, 20, 16, 23, 67, 31, 436, 80, 277, 25, 67, 80, 631, 48, 277, 138, 497, 27, 16, 23, 67, 31, 436, 80, 277, 40, 436, 467, 1771, 94, 1771, 302, 1129, 33, 67, 80, 631, 94, 1771, 668, 2557, 59, 277, 302, 2557, 156, 1129, 530, 2017, 35, 16, 23, 67, 31, 436, 80, 277, 40, 436, 467, 1771, 94, 1771, 302, 1129, 50
Offset: 1

Views

Author

Antti Karttunen, May 04 2017

Keywords

Crossrefs

Programs

  • PARI
    A001511(n) = (1+valuation(n,2));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of M. F. Hasler
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    A278222(n) = A046523(A005940(1+n));
    A286162(n) = (2 + ((A001511(n)+A278222(n))^2) - A001511(n) - 3*A278222(n))/2;
    for(n=1, 10000, write("b286162.txt", n, " ", A286162(n)));
    
  • Python
    from sympy import prime, factorint
    import math
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a278222(n): return a046523(a005940(n + 1))
    def a001511(n): return bin(n)[2:][::-1].index("1") + 1
    def a(n): return T(a001511(n), a278222(n)) # Indranil Ghosh, May 05 2017
  • Scheme
    (define (A286162 n) (* (/ 1 2) (+ (expt (+ (A001511 n) (A278222 n)) 2) (- (A001511 n)) (- (* 3 (A278222 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A001511(n)+A278222(n))^2) - A001511(n) - 3*A278222(n)).

A286357 One more than the exponent of the highest power of 2 dividing sigma(n): a(n) = A001511(A000203(n)).

Original entry on oeis.org

1, 1, 3, 1, 2, 3, 4, 1, 1, 2, 3, 3, 2, 4, 4, 1, 2, 1, 3, 2, 6, 3, 4, 3, 1, 2, 4, 4, 2, 4, 6, 1, 5, 2, 5, 1, 2, 3, 4, 2, 2, 6, 3, 3, 2, 4, 5, 3, 1, 1, 4, 2, 2, 4, 4, 4, 5, 2, 3, 4, 2, 6, 4, 1, 3, 5, 3, 2, 6, 5, 4, 1, 2, 2, 3, 3, 6, 4, 5, 2, 1, 2, 3, 6, 3, 3, 4, 3, 2, 2, 5, 4, 8, 5, 4, 3, 2, 1, 3, 1, 2, 4, 4, 2, 7, 2, 3, 4, 2, 4, 4, 4, 2, 5, 5, 2, 2, 3, 5, 4
Offset: 1

Views

Author

Antti Karttunen, May 10 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[IntegerExponent[DivisorSigma[1,n],2]+1,{n,120}] (* Harvey P. Dale, Sep 04 2023 *)
  • PARI
    A001511(n) = (1+valuation(n,2));
    A286357(n) = A001511(sigma(n));
    for(n=1, 10000, write("b286357.txt", n, " ", A286357(n)));
    
  • Python
    from sympy import divisor_sigma as D
    def a001511(n): return bin(n)[2:][::-1].index("1") + 1
    def a(n): return a001511(D(n)) # Indranil Ghosh, May 12 2017
    
  • Python
    from sympy import divisor_sigma
    def A286357(n): return ((m:=int(divisor_sigma(n)))&-m).bit_length() # Chai Wah Wu, Jul 10 2022
  • Scheme
    (define (A286357 n) (A001511 (A000203 n)))
    (define (A286357 n) (A070939 (/ (A000203 n) (A161942 n))))
    

Formula

a(n) = A001511(A000203(n)).
a(n) = 1 + A000523(A000203(n)/A161942(n)). [See also A082903.]
a(n) = 1 iff A053866(n) = 1.

A085058 a(n) = A001511(n+1) + 1.

Original entry on oeis.org

2, 3, 2, 4, 2, 3, 2, 5, 2, 3, 2, 4, 2, 3, 2, 6, 2, 3, 2, 4, 2, 3, 2, 5, 2, 3, 2, 4, 2, 3, 2, 7, 2, 3, 2, 4, 2, 3, 2, 5, 2, 3, 2, 4, 2, 3, 2, 6, 2, 3, 2, 4, 2, 3, 2, 5, 2, 3, 2, 4, 2, 3, 2, 8, 2, 3, 2, 4, 2, 3, 2, 5, 2, 3, 2, 4, 2, 3, 2, 6, 2, 3, 2, 4, 2, 3, 2, 5, 2, 3, 2, 4, 2, 3, 2, 7, 2, 3, 2, 4, 2, 3, 2, 5, 2
Offset: 0

Views

Author

N. J. A. Sloane, Aug 11 2003

Keywords

Comments

Number of divisors of 2n+2 of the form 2^k. - Giovanni Teofilatto, Jul 25 2007
Number of steps for iteration of map x -> (3/2)*ceiling(x) to reach an integer when started at 2*n+1.
Also number of steps for iteration of map x -> (3/2)*floor(x) to reach an integer when started at 2*n+3. - Benoit Cloitre, Sep 27 2003
The first time that a(n) = e+1 is when n is of the form 2^e - 1. - Robert G. Wilson v, Sep 28 2003
Let 2^k(n) = largest power of 2 dividing tangent number A000182(n). Then a(n-1) = 2*n - k(n). - Yasutoshi Kohmoto, Dec 23 2006
a(n) is the number of integers generated by b(i+1) = (3+2n)*(b(i) + b(i-1))/2, following these two initial values, b(0) = b(1) = 1. Thereafter only non-integers are generated. - Richard R. Forberg, Nov 09 2014
a(n) is the 2-adic valuation of 4*n+4, which is equal to the number of trailing 1-bits of 4*n+3 in binary. - Ruud H.G. van Tol, Sep 11 2023

Crossrefs

Programs

  • Magma
    [Valuation(n+1, 2)+2: n in [0..100]]; // Vincenzo Librandi, Jan 16 2016
    
  • Maple
    f := x->(3/2)*ceil(x); g := proc(n) local t1,c; global f; t1 := f(n); c := 1; while not type(t1, 'integer') do c := c+1; t1 := f(t1); od; RETURN([c,t1]); end;
    a := n ->  A001511(n+1) + 1: A001511 := n -> padic[ordp](2*n, 2): seq(a(n), n=0..104); # Johannes W. Meijer, Dec 22 2012
  • Mathematica
    g = 3 Ceiling[ # ]/2 &; f[n_?OddQ] := Length @ NestWhileList[ g, g[n], !IntegerQ[ # ] & ]; Table[ f[n], {n, 1, 210, 2}]
  • PARI
    A085058(n)=if(n<0,0,c=2*n+7/2; x=0; while(frac(c)>0,c=3/2*floor(c); x++); x) \\ Benoit Cloitre, Sep 27 2003
    
  • PARI
    A085058(n)=if(n<0,0,c=(2*n+1)*3/2; x=1; while(frac(c)>0,c=3/2*ceil(c); x++); x) \\ Benoit Cloitre, Sep 27 2003
    
  • PARI
    a(n) = valuation(n+1,2)+2; \\ Michel Marcus, Jan 15 2016
    
  • Python
    def A085058(n): return (~(n+1) & n).bit_length()+2 # Chai Wah Wu, Apr 14 2023

Formula

a(n) = A007814(3^(n+1) - (-1)^(n+1)) = A007814(A105723(n+1)). - Reinhard Zumkeller, Apr 18 2005
a(n) = A001511(n+1) + 1 = A001511(2*n+2). - Ray Chandler, Jul 29 2007
a(n) = A007814(5^(n+1) - 1). - Ivan Neretin, Jan 15 2016
a(n) = A007814(4*(n+1)) = A007814(n+1) + 2. - Ruud H.G. van Tol, Sep 11 2023
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3. - Amiram Eldar, Sep 13 2024

Extensions

Edited by Franklin T. Adams-Watters, Dec 09 2013

A371176 Numbers k such that A000120(k) <= A001511(k).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 24, 28, 32, 34, 36, 40, 44, 48, 52, 56, 64, 66, 68, 72, 76, 80, 84, 88, 96, 100, 104, 112, 120, 128, 130, 132, 136, 140, 144, 148, 152, 160, 164, 168, 176, 184, 192, 196, 200, 208, 216, 224, 232, 240, 256, 258, 260, 264, 268
Offset: 1

Views

Author

Mikhail Kurkov, Mar 14 2024

Keywords

Comments

It appears that this sequence is obtained when ordering Schreier sets as explained in the Bird link. See decM(n) PARI code. - Michel Marcus, May 31 2024
That is correct since the binary representation of these numbers can be put into 1-to-1 correspondence with Schreier sets, which satisfy |X| <= min X, using the indicator function of X as the bits (starting from the right, LSB). The reason is that A000120 then computes |X| and A001511 computes min X. For example, the Schreier set X = {2, 5} can be mapped to 10010_2 = 18. - Michael S. Branicky, May 31 2024
From David A. Corneth, May 31 2024: (Start)
If k is in the sequence then so is 2*k.
a(A000045(k)) = 2^(k-2) for k >= 2. (End)
Apart from a(1), all terms are even. - Paolo Xausa, May 31 2024
Zeckendorf representation of n with rewrite 0 -> 0, {0, 1} -> 1 and k-1 zeros appended to the right side (where k is the number of ones in the given representation) and then interpreted as binary expansion is the same as a(n) (see the first formula). - Mikhail Kurkov, Oct 21 2024

Crossrefs

Programs

  • Maple
    filter:= proc(n) convert(convert(n,base,2),`+`) <= 1+padic:-ordp(n,2) end proc:
    select(filter, [1,seq(i,i=2..1000,2)]); # Robert Israel, Oct 20 2024
  • Mathematica
    Join[{1}, Select[Range[2, 1000, 2], DigitSum[#, 2] <= IntegerExponent[#, 2] + 1 &]] (* Paolo Xausa, Aug 12 2025 *)
  • PARI
    isok(n) = hammingweight(n) <= (valuation(n, 2) + 1)
    
  • PARI
    M(n) = my(list=List()); for (i=1, n, forsubset(i, s, my(bOk = if (#s && (vecmax(s) == n), #s <= vecmin(s), 0)); if (bOk, listput(list, vecsort(Vec(s),,4))););); Vec(list);
    decM(nn) = my(v = vector(nn, k, M(k)), list=List()); for (i=1, #v, my(vi = v[i]); for (j=1, #vi, my(s = vecsort(vi[j]), slist=List(), m = vecmax(s)); forstep(k=m, 1, -1, listput(slist, sign(vecsearch(s, k)))); listput(list, fromdigits(Vec(slist), 2)););); vecsort(Vec(list)); \\ Michel Marcus, May 31 2024
    
  • Python
    def ok(n): return n.bit_count() <= (-n&n).bit_length()
    print([k for k in range(1, 300) if ok(k)]) # Michael S. Branicky, May 31 2024
    
  • Python
    # Assuming the list starts with 0.
    def a():
        n = na = nb = 1
        while True:
            yield not(nb < (na - 1) << 1)
            nb, na = na, n.bit_count()
            n += 1
    aList = a(); print([n for n in range(77) if next(aList)]) # Peter Luschny, Jun 07 2024

Formula

a(n) = b(n)*A001316(b(n))/2 where b(n) = A048679(n).
a(n) = Sum_{i=0..n-1} 2^A213911(i).
a(n) = 2^(A072649(n) - 1) + [c(n) > 0]*2*a(c(n)) where c(n) = A066628(n).
a(n) = 2*a(A005206(n)) - A003849(n)*2^A007895(n-1) for n > 1 with a(1) = 1.
Conjecture: lim sup_{n -> oo} log(a(n))/log(n) = log(2) / log((1 + sqrt(5))/2) = 1.440420090412556479... = A104287. - Vaclav Kotesovec, Aug 12 2025

A349444 Dirichlet convolution of A003602 (Kimberling's paraphrases) with A092673 (Dirichlet inverse of A001511).

Original entry on oeis.org

1, -1, 1, 0, 2, -1, 3, 0, 3, -2, 5, 0, 6, -3, 4, 0, 8, -3, 9, 0, 6, -5, 11, 0, 10, -6, 9, 0, 14, -4, 15, 0, 10, -8, 12, 0, 18, -9, 12, 0, 20, -6, 21, 0, 12, -11, 23, 0, 21, -10, 16, 0, 26, -9, 20, 0, 18, -14, 29, 0, 30, -15, 18, 0, 24, -10, 33, 0, 22, -12, 35, 0, 36, -18, 20, 0, 30, -12, 39, 0, 27, -20, 41, 0, 32
Offset: 1

Views

Author

Antti Karttunen, Nov 18 2021

Keywords

Crossrefs

Cf. A001511, A003602, A008683, A092673, A349445 (Dirichlet inverse), A349446 (sum with it).
Cf. also A349431, A349447.

Programs

  • Mathematica
    s[n_] := MoebiusMu[n] - If[OddQ[n], 0, MoebiusMu[n/2]]; k[n_] := (n/2^IntegerExponent[n, 2] + 1)/2; a[n_] := DivisorSum[n, s[#]*k[n/#] &]; Array[a, 100] (* Amiram Eldar, Nov 19 2021 *)
  • PARI
    A003602(n) = (1+(n>>valuation(n,2)))/2;
    A092673(n) = if(n<1, 0, moebius(n) - if( n%2, 0, moebius(n/2))); \\ From A092673
    A349444(n) = sumdiv(n,d,A003602(n/d)*A092673(d));

Formula

a(n) = Sum_{d|n} A003602(n/d) * A092673(d).

A249814 "Mountains of Eratosthenes" permutation: a(1) = 1, a(n) = A249741(A001511(n), a(A003602(n))).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 7, 6, 9, 14, 15, 24, 13, 20, 11, 10, 17, 26, 27, 34, 29, 44, 47, 48, 25, 38, 39, 54, 21, 32, 19, 12, 33, 50, 51, 64, 53, 80, 67, 76, 57, 86, 87, 114, 93, 140, 95, 120, 49, 74, 75, 94, 77, 116, 107, 90, 41, 62, 63, 84, 37, 56, 23, 16, 65, 98, 99, 124, 101, 152, 127, 118, 105, 158, 159, 204, 133, 200, 151, 142
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

This sequence is a "recursed variant" of A249811.
From Antti Karttunen, Jan 18 2015: (Start)
This can be viewed as an entanglement or encoding permutation where the complementary pairs of sequences to be interwoven together are even and odd numbers (A005843/A005408) which are entangled with another complementary pair: even numbers in the order they appear in A253886 and odd numbers in their usual order: (A253886/A005408).
From the above follows also that this sequence can be represented as a binary tree. Each child to the left is obtained by doubling the parent and subtracting one, and each child to the right is obtained by applying A253886 to the parent:
1
|
...................2...................
3 4
5......../ \........8 7......../ \........6
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
9 14 15 24 13 20 11 10
17 26 27 34 29 44 47 48 25 38 39 54 21 32 19 12
(End)
For listening I recommend some (mostly) percussive MIDI-instrument and the pitch offset set to at least 29 and the tempo (rate) to about 60. - Antti Karttunen, Feb 17 2015

Crossrefs

Inverse: A249813.
Similar or related permutations: A246684, A249811, A250244, A252755.
Compare also the scatterplot of this sequence to the graphs of A252755 and A246684.
Differs from A246684 for the first time at n=14, where a(14) = 20, while A246684(14) = 26.

Formula

In the following formulas, A083221 and A249741 are interpreted as bivariate functions:
a(1) = 1, for n>1: a(n) = A083221(A001511(n), a(A003602(n))) - 1 = A249741(A001511(n), a(A003602(n))).
a(1) = 1, a(2n) = A253886(a(n)), a(2n+1) = (2*a(n+1))-1. - Antti Karttunen, Jan 18 2015
As a composition of other permutations:
a(n) = A250244(A246684(n)).
Other identities. For all n >= 1, the following holds:
a(n) = (1+a((2*n)-1))/2. [The odd bisection from a(1) onward with one added and then halved gives the sequence back.]
a(A000079(n-1)) = A006093(n).

A302045 a(1) = 0, for n > 1, a(n) = A001511(A078898(n)); Number of instances of the smallest prime factor A020639(n) in nonstandard factorization of n that is based on the sieve of Eratosthenes (A083221).

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 3, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 5, 2, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 4, 1, 1, 4, 2, 1, 1, 2, 1, 1, 3, 3, 2, 1, 1, 2, 1, 1, 1, 6, 1, 1, 1, 2, 3, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 4, 2, 1, 1, 2, 2, 1, 1, 3, 1, 1, 3, 2, 5, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 3, 2
Offset: 1

Views

Author

Antti Karttunen, Mar 31 2018

Keywords

Comments

Iterating the map n -> A302044(n) until 1 is reached, and taking the smallest prime factor (A020639) of each term gives a sequence of distinct primes in ascending order, while applying this function (A302045) to those terms gives the corresponding "exponents" of those primes, that is, the count of consecutive occurrences of each prime when iterating the map n -> A302042(n), which gives the same primes with repetitions. Permutation pair A250245/A250246 maps between this non-standard prime factorization of n and the ordinary factorization of n. See also comments and examples in A302042.

Crossrefs

Programs

Formula

a(1) = 0, for n > 1, a(n) = A001511(A078898(n)).
For n > 1, a(n) = A250245(A067029(A250246(n))).

A050603 A001511 with every term repeated.

Original entry on oeis.org

1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 5, 5, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 6, 6, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 5, 5, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 1, 1, 4
Offset: 0

Views

Author

Antti Karttunen Jun 22 1999

Keywords

Comments

Column 2 of A050600: a(n) = add1c(n,2).
Absolute values of A094267.
Consider the Collatz (or 3x+1) problem and the iterative sequence c(k) where c(0)=n is a positive integer and c(k+1)=c(k)/2 if c(k) is even, c(k+1)=(3*c(k)+1)/2 if c(k) is odd. Then a(n) is the minimum number of iterations in order to have c(a(n)) odd if n is even or c(a(n)) even if n is odd. - Benoit Cloitre, Nov 16 2001

Crossrefs

Bisection gives column 1 of A050600: A001511.

Programs

  • Mathematica
    With[{c=Table[Position[Reverse[IntegerDigits[n,2]],1,1,1],{n,110}]// Flatten}, Riffle[c,c]] (* Harvey P. Dale, Dec 06 2018 *)
    a[n_] := IntegerExponent[Floor[n/2]+1, 2] + 1; Array[a, 100, 0] (* Amiram Eldar, May 22 2025 *)
  • PARI
    a(n)=valuation(n+2-n%2,2) \\ Charles R Greathouse IV, Oct 14 2013
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = sum(k=1, length( binary(n+2)) - 1, x^(2^k) / (1 - x^(2^k)), x^3 * O(x^n)); polcoeff( A * (1 + x) / x^2, n))}; /* Michael Somos, May 11 2014 */
    
  • Python
    def A050603(n): return ((m:=n>>1)&~(m+1)).bit_length()+1 # Chai Wah Wu, Jul 07 2022

Formula

Equals A053398(2, n).
G.f.: (1+x)/x^2 * Sum(k>=1, x^(2^k)/(1-x^(2^k))). - Ralf Stephan, Apr 12 2002
a(n) = A136480(n+1). - Reinhard Zumkeller, Dec 31 2007
a(n) = A007814(n + 2 - n mod 2). - James Spahlinger, Oct 11 2013, corrected by Charles R Greathouse IV, Oct 14 2013
a(2n) = a(2n+1). 1 <= a(n) <= log_2(n+2). - Charles R Greathouse IV, Oct 14 2013
a(n) = A007814(n+1)+A007814(n+2).
a(n) = (-1)^n * A094267(n). - Michael Somos, May 11 2014
a(n) = A007814(floor(n/2)+1). - Chai Wah Wu, Jul 07 2022
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=0..m} a(k) = 2. - Amiram Eldar, Sep 15 2022

Extensions

Definition simplified by N. J. A. Sloane, Aug 27 2016
Showing 1-10 of 478 results. Next