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.

Previous Showing 31-40 of 75 results. Next

A153733 Remove all trailing 1's in the binary representation of n.

Original entry on oeis.org

0, 0, 2, 0, 4, 2, 6, 0, 8, 4, 10, 2, 12, 6, 14, 0, 16, 8, 18, 4, 20, 10, 22, 2, 24, 12, 26, 6, 28, 14, 30, 0, 32, 16, 34, 8, 36, 18, 38, 4, 40, 20, 42, 10, 44, 22, 46, 2, 48, 24, 50, 12, 52, 26, 54, 6, 56, 28, 58, 14, 60, 30, 62, 0, 64, 32, 66, 16, 68, 34, 70, 8, 72, 36, 74, 18, 76, 38
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 31 2008

Keywords

Comments

a(n) is also the map n -> A065423(n+1) applied A007814(n+1) times. - Federico Provvedi, Dec 14 2021

Crossrefs

Programs

  • Haskell
    a153733 n = if b == 0 then n else a153733 n'  where (n', b) = divMod n 2
    -- Reinhard Zumkeller, Jul 22 2014
    
  • Maple
    f:= n -> (n+1)/2^padic:-ordp(n+1,2)-1:
    map(f, [$0..100]); # Robert Israel, Mar 18 2018
  • Mathematica
    Table[If[EvenQ[n],n,FromDigits[Flatten[Most[Split[IntegerDigits[n,2]]]],2]],{n,0,100}] (* Harvey P. Dale, Feb 15 2014 *)
    a[n_] := BitShiftRight[n + 1, IntegerExponent[n+1, 2]] - 1; a[Range[0,100]] (* Federico Provvedi, Dec 21 2021 *)
  • PARI
    A153733(n)=(n+=1)>>valuation(n,2)-1 \\ most efficient variant: use this. - M. F. Hasler, Mar 16 2018
    
  • PARI
    {a(n)=while(bittest(n,0),n>>=1);n} \\ for illustration: as long as there's a trailing bit 1, remove it. - M. F. Hasler, Mar 16 2018
    
  • PARI
    a(n)=for(i=0,n,bittest(n,i)||return(n>>i)) \\ scan the trailing 1's, then remove all of them at once. - M. F. Hasler, Mar 16 2018
    
  • Python
    def a(n):
        while n&1: n >>= 1
        return n
    print([a(n) for n in range(100)]) # Michael S. Branicky, Dec 18 2021
    
  • Python
    def A153733(n): return n>>(~(n+1)&n).bit_length() # Chai Wah Wu, Jul 08 2022

Formula

a(n) = n if n is even, a((n-1)/2) if odd.
a(n)/2 = A025480(n).
a(n) = A000265(n+1) - 1. - M. F. Hasler, Mar 16 2018
a(n) = n - A331739(n+1). - Federico Provvedi, Dec 21 2021

A353654 Numbers whose binary expansion has the same number of trailing 0 bits as other 0 bits.

Original entry on oeis.org

1, 3, 7, 10, 15, 22, 26, 31, 36, 46, 54, 58, 63, 76, 84, 94, 100, 110, 118, 122, 127, 136, 156, 172, 180, 190, 204, 212, 222, 228, 238, 246, 250, 255, 280, 296, 316, 328, 348, 364, 372, 382, 392, 412, 428, 436, 446, 460, 468, 478, 484, 494, 502, 506, 511, 528, 568
Offset: 1

Views

Author

Mikhail Kurkov, Jul 15 2022

Keywords

Comments

Numbers k such that A007814(k) = A086784(k).
To reproduce the sequence through itself, use the following rule: if binary 1xyz is a term then so are 11xyz and 10xyz0 (except for 1 alone where 100 is not a term).
The number of terms with bit length k is equal to Fibonacci(k-1) for k > 1.
Conjecture: 2*A247648(n-1) + 1 with rewrite 1 -> 1, 01 -> 0 applied to binary expansion is the same as a(n) without trailing 0 bits in binary.
Odd terms are positive Mersenne numbers (A000225), because there is no 0 in their binary expansion. - Bernard Schott, Oct 12 2022

Crossrefs

Cf. A356385 (first differences).
Subsequences with same number k of trailing 0 bits and other 0 bits: A000225 (k=0), 2*A190620 (k=1), 4*A357773 (k=2), 8*A360573 (k=3).

Programs

  • Maple
    N:= 10: # for terms <= 2^N
    S:= {1};
    for d from 1 to N do
      for k from 0 to d/2-1 do
        B:= combinat:-choose([$k+1..d-2],k);
        S:= S union convert(map(proc(t) local s; 2^d - 2^k - add(2^(s),s=t) end proc,B),set);
    od od:
    sort(convert(S,list)); # Robert Israel, Sep 21 2023
  • Mathematica
    Join[{1}, Select[Range[2, 600], IntegerExponent[#, 2] == Floor[Log2[# - 1]] - DigitCount[# - 1, 2, 1] &]] (* Amiram Eldar, Jul 16 2022 *)
  • PARI
    isok(k) = if (k==1, 1, (logint(k-1, 2)-hammingweight(k-1) == valuation(k, 2))); \\ Michel Marcus, Jul 16 2022
    
  • Python
    from itertools import islice, count
    def A353654_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:(m:=(~n & n-1).bit_length()) == bin(n>>m)[2:].count('0'),count(max(startvalue,1)))
    A353654_list = list(islice(A353654_gen(),30)) # Chai Wah Wu, Oct 14 2022

Formula

a(n) = a(n-1) + A356385(n-1) for n > 1 with a(1) = 1.
Conjectured formulas: (Start)
a(n) = 2^g(n-1)*(h(n-1) + 2^A000523(h(n-1))*(2 - g(n-1))) for n > 2 with a(1) = 1, a(2) = 3 where f(n) = n - A130312(n), g(n) = [n > 2*f(n)] and where h(n) = a(f(n) + 1).
a(n) = 1 + 2^r(n-1) + Sum_{k=1..r(n-1)} (1 - g(s(n-1, k)))*2^(r(n-1) - k) for n > 1 with a(1) = 1 where r(n) = A072649(n) and where s(n, k) = f(s(n, k-1)) for n > 0, k > 1 with s(n, 1) = n.
a(n) = 2*(2 + Sum_{k=1..n-2} 2^(A213911(A280514(k)-1) + 1)) - 2^A200650(n) for n > 1 with a(1) = 1.
A025480(a(n)-1) = A348366(A343152(n-1)) for n > 1.
a(A000045(n)) = 2^(n-1) - 1 for n > 1. (End)

A374993 Total cost when the elements of the n-th composition (in standard order) are requested from a self-organizing list initialized to (1, 2, 3, ...), using the transpose updating strategy.

Original entry on oeis.org

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

Views

Author

Pontus von Brömssen, Jul 27 2024

Keywords

Comments

The cost of a request equals the position of the requested element in the list.
After a request, the requested element is transposed with the immediately preceding element (unless the requested element is already at the front of the list).

Examples

			For n=931 (the smallest n for which A374992(n), A374994(n), A374995(n), and a(n) are all distinct), the 931st composition is (1, 1, 2, 4, 1, 1), giving the following development of the list:
   list   | position of requested element
  --------+------------------------------
  1 2 3 4 |         1
  ^       |
  1 2 3 4 |         1
  ^       |
  1 2 3 4 |         2
    ^     |
  2 1 3 4 |         4
        ^ |
  2 1 4 3 |         2
    ^     |
  1 2 4 3 |         1
  ^       |
  ---------------------------------------
          a(931) = 11
		

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 3, 2nd edition, Addison-Wesley, 1998, pp. 401-403.

Crossrefs

Row n=1 of A374996.
Analogous sequences for other updating strategies: A374992, A374994, A374995.
Cf. A000120, A025480, A066099 (compositions in standard order), A333766, A374998.

Programs

  • Python
    def comp(n):
        # see A357625
        return
    def A374993(n):
        if n<1: return 0
        cost,c = 0,comp(n)
        m = list(range(1,max(c)+1))
        for i in c:
            j = m.index(i)
            cost += j+1
            if j > 0:
                m.insert(j-1,m.pop(j))
        return cost # John Tyler Rascoe, Aug 02 2024

Formula

The sum of a(j) over all j such that A000120(j) = k (number of requests) and A333766(j) <= m (upper bound on the requested elements) equals m^k * k * (m+1)/2. This is a consequence of the fact that the first m positions of the list are occupied by the elements 1, ..., m, as long as no element larger than m has been requested so far.
a(n) = a(A025480(n-1)) + A374998(n) for n >= 1.

A374996 Square array read by antidiagonals: T(n,k) is the total cost when the elements of the k-th composition (in standard order) are requested from a self-organizing list initialized to (1, 2, 3, ...), using the move-ahead(n) updating strategy; n, k >= 0.

Original entry on oeis.org

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

Views

Author

Pontus von Brömssen, Jul 27 2024

Keywords

Comments

The cost of a request equals the position of the requested element in the list.
After a request, the requested element is moved n steps closer to the front of the list (or to the front if the element is already less than n steps from the front).

Examples

			Array begins:
  n\k| 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
  ---+-----------------------------------------------
   0 | 0  1  2  2  3  3  3  3  4  4  4  4  4  4  4  4
   1 | 0  1  2  2  3  4  3  3  4  4  3  5  4  5  4  4
   2 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
   3 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
   4 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
   5 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
   6 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
   7 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
   8 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
   9 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
  10 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
  11 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
  12 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
  13 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
  14 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
  15 | 0  1  2  2  3  4  3  3  4  5  3  5  4  5  4  4
		

Crossrefs

Cf. A000120, A025480, A029837 (row n=0), A374993 (row n=1), A333766, A374992, A375001.

Programs

  • Python
    def comp(n):
        # see A357625
        return
    def A374996(n,k):
        if k<1: return 0
        cost,c = 0,comp(k)
        m = list(range(1,max(c)+1))
        for i in c:
            j = m.index(i)
            cost += j+1
            jp = 0
            if j >= n:
                jp += j-n
            m.insert(jp,m.pop(j))
        return cost # John Tyler Rascoe, Aug 02 2024

Formula

T(n,k) = A374992(k) if n >= A333766(k)-1.
The sum of T(n,k) over all k such that A000120(k) = j (number of requests) and A333766(k) <= m (upper bound on the requested elements) equals m^j * j * (m+1)/2. This is a consequence of the fact that the first m positions of the list are occupied by the elements 1, ..., m, as long as no element larger than m has been requested so far.
T(n,k) = T(n,A025480(k-1)) + A375001(n,k) for n >= 0 and k >= 1.

A005766 a(n) = cost of minimal multiplication-cost addition chain for n.

Original entry on oeis.org

0, 1, 3, 5, 9, 12, 18, 21, 29, 34, 44, 48, 60, 67, 81, 85, 101, 110, 128, 134, 154, 165, 187, 192, 216, 229, 255, 263, 291, 306, 336, 341, 373, 390, 424, 434, 470, 489, 527, 534, 574, 595, 637, 649, 693, 716, 762, 768, 816, 841, 891, 905, 957, 984, 1038
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Partial sums of A089265.

Programs

  • Mathematica
    a[n_] := Sum[v = IntegerExponent[k, 2]; v + k/2^v - 1, {k, 1, n}];
    Array[a, 55] (* Jean-François Alcover, Feb 28 2019 *)
  • PARI
    a(n)=if(n<1,0,if(n%2==0,a(n/2)+n^2/4,a((n-1)/2)+(n-1)*(n+3)/4))
    
  • PARI
    a(n)=sum(k=1,n,valuation(k,2)+k/2^valuation(k,2)-1)

Formula

a(2n)=a(n)+n^2, a(2n+1)=a(n)+n(n+2). - Ralf Stephan, May 04 2003
G.f.: 1/(1-x) * sum(k>=0, x^2^(k+1)(1+2x^2^k-x^2^(k+1))/(1-x^2^(k+1))^2). - Ralf Stephan, Jul 27 2003
a(n) = sum(k=1, n, A007814(n) + 2*A025480(n-1)). - Ralf Stephan, Oct 30 2003

Extensions

More terms from Ralf Stephan, May 04 2003

A006014 a(n+1) = (n+1)*a(n) + Sum_{k=1..n-1} a(k)*a(n-k).

Original entry on oeis.org

1, 2, 7, 32, 178, 1160, 8653, 72704, 679798, 7005632, 78939430, 965988224, 12762344596, 181108102016, 2748049240573, 44405958742016, 761423731533286, 13809530704348160, 264141249701936818, 5314419112717217792, 112201740111374359516, 2480395343617443024896
Offset: 1

Views

Author

Keywords

Examples

			G.f. = x + 2*x^2 + 7*x^3 + 32*x^4 + 178*x^5 + 1160*x^6 + 8653*x^7 + 72704*x^8 + ...
		

References

  • D. E. Knuth, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Similar recurrences: A124758, A243499, A284005, A329369, A341392.

Programs

  • Mathematica
    Nest[Append[#1, #1[[-1]] (#2 + 1) + Total@ Table[#1[[k]] #1[[#2 - k]], {k, #2 - 1}]] & @@ {#, Length@ #} &, {1}, 17] (* Michael De Vlieger, Aug 22 2018 *)
    (* or *)
    a[1] = 1; a[n_] := a[n] = n a[n-1] + Sum[a[k] a[n-1-k], {k, n-2}]; Array[a, 18] (* Giovanni Resta, Aug 23 2018 *)
  • PARI
    {a(n) = local(A); if( n<1, 0, A = vector(n); A[1] = 1; for( k=2, n, A[k] = k * A[k-1] + sum( j=1, k-2, A[j] * A[k-1-j])); A[n])} /* Michael Somos, Jul 24 2011 */
    
  • Python
    from sage.all import *
    @CachedFunction
    def a(n): # a = A006014
        if n<5: return (pow(5,n-1) + 3)//4
        else: return n*a(n-1) + 2*sum(a(k)*a(n-k-1) for k in range(1,(n//2))) + (n%2)*pow(a((n-1)//2),2)
    print([a(n) for n in range(1,61)]) # G. C. Greubel, Jan 10 2025

Formula

G.f. A(x) satisfies A(x) = x * (1 + A(x) + A(x)^2 + x * A'(x)). - Michael Somos, Jul 24 2011
Conjecture: a(n) = Sum_{k=0..2^(n-1) - 1} b(k) for n > 0 where b(2n+1) = b(n), b(2n) = b(n) + b(n - 2^f(n)) + b(2n - 2^f(n)) + b(A025480(n-1)) for n > 0 with b(0) = b(1) = 1 and where f(n) = A007814(n). - Mikhail Kurkov, Nov 19 2021
a(n) ~ cosh(sqrt(3)*Pi/2) * n! / Pi = A073017 * n!. - Vaclav Kotesovec, Nov 21 2024

A082392 Expansion of (1/x) * Sum_{k>=0} x^2^k / (1 - 2*x^2^(k+1)).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 8, 1, 16, 4, 32, 2, 64, 8, 128, 1, 256, 16, 512, 4, 1024, 32, 2048, 2, 4096, 64, 8192, 8, 16384, 128, 32768, 1, 65536, 256, 131072, 16, 262144, 512, 524288, 4, 1048576, 1024, 2097152, 32, 4194304, 2048, 8388608, 2, 16777216
Offset: 0

Views

Author

Ralf Stephan, Jun 07 2003

Keywords

Crossrefs

Programs

  • Maple
    nmax := 48: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 0 to ceil(nmax/(p+2))+1 do a((2*n+1)*2^p-1) := 2^n od: od: seq(a(n), n=0..nmax); # Johannes W. Meijer, Feb 11 2013
    A082392 := proc(n)
        2^A025480(n) ;
    end proc:
    seq(A082392(n),n=0..100) ; # R. J. Mathar, Jul 16 2020
  • Mathematica
    a[n_] := 2^(((n+1)/2^IntegerExponent[n+1, 2]+1)/2-1);
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 15 2023 *)
  • PARI
    for(n=0, 50, l=ceil(log(n+1)/log(2)); t=polcoeff(sum(k=0, l, (x^2^k)/(1-2*x^2^(k+1)))/x + O(x^(n+1)), n); print1(t", ");) ;

Formula

a(0) = 1, a(2*n) = 2^n, a(2*n+1) = a(n).
a(n) = 2^A025480(n) = 2^(A003602(n)-1).
a((2*n+1)*2^p-1) = 2^n, p >= 0 and n >= 0. - Johannes W. Meijer, Feb 11 2013

A108202 a(2n) = A007376(n); a(2n+1) = a(n).

Original entry on oeis.org

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

Views

Author

Juliette Bruyndonckx and Alexandre Wajnberg, Jun 15 2005

Keywords

Comments

A sequence, S, consisting of the natural counting digits (A007376) interleaved with S.
Fractal sequence (Kimberling-type) based upon the counting digits.
Similar to but different from A025480 - N. J. A. Sloane, Nov 26 2020.

Crossrefs

First differs from A025480 at a(20).
Even bisection: A007376.
Cf. A003602.

Formula

a(n) = A007376(A025480(n)). - Kevin Ryde, Nov 21 2020

Extensions

More terms from Joshua Zucker, May 18 2006
Name made more explicit by Peter Munn, Nov 20 2020

A131987 Representation of a dense para-sequence.

Original entry on oeis.org

1, 2, 1, 3, 4, 2, 5, 1, 6, 3, 7, 8, 4, 9, 2, 10, 5, 11, 1, 12, 6, 13, 3, 14, 7, 15, 16, 8, 17, 4, 18, 9, 19, 2, 20, 10, 21, 5, 22, 11, 23, 1, 24, 12, 25, 6, 26, 13, 27, 3, 28, 14, 29, 7, 30, 15, 31, 32, 16, 33, 8, 34, 17, 35, 4, 36, 18, 37, 9, 38, 19, 39, 2, 40, 20, 41, 10, 42, 21, 43
Offset: 1

Views

Author

Clark Kimberling, Aug 05 2007, Sep 12 2007

Keywords

Comments

A fractal sequence. The para-sequence may be regarded as a sort of "limit" of the concatenated segments. The para-sequence (itself not a sequence) is dense in the sense that every pair of terms i and j are separated by another term (and hence separated by infinitely many terms).
The para-sequence accounts for positions of dyadic rational numbers in the following way: Label 1/2 as 1; label 1/4, 3/4 as 2 and 3; label 1/8, 3/8, 5/8, 7/8 as 4,5,6,7, etc. Then, for example, the ordering 1/8 < 1/4 < 3/8 < 1/2 < 5/8 < 3/4 < 7/8 matches the labels 4,2,5,1,6,3,7, which is the 3rd segment of A131987. The n-th segment consists of labels for rationals having denominators 2, 4, 8, ..., 2^n.
Could be seen as a "fuzzy table" with row lengths 2^n-1. In row n one has the numbers, read from the leftmost to the rightmost, as they appear in a perfect binary tree of 2^n-1 nodes when inserted in "storage order" into the tree, cf. illustration in A101279 and stackexchange link. These rows are obviously permutations of [1..2^n-1], their inverse is given in A269752. - M. F. Hasler, Mar 04 2016
Subsequence of A025480 (omitting all terms=0). - David James Sycamore, Apr 26 2020
The sequence obtained by adding 1 to every term of this sequence is the same as A003602 with all 1's removed. - David James Sycamore, Jul 25 2022

Examples

			Start with 1 and isolate it using 2,3, like this: 2,1,3.  Then isolate those using 4,5,6,7, like this: 4,2,5,1,6,3,7.  The next segment, to be concatenated after 4,2,5,1,6,3,7, is 8,4,9,2,10,5,11,1,12,6,13,3,14,7,15.
		

References

  • C. Kimberling, Proper self-containing sequences, fractal sequences and para-sequences, preprint, 2007.

Crossrefs

Programs

  • Maple
    m:=p->padic[ordp](2*p,2)-1:podd:=(h,p)->2^h+(p-2)/2:peven:=(h,p)->2^(h-m(p))+(p-2^m(p))/2^(m(p)+1):for i from 0 to 5 do for j from 1 to 2^(i+1)-1 do if j mod 2 =1 then print(podd(i,j)) else print(peven(i,j)) fi od od # Gary Detlefs, Sep 28 2018
  • Mathematica
    Flatten@NestList[Riffle[Range[Length[#] + 1, 2 Length[#] + 1], #] &, {1}, 4] (* Birkas Gyorgy, Mar 11 2011 *)
  • PARI
    A131987_row(n,r=[1])={for(k=2,n,r=vector(2^k-1,j,if(bittest(j,0),j\2+2^(k-1),r[j\2])));r}
    apply(A131987_row,[1..6]) \\ or concat(...) \\ M. F. Hasler, Mar 04 2016

Formula

When viewed as a table, T(h,p), related to the in order traversal of a full binary tree, T(h,p) = 2^h+(p-1)/2, p odd, 2^(h-m(p)) + (p-2^m(p)) / 2^(m(p)+1), where m(p) is the greatest value of n such that p mod 2^n == 0. m(p) = p-adic[ordp](2*p,2)-1. - Gary Detlefs, Sep 28 2018
a((2*n+1)*2^k - k - A070941(n)) = n = A025480((2*n+1)*2^k - 1); (n>=1, k>=0). - David James Sycamore, Apr 26 2020

A181363 1 followed by the primes, interleaved recursively.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 1, 7, 3, 11, 2, 13, 5, 17, 1, 19, 7, 23, 3, 29, 11, 31, 2, 37, 13, 41, 5, 43, 17, 47, 1, 53, 19, 59, 7, 61, 23, 67, 3, 71, 29, 73, 11, 79, 31, 83, 2, 89, 37, 97, 13, 101, 41, 103, 5, 107, 43, 109, 17, 113, 47, 127, 1, 131, 53, 137, 19, 139, 59, 149, 7, 151, 61
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 16 2010

Keywords

Comments

a(2*n-1) = A008578(n); a(2*n+1) = A000040(n);
a((2*n-1)*2^k) = A008578(n), k >= 0;
a(2^k) = 1, k >= 0; a(2^k - 1) = A051438(k), k > 0.

Examples

			Initial values, seen as a binary tree:
................................. 1
................ 1 _______________________________ 2
........ 1 _____________ 3 .............. 2 ______________ 5
... 1 _____ 7 ..... 3 ______ 11 .... 2 ______ 13 .... 5 ______ 17
.. 1__19...7__23...3__29...11__31...2__37...13__41...5__43...17__47
		

Programs

  • Haskell
    import Data.List (transpose)
    a181363 n = a181363_list !! (n-1)
    a181363_list = concat $ transpose [a008578_list, a181363_list]
    -- Reinhard Zumkeller, Mar 22 2014, Oct 20 2011, Oct 16 2010

Formula

a(n) = if even n then a(n/2) else A008578((n+1)/2).
a(n) = A008578(A025480(n-1)+1). - Reinhard Zumkeller, Mar 22 2014
Previous Showing 31-40 of 75 results. Next