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-7 of 7 results.

A284459 Permutation of the positive integers: this permutation transforms the enumeration system of positive irreducible fractions A002487/A002487' (Calkin-Wilf) into the enumeration system A245327/A245328, and A162911/A162912 (Drib) into A020651/A020650 (Yu-Ting inverted).

Original entry on oeis.org

1, 2, 3, 6, 5, 4, 7, 10, 13, 12, 11, 14, 9, 8, 15, 26, 21, 20, 27, 22, 25, 24, 23, 18, 29, 28, 19, 30, 17, 16, 31, 42, 53, 52, 43, 54, 41, 40, 55, 50, 45, 44, 51, 46, 49, 48, 47, 58, 37, 36, 59, 38, 57, 56, 39, 34, 61, 60, 35, 62, 33, 32, 63
Offset: 1

Views

Author

Yosu Yurramendi, Mar 27 2017

Keywords

Comments

The inverse permutation is A284460.

Crossrefs

Programs

  • R
    maxrow <- 12 # by choice
    a <- 1
    b01 <- 1
    for(m in 0:maxrow){
      b01 <- c(b01, c(1-b01[2^m:(2^(m+1)-1)], b01[2^m:(2^(m+1)-1)]) )
      for(k in 0:(2^m-1)){
        a[2^(m+1) +       k] <- a[2^m + k] + 2^(m + b01[2^(m+1) +       k])
        a[2^(m+1) + 2^m + k] <- a[2^m + k] + 2^(m + b01[2^(m+1) + 2^m + k])
    }}
    a
    # Yosu Yurramendi, Mar 27 2017
    
  • R
    maxblock <- 7 # by choice
    a <- 1:3
    for(n in 4:2^maxblock){
    ones <- which(as.integer(intToBits(n)) == 1)
    nbit <- as.integer(intToBits(n))[1:tail(ones, n = 1)]
    anbit <- nbit
    for(i in 2:(length(anbit) - 1))
       anbit[i] <- 1 - bitwXor(anbit[i], anbit[i-1])
    a <- c(a, sum(anbit*2^(0:(length(anbit) - 1))))
    }
    a
    # Yosu Yurramendi, Apr 25 2021

Formula

a(n) = A258996(A231551(n)) = A231551(A092569(n)), n > 0 . - Yosu Yurramendi, Apr 10 2017

A273493 a(n) = A245327(n) + A245328(n).

Original entry on oeis.org

2, 3, 3, 5, 5, 4, 4, 8, 8, 7, 7, 7, 7, 5, 5, 13, 13, 11, 11, 12, 12, 9, 9, 11, 11, 10, 10, 9, 9, 6, 6, 21, 21, 18, 18, 19, 19, 14, 14, 19, 19, 17, 17, 16, 16, 11, 11, 18, 18, 15, 15, 17, 17, 13, 13, 14, 14, 13, 13, 11, 11, 7, 7, 34, 34, 29, 29, 31, 31, 23, 23, 30, 30, 27, 27, 25, 25, 17, 17, 31, 31, 26, 26, 29, 29, 22, 22, 25
Offset: 1

Views

Author

Yosu Yurramendi, May 23 2016

Keywords

Comments

The terms (n>0) may be written as a left-justified array with rows of length 2^m, m >= 0:
2,
3, 3,
5, 5, 4, 4,
8, 8, 7, 7, 7, 7, 5, 5,
13,13,11,11,12,12, 9, 9,11,11,10,10, 9, 9, 6, 6,
21,21,18,18,19,19,14,14,19,19,17,17,16,16,11,11,18,18,15,15,17,17,13,13,14,14,...
All columns have the Fibonacci sequence property: a(2^(m+2) + k) = a(2^(m+1) + k) + a(2^m + k), m >= 0, 0 <= k < 2^m (empirical observations).
The terms (n>0) may also be written as a right-justified array with rows of length 2^m, m >= 0:
2,
3, 3,
5, 5, 4, 4,
8, 8, 7, 7, 7, 7, 5, 5,
13,13,11,11,12,12, 9, 9,11,11,10,10, 9, 9, 6, 6,
...,19,19,17,17,16,16,11,11,18,18,15,15,17,17,13,13,14,14,13,13,11,11, 7, 7,
Each column is an arithmetic sequence. The differences of the arithmetic sequences repeat the sequence A071585: a(2^(m+2) -1 - 2k) - a(2^(m+1) -1 - 2k) = A071585(k-1), m > 0, 0 <= k < 2^m ; a(2^(m+2) -1 - 2k - 1) - a(2^(m+1) -1 - 2k - 1) = A071585(k-1), m > 0, 0 <= k < 2^m .
n>1 occurs in this sequence phi(n) = A000010(n) times, as it occurs in A007306 (Franklin T. Adams-Watters' comment), that is the sequence obtained by adding numerator and denominator in the Calkin-Wilf enumeration system of positive rationals. A245327(n)/A245328(n) is also an enumeration system of all positive rationals, and in each level m >= 0 (ranks between 2^m and 2^(m+1)-1) rationals are the same in both systems. Thus a(n) has the same terms in each level as A007306.
a(n) = A273494(A059893(n)), a(A059893(n)) = A273494(n), n > 0. - Yosu Yurramendi, May 30 2017

Crossrefs

Programs

  • PARI
    b(n) = my(b=binary(n)); fromdigits(concat(b[1], Vecrev(vector(#b-1, k, b[k+1]))), 2); \\ from A059893
    a(n) = my(n=b(n), x=1, y=1); for(i=0, logint(n, 2), if(bittest(n, i), [x, y]=[x+y, y], [x, y]=[y, x+y])); x \\ Mikhail Kurkov, Mar 11 2023

Formula

a(n) = A007306(A284459(n)), n > 0. - Yosu Yurramendi, Aug 23 2021

A284460 Permutation of the positive integers: this permutation transforms the enumeration system of positive irreducible fractions A245327/A245328 into the enumeration system A002487/A002487' (Calkin-Wilf), and A020651/A020650 (Yu-Ting inverted) into A162911/A162912(Drib).

Original entry on oeis.org

1, 2, 3, 6, 5, 4, 7, 14, 13, 8, 11, 10, 9, 12, 15, 30, 29, 24, 27, 18, 17, 20, 23, 22, 21, 16, 19, 26, 25, 28, 31, 62, 61, 56, 59, 50, 49, 52, 55, 38, 37, 32, 35, 42, 41, 44, 47, 46, 45, 40, 43, 34, 33, 36, 39, 54, 53, 48, 51, 58, 57, 60, 63
Offset: 1

Views

Author

Yosu Yurramendi, Mar 28 2017

Keywords

Comments

The inverse permutation is A284459.

Crossrefs

Programs

  • R
    maxrow <- 4 # by choice
    a <- 1
    b01 <- 1
    for(m in 0:maxrow){
      b01 <- c(b01,rep(1,2^(m+1))); b01[(2^(m+1)+2^m-2^(m-1)):(2^(m+1)+2^m+2^(m-1)-1)] <- 0
      for(k in 0:(2^m-1)){
        a[2^(m+1) +       k] <- a[2^m + k] + 2^(m + b01[2^(m+1) +       k])
        a[2^(m+1) + 2^m + k] <- a[2^m + k] + 2^(m + b01[2^(m+1) + 2^m + k])
    }}
    a
    # Yosu Yurramendi, Mar 28 2017

Formula

a(n) = A231550(A258996(n)) = A092569(A231550(n)), n > 0 . - Yosu Yurramendi, Apr 10 2017

A054429 Simple self-inverse permutation of natural numbers: List each block of 2^n numbers (from 2^n to 2^(n+1) - 1) in reverse order.

Original entry on oeis.org

1, 3, 2, 7, 6, 5, 4, 15, 14, 13, 12, 11, 10, 9, 8, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 127, 126, 125, 124, 123, 122, 121
Offset: 1

Views

Author

Keywords

Comments

a(n) gives the position of the inverse of the n-th term in the full Stern-Brocot tree: A007305(a(n)+2) = A047679(n) and A047679(a(n)) = A007305(n+2). - Reinhard Zumkeller, Dec 22 2008
From Gary W. Adamson, Jun 21 2012: (Start)
The mapping and conversion rules are as follows:
By rows, we have ...
1;
3, 2;
7, 6, 5, 4;
15, 14, 13, 12, 11, 10, 9, 8;
... onto which we are to map one-half of the Stern-Brocot infinite Farey Tree:
1/2
1/3, 2/3
1/4, 2/5, 3/5, 3/4
1/5, 2/7, 3/8, 3/7, 4/7, 5/8, 5/7, 4/5
...
The conversion rules are: Convert the decimal to binary, adding a duplicate of the rightmost binary term to its right. For example, 10 = 1010, which becomes 10100. Then, from the left, record the number of runs = [1,1,1,2], the continued fraction representation of 5/8. Check: 10 decimal corresponds to 5/8 as shown in the overlaid mapping. Take decimal 9 = 1001 which becomes 10011, with a continued fraction representation of [1,2,2] = 5/7. Check: 9 decimal corresponds to 5/7 in the Farey Tree map. (End)
From Indranil Ghosh, Jan 19 2017: (Start)
a(n) is the value generated when n is converted into its Elias gamma code, the 1's and 0's are interchanged and the resultant is converted back to its decimal value for all values of n > 1. For n = 1, A054429(n) = 1 but after converting 1 to Elias gamma code, interchanging the 1's and 0's and converting it back to decimal, the result produced is 0.
For example, let n = 10. The Elias gamma code for 10 is '1110010'. After interchanging the 1's and 0's it becomes "0001101" and 1101_2 = 13_10. So a(10) = 13. (End)
From Yosu Yurramendi, Mar 09 2017 (similar to Zumkeller's comment): (Start)
A002487(a(n)) = A002487(n+1), A002487(a(n)+1) = A002487(n), n > 0.
A162909(a(n)) = A162910(n), A162910(a(n)) = A162909(n), n > 0.
A162911(a(n)) = A162912(n), A162912(a(n)) = A162911(n), n > 0.
A071766(a(n)) = A245326(n), A245326(a(n)) = A071766(n), n > 0.
A229742(a(n)) = A245325(n), A245325(a(n)) = A229742(n), n > 0.
A020651(a(n)) = A245327(n), A245327(a(n)) = A020651(n), n > 0.
A020650(a(n)) = A245328(n), A245328(a(n)) = A020650(n), n > 0. (End)
From Yosu Yurramendi, Mar 29 2017: (Start)
A063946(a(n)) = a(A063946(n)) = A117120(n), n > 0.
A065190(a(n)) = a(A065190(n)) = A092569(n), n > 0.
A258746(a(n)) = a(A258746(n)) = A165199(n), n > 0.
A258996(a(n)) = a(A258996(n)), n > 0.
A117120(a(n)) = a(A117120(n)), n > 0.
A092569(a(n)) = a(A092569(n)), n > 0. (End)

Crossrefs

See also A054424, A054430.
{A000027, A054429, A059893, A059894} form a 4-group.
This is Guy Steele's sequence GS(6, 5) (see A135416).

Programs

  • Haskell
    a054429 n = a054429_list !! (n-1)
    a054429_list = f [1..] where
       f xs@(x:_) = reverse us ++ f vs where (us, vs) = splitAt x xs
    -- Reinhard Zumkeller, Jun 01 2015, Feb 21 2014
    
  • Maple
    A054429 := n -> 3*2^ilog2(n) - n - 1:
    seq(A054429(n), n = 1..70); # [Updated by Peter Luschny, Apr 24 2024]
  • Mathematica
    Flatten[Table[Range[2^(n+1)-1,2^n,-1],{n,0,6}]] (* Harvey P. Dale, Dec 17 2013 *)
  • PARI
    A054429(n)= 3<<#binary(n\2)-n-1 \\ M. F. Hasler, Aug 18 2014
    
  • Python
    from itertools import count, islice
    def A054429_gen(): # generator of terms
        return (m for n in count(0) for m in range((1<A054429_list = list(islice(A054429_gen(),30)) # Chai Wah Wu, Jul 27 2023
  • R
    maxblock <- 10 # by choice
    a <- NULL
    for(m in 0:maxblock) a <- c(a, rev(2^m:(2^(m+1)-1)))
    a
    # Yosu Yurramendi, Mar 10 2017
    

Formula

a(n) = ReflectBinTreePermutation(n).
a(n) = if n=1 then 1 else 2*a(floor(n/2)) + 1 - n mod 2. - Reinhard Zumkeller, Feb 18 2003
G.f.: 1/(1-x) * ((x-2x^2)/(1-x) + Sum_{k>=0} 3*2^k*x^2^k). - Ralf Stephan, Sep 15 2003
A000120(a(n)) = A000120(A059894(n)) = A023416(n) + 1. - Ralf Stephan, Oct 05 2003
A115310(n, 1) = a(n). - Reinhard Zumkeller, Jan 20 2006
a(1) = 1, a(2^(m+1) + k) = a(2^m+k) + 2^(m+1),
a(2^(m+1) + 2^m+k) = a(2^m+k) + 2^m, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Apr 06 2017
a(n) = A117120(A063946(n)) = A063946(A117120(n)) = A092569(A065190(n)) = A065190(A092569(n)), n > 0. - Yosu Yurramendi, Apr 10 2017
a(n) = 3*A053644(n) - n - 1. - Alan Michael Gómez Calderón, Feb 28 2025

A065190 Self-inverse permutation of the positive integers: 1 is fixed, followed by an infinite number of adjacent transpositions (n n+1).

Original entry on oeis.org

1, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14, 17, 16, 19, 18, 21, 20, 23, 22, 25, 24, 27, 26, 29, 28, 31, 30, 33, 32, 35, 34, 37, 36, 39, 38, 41, 40, 43, 42, 45, 44, 47, 46, 49, 48, 51, 50, 53, 52, 55, 54, 57, 56, 59, 58, 61, 60, 63, 62, 65, 64, 67, 66, 69, 68, 71, 70, 73
Offset: 1

Views

Author

Antti Karttunen, Oct 19 2001

Keywords

Comments

Also, a lexicographically minimal sequence of distinct positive integers such that a(n) is coprime to n. - Ivan Neretin, Apr 18 2015
The larger term of the pair (a(n), a(n+1)) is always odd. Had we started the sequence with a(1) = 0, it would be the lexicographically first sequence with this property if always extented with the smallest integer not yet present. - Eric Angelini, Feb 17 2017
From Yosu Yurramendi, Mar 21 2017: (Start)
This sequence is self-inverse. Except for the fixed point 1, it consists completely of 2-cycles: (2n, 2n+1), n > 0.
A020651(a(n)) = A020650(n), A020650(a(n)) = A020651(n), n > 0.
A245327(a(n)) = A245328(n), A245328(a(n)) = A245327(n), n > 0.
A063946(a(n)) = a(A063946(n)), n > 0.
A054429(a(n)) = a(A054429(n)) = A092569(n), n > 0.
A258996(a(n)) = a(A258996(n)), n > 0.
A258746(a(n)) = a(A258746(n)), n > 0. (End)
From Enrique Navarrete, Nov 13 2017: (Start)
With a(0)=0, and the rest of the sequence appended, a(n) is the smallest positive number not yet in the sequence such that the arithmetic mean of the first n+1 terms a(0), a(1), ..., a(n) is not an integer; i.e., the sequence is 0, 1, 3, 2, 5, 4, 7, 6, 9, 8, ...
Example: for n=5, (0 + 1 + 3 + 2 + 5)/5 is not an integer.
Fixed points are odd numbers >= 3 and also a(n) = n-2 for even n >= 4. (End)

Crossrefs

Programs

  • Magma
    [1] cat [n+(-1)^n: n in [2..80]]; // Vincenzo Librandi, Apr 18 2015
    
  • Maple
    [seq(f(j),j=1..120)]; f := (n) -> `if`((n < 2), n,n+((-1)^n));
  • Mathematica
    f[n_] := Rest@ Flatten@ Transpose[{Range[1, n + 1, 2], {1}~Join~Range[2, n, 2]}]; f@ 72 (* Michael De Vlieger, Apr 18 2015 *)
    Rest@ CoefficientList[Series[x (x^3 - 2 x^2 + 2 x + 1)/((x - 1)^2*(x + 1)), {x, 0, 72}], x] (* Michael De Vlieger, Feb 17 2017 *)
    Join[{1},LinearRecurrence[{1,1,-1},{3,2,5},80]] (* Harvey P. Dale, Feb 24 2021 *)
  • PARI
    { for (n=1, 1000, if (n>1, a=n + (-1)^n, a=1); write("b065190.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 13 2009
    
  • PARI
    x='x+O('x^100); Vec(x*(x^3-2*x^2+2*x+1)/((x-1)^2*(x+1))) \\ Altug Alkan, Feb 04 2016
    
  • Python
    def a(n): return 1 if n<2 else n + (-1)**n # Indranil Ghosh, Mar 22 2017
    
  • R
    maxrow <- 8 # by choice
    a <- c(1,3,2) # If it were c(1,2,3), it would be A000027
      for(m in 1:maxrow) for(k in 0:(2^m-1)){
    a[2^(m+1)+    k] = a[2^m+k] + 2^m
    a[2^(m+1)+2^m+k] = a[2^m+k] + 2^(m+1)
    }
    a
    # Yosu Yurramendi, Apr 10 2017

Formula

a(1) = 1, a(n) = n+(-1)^n.
From Colin Barker, Feb 18 2013: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) for n>4.
G.f.: x*(x^3 - 2*x^2 + 2*x + 1) / ((x-1)^2*(x+1)). (End)
a(n)^a(n) == 1 (mod n). - Thomas Ordowski, Jan 04 2016
E.g.f.: x*(1+exp(x)) - 1 + exp(-x). - Robert Israel, Feb 04 2016
a(n) = A014681(n-1) + 1. - Michel Marcus, Dec 10 2016
a(1) = 1, for n > 0 a(2*n) = 2*a(a(n)) + 1, a(2*n + 1) = 2*a(a(n)). - Yosu Yurramendi, Dec 12 2020

A245326 Denominators of an enumeration system of the reduced nonnegative rational numbers.

Original entry on oeis.org

1, 2, 1, 3, 3, 2, 1, 5, 4, 5, 4, 3, 3, 2, 1, 8, 7, 7, 5, 8, 7, 7, 5, 5, 4, 5, 4, 3, 3, 2, 1, 13, 11, 12, 9, 11, 10, 9, 6, 13, 11, 12, 9, 11, 10, 9, 6, 8, 7, 7, 5, 8, 7, 7, 5, 5, 4, 5, 4, 3, 3, 2, 1, 21, 18, 19, 14, 19, 17, 16, 11, 18, 15, 17, 13, 14, 13, 11, 7, 21, 18, 19, 14, 19, 17, 16, 11, 18, 15, 17, 13, 14, 13, 11, 7, 13, 11, 12, 9, 11
Offset: 1

Views

Author

Yosu Yurramendi, Jul 18 2014

Keywords

Comments

A245325(n)/a(n) enumerates all the reduced nonnegative rational numbers exactly once.
If the terms (n>0) are written as an array (in a left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,...
1,
2, 1,
3, 3, 2,1,
5, 4, 5,4, 3, 3,2,1,
8, 7, 7,5, 8, 7,7,5, 5, 4, 5,4, 3, 3,2,1,
13,11,12,9,11,10,9,6,13,11,12,9,11,10,9,6,8,7,7,5,8,7,7,5,5,4,5,4,3,3,2,1,
then the sum of the m-th row is 3^m (m = 0,1,2,), and each column k is a Fibonacci sequence. These Fibonacci sequences are equal to Fibonacci sequences from A...... except for the first terms of those sequences.
If the rows are written in a right-aligned fashion:
1,
2,1,
3,3,2,1,
5,4,5,4,3,3,2,1,
8,7,7,5,8,7,7,5,5,4,5,4,3,3,2,1,
13,11,12,9,11,10,9,6,13,11,12,9,11,10,9,6,8,7,7,5,8,7,7,5,5,4,5,4,3,3,2,1,
then each column is constant and the terms are from A071585 (a(2^m-1-k) = A071585(k), k = 0,1,2,...).
If the sequence is considered by blocks of length 2^m, m = 0,1,2,..., the blocks of this sequence are permutations of terms of blocks from A002487 (Stern's diatomic series or the Stern-Brocot sequence), and, more precisely, the reverses of blocks of A071766 (a(2^m+k) = A071766(2^(m+1)-1-k), m = 0,1,2,..., k = 0,1,2,...,2^m-1). Moreover, each block is the bit-reversed permutation of the corresponding block of A245328.

Crossrefs

Programs

  • PARI
    a(n) = my(A=1); for(i=0, logint(n, 2), if(bittest(2*n, i), A++, A=(A+1)/A)); denominator(A) \\ Mikhail Kurkov, Feb 20 2023
  • R
    blocklevel <- 6 # arbitrary
    a <- 1
    for(m in 0:blocklevel) for(k in 0:(2^(m-1)-1)){
      a[2^(m+1)+k]             <- a[2^m+k] + a[2^m+2^(m-1)+k]
      a[2^(m+1)+2^(m-1)+k]     <- a[2^(m+1)+k]
      a[2^(m+1)+2^m+k]         <- a[2^m+k]
      a[2^(m+1)+2^m+2^(m-1)+k] <- a[2^m+2^(m-1)+k]
    }
    a
    

Formula

a(n) = A002487(1+A059893(A180200(n))) = A002487(A059893(A154435(n))). - Yosu Yurramendi, Sep 20 2021

A245327 Numerators in recursive bijection from positive integers to positive rationals, where the bijection is f(1) = 1, f(2n) = 1/(f(n)+1), f(2n+1) = f(n)+1.

Original entry on oeis.org

1, 1, 2, 2, 3, 1, 3, 3, 5, 2, 5, 3, 4, 1, 4, 5, 8, 3, 8, 5, 7, 2, 7, 4, 7, 3, 7, 4, 5, 1, 5, 8, 13, 5, 13, 8, 11, 3, 11, 7, 12, 5, 12, 7, 9, 2, 9, 7, 11, 4, 11, 7, 10, 3, 10, 5, 9, 4, 9, 5, 6, 1, 6, 13, 21, 8, 21, 13, 18, 5, 18, 11, 19, 8, 19, 11, 14, 3, 14, 12, 19, 7, 19, 12, 17, 5, 17, 9, 16, 7, 16, 9, 11, 2, 11, 11, 18, 7, 18, 11
Offset: 1

Views

Author

Yosu Yurramendi, Jul 18 2014

Keywords

Comments

a(n)/A245328(n) enumerates all the reduced nonnegative rational numbers exactly once.
If the terms (n>0) are written as an array (left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,...
1,
1, 2,
2, 3,1, 3,
3, 5,2, 5,3, 4,1, 4,
5, 8,3, 8,5, 7,2, 7,4, 7,3, 7,4,5,1,5,
8,13,5,13,8,11,3,11,7,12,5,12,7,9,2,9,7,11,4,11,7,10,3,10,5,9,4,9,5,6,1,6,
then the sum of the m-th row is 3^m (m = 0,1,2,), and each column k is a Fibonacci sequence.
If the rows are written in a right-aligned fashion:
1,
1,2,
2,3,1,3,
3,5,2,5,3,4,1,4,
5, 8,3, 8,5, 7,2, 7,4,7,3,7,4,5,1,5,
8,13,5,13,8,11,3,11,7,12,5,12,7,9,2,9,7,11,4,11,7,10,3,10,5,9,4,9,5,6,1,6,
then each column is an arithmetic sequence.
If the sequence is considered by blocks of length 2^m, m = 0,1,2,..., the blocks of this sequence are permutations of terms of blocks from A002487 (Stern's diatomic series or Stern-Brocot sequence), and, more precisely, the reverses of blocks of A020650 ( a(2^m+k) = A020650(2^(m+1)-1-k), m = 0,1,2,..., k = 0,1,2,...,2^m-1).
Moreover, each block is the bit-reversed permutation of the corresponding block of A245325.

Crossrefs

Programs

  • Mathematica
    f[n_] := Which[n == 1, 1, EvenQ@ n, 1/(f[n/2] + 1), True, f[(n - 1)/2] + 1]; Table[Numerator@ f@ k, {n, 7}, {k, 2^(n - 1), 2^n - 1}] // Flatten (* Michael De Vlieger, Mar 02 2017 *)
  • PARI
    a(n) = my(A=0); forstep(i=logint(n, 2), 0, -1, if(bittest(n, i), A++, A=1/(A+1))); numerator(A) \\ Mikhail Kurkov, Mar 12 2023
  • R
    N  <- 25 # arbitrary
    a <- c(1,1,2)
    for(n in 1:N){
      a[4*n]   <-          a[2*n+1]
      a[4*n+1] <- a[2*n] + a[2*n+1]
      a[4*n+2] <- a[2*n]
      a[4*n+3] <- a[2*n] + a[2*n+1]
    }
    a
    

Formula

a(2n) = A245328(2n+1) , a(2n+1) = A245328(2n) , n=0,1,2,3,...
a((2*n+1)*2^m - 2) = A273493(n), n > 0, m > 0. For n = 0, m > 0, A273493(0) = 1 is needed. For n = 1, m = 0, A273493(0) = 1 is needed. For n > 1, m = 0, numerator((2*n-1) = num+den(n-1). - Yosu Yurramendi, Mar 02 2017
a(n) = A002487(A284459(n)). - Yosu Yurramendi, Aug 23 2021
Showing 1-7 of 7 results.