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 21 results. Next

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

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

A007283 a(n) = 3*2^n.

Original entry on oeis.org

3, 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304, 196608, 393216, 786432, 1572864, 3145728, 6291456, 12582912, 25165824, 50331648, 100663296, 201326592, 402653184, 805306368, 1610612736, 3221225472, 6442450944, 12884901888
Offset: 0

Views

Author

Keywords

Comments

Same as Pisot sequences E(3, 6), L(3, 6), P(3, 6), T(3, 6). See A008776 for definitions of Pisot sequences.
Numbers k such that A006530(A000010(k)) = A000010(A006530(k)) = 2. - Labos Elemer, May 07 2002
Also least number m such that 2^n is the smallest proper divisor of m which is also a suffix of m in binary representation, see A080940. - Reinhard Zumkeller, Feb 25 2003
Length of the period of the sequence Fibonacci(k) (mod 2^(n+1)). - Benoit Cloitre, Mar 12 2003
The sequence of first differences is this sequence itself. - Alexandre Wajnberg and Eric Angelini, Sep 07 2005
Subsequence of A122132. - Reinhard Zumkeller, Aug 21 2006
Apart from the first term, a subsequence of A124509. - Reinhard Zumkeller, Nov 04 2006
Total number of Latin n-dimensional hypercubes (Latin polyhedra) of order 3. - Kenji Ohkuma (k-ookuma(AT)ipa.go.jp), Jan 10 2007
Number of different ternary hypercubes of dimension n. - Edwin Soedarmadji (edwin(AT)systems.caltech.edu), Dec 10 2005
For n >= 1, a(n) is equal to the number of functions f:{1, 2, ..., n + 1} -> {1, 2, 3} such that for fixed, different x_1, x_2,...,x_n in {1, 2, ..., n + 1} and fixed y_1, y_2,...,y_n in {1, 2, 3} we have f(x_i) <> y_i, (i = 1,2,...,n). - Milan Janjic, May 10 2007
a(n) written in base 2: 11, 110, 11000, 110000, ..., i.e.: 2 times 1, n times 0 (see A003953). - Jaroslav Krizek, Aug 17 2009
Subsequence of A051916. - Reinhard Zumkeller, Mar 20 2010
Numbers containing the number 3 in their Collatz trajectories. - Reinhard Zumkeller, Feb 20 2012
a(n-1) gives the number of ternary numbers with n digits with no two adjacent digits in common; e.g., for n=3 we have 010, 012, 020, 021, 101, 102, 120, 121, 201, 202, 210 and 212. - Jon Perry, Oct 10 2012
If n > 1, then a(n) is a solution for the equation sigma(x) + phi(x) = 3x-4. This equation also has solutions 84, 3348, 1450092, ... which are not of the form 3*2^n. - Farideh Firoozbakht, Nov 30 2013
a(n) is the upper bound for the "X-ray number" of any convex body in E^(n + 2), conjectured by Bezdek and Zamfirescu, and proved in the plane E^2 (see the paper by Bezdek and Zamfirescu). - L. Edson Jeffery, Jan 11 2014
If T is a topology on a set V of size n and T is not the discrete topology, then T has at most 3 * 2^(n-2) many open sets. See Brown and Stephen references. - Ross La Haye, Jan 19 2014
Comment from Charles Fefferman, courtesy of Doron Zeilberger, Dec 02 2014: (Start)
Fix a dimension n. For a real-valued function f defined on a finite set E in R^n, let Norm(f, E) denote the inf of the C^2 norms of all functions F on R^n that agree with f on E. Then there exist constants k and C depending only on the dimension n such that Norm(f, E) <= C*max{ Norm(f, S) }, where the max is taken over all k-point subsets S in E. Moreover, the best possible k is 3 * 2^(n-1).
The analogous result, with the same k, holds when the C^2 norm is replaced, e.g., by the C^1, alpha norm (0 < alpha <= 1). However, the optimal analogous k, e.g., for the C^3 norm is unknown.
For the above results, see Y. Brudnyi and P. Shvartsman (1994). (End)
Also, coordination sequence for (infinity, infinity, infinity) tiling of hyperbolic plane. - N. J. A. Sloane, Dec 29 2015
The average of consecutive powers of 2 beginning with 2^1. - Melvin Peralta and Miriam Ong Ante, May 14 2016
For n > 1, a(n) is the smallest Zumkeller number with n divisors that are also Zumkeller numbers (A083207). - Ivan N. Ianakiev, Dec 09 2016
Also, for n >= 2, the number of length-n strings over the alphabet {0,1,2,3} having only the single letters as nonempty palindromic subwords. (Corollary 21 in Fleischer and Shallit) - Jeffrey Shallit, Dec 02 2019
Also, a(n) is the minimum link-length of any covering trail, circuit, path, and cycle for the set of the 2^(n+2) vertices of an (n+2)-dimensional hypercube. - Marco Ripà, Aug 22 2022
The known fixed points of maps n -> A163511(n) and n -> A243071(n). [See comments in A163511]. - Antti Karttunen, Sep 06 2023
The finite subsequence a(3), a(4), a(5), a(6) = 24, 48, 96, 192 is one of only two geometric sequences that can be formed with all interior angles (all integer, in degrees) of a simple polygon. The other sequence is a subsequence of A000244 (see comment there). - Felix Huber, Feb 15 2024
A level 1 Sierpiński triangle is a triangle. Level n+1 is formed from three copies of level n by identifying pairs of corner vertices of each pair of triangles. For n>2, a(n-3) is the radius of the level n Sierpiński triangle graph. - Allan Bickle, Aug 03 2024

References

  • Jason I. Brown, Discrete Structures and Their Interactions, CRC Press, 2013, p. 71.
  • T. Ito, Method, equipment, program and storage media for producing tables, Publication number JP2004-272104A, Japan Patent Office (written in Japanese, a(2)=12, a(3)=24, a(4)=48, a(5)=96, a(6)=192, a(7)=384 (a(7)=284 was corrected)).
  • Kenji Ohkuma, Atsuhiro Yamagishi and Toru Ito, Cryptography Research Group Technical report, IT Security Center, Information-Technology Promotion Agency, JAPAN.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of the following sequences: A029744, A029747, A029748, A029750, A362804 (after 3), A364494, A364496, A364289, A364291, A364292, A364295, A364497, A364964, A365422.
Essentially same as A003945 and A042950.
Row sums of (5, 1)-Pascal triangle A093562 and of (1, 5) Pascal triangle A096940.
Cf. Latin squares: A000315, A002860, A003090, A040082, A003191; Latin cubes: A098843, A098846, A098679, A099321.

Programs

Formula

G.f.: 3/(1-2*x).
a(n) = 2*a(n - 1), n > 0; a(0) = 3.
a(n) = Sum_{k = 0..n} (-1)^(k reduced (mod 3))*binomial(n, k). - Benoit Cloitre, Aug 20 2002
a(n) = A118416(n + 1, 2) for n > 1. - Reinhard Zumkeller, Apr 27 2006
a(n) = A000079(n) + A000079(n + 1). - Zerinvary Lajos, May 12 2007
a(n) = A000079(n)*3. - Omar E. Pol, Dec 16 2008
From Paul Curtz, Feb 05 2009: (Start)
a(n) = b(n) + b(n+3) for b = A001045, A078008, A154879.
a(n) = abs(b(n) - b(n+3)) with b(n) = (-1)^n*A084247(n). (End)
a(n) = 2^n + 2^(n + 1). - Jaroslav Krizek, Aug 17 2009
a(n) = A173786(n + 1, n) = A173787(n + 2, n). - Reinhard Zumkeller, Feb 28 2010
A216022(a(n)) = 6 and A216059(a(n)) = 7, for n > 0. - Reinhard Zumkeller, Sep 01 2012
a(n) = (A000225(n) + 1)*3. - Martin Ettl, Nov 11 2012
E.g.f.: 3*exp(2*x). - Ilya Gutkovskiy, May 15 2016
A020651(a(n)) = 2. - Yosu Yurramendi, Jun 01 2016
a(n) = sqrt(A014551(n + 1)*A014551(n + 2) + A014551(n)^2). - Ezhilarasu Velayutham, Sep 01 2019
a(A048672(n)) = A225546(A133466(n)). - Michel Marcus and Peter Munn, Nov 29 2019
Sum_{n>=1} 1/a(n) = 2/3. - Amiram Eldar, Oct 28 2020

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

A226080 Denominators in the Fibonacci (or rabbit) ordering of the positive rational numbers.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 1, 4, 3, 2, 3, 1, 5, 4, 3, 4, 2, 5, 3, 1, 6, 5, 4, 5, 3, 7, 4, 2, 7, 5, 3, 5, 1, 7, 6, 5, 6, 4, 9, 5, 3, 10, 7, 4, 7, 2, 9, 7, 5, 7, 3, 8, 5, 1, 8, 7, 6, 7, 5, 11, 6, 4, 13, 9, 5, 9, 3, 13, 10, 7, 10, 4, 11, 7, 2, 11, 9, 7, 9, 5, 12, 7
Offset: 1

Views

Author

Clark Kimberling, May 25 2013

Keywords

Comments

Let S be the set of numbers defined by these rules: 1 is in S, and if x is in S, then x+1 and 1/x are in S. Then S is the set of positive rational numbers, which arise in generations as follows: g(1) = (1/1), g(2) = (1+1) = (2), g(3) = (2+1, 1/2) = (3/1, 1/2), g(4) = (4/1, 1/3, 3/2), ... . Once g(n-1) = (g(1), ..., g(z)) is defined, g(n) is formed from the vector (g(1) + 1, 1/g(1), g(2) + 1, 1/g(2), ..., g(z) + 1, 1/g(z)) by deleting all elements that are in a previous generation. A226080 is the sequence of denominators formed by concatenating the generations g(1), g(2), g(3), ... . It is easy to prove the following:
(1) Every positive rational is in S.
(2) The number of terms in g(n) is the n-th Fibonacci number, F(n) = A000045(n).
(3) For n > 2, g(n) consists of F(n-2) numbers < 1 and F(n-1) numbers > 1, hence the name "rabbit ordering" since the n-th generation has F(n-2) reproducing pairs and F(n-1) non-reproducing pairs, as in the classical rabbit-reproduction introduction to Fibonacci numbers.
(4) The positions of integers in S are the Fibonacci numbers.
(5) The positions of 1/2, 3/2, 5/2, ..., are Lucas numbers (A000032).
(6) Continuing from (4) and (5), suppose that n > 0 and 0 < r < n, where gcd(n,r) = 1. The positions in A226080 of the numbers congruent to r mod n comprise a row of the Wythoff array, W = A035513. The correspondence is sampled here:
row 1 of W: positions of n+1 for n>=0,
row 2 of W: positions of n+1/2,
row 3 of W: positions of n+1/3,
row 4 of W: positions of n+1/4,
row 5 of W: positions of n+2/3,
row 6 of W: positions of n+1/5,
row 7 of W: positions of n+3/4.
(7) If the numbers <=1 in S are replaced by 1 and those >1 by 0, the resulting sequence is the infinite Fibonacci word A003849 (except for the 0-offset first term).
(8) The numbers <=1 in S occupy positions -1 + A001950, where A001950 is the upper Wythoff sequence; those > 1 occupy positions given by -1 + A000201, where A000201 is the lower Wythoff sequence.
(9) The rules (1 is in S, and if x is in S, then 1/x and 1/(x+1) are in S) also generate all the positive rationals.
A variant which extends this idea to an ordering of all rationals is described in A226130. - M. F. Hasler, Jun 03 2013
The updown and downup zigzag limits are (-1 + sqrt(5))/2 and (1 + sqrt(5))/2; see A020651. - Clark Kimberling, Nov 10 2013
From Clark Kimberling, Jun 19 2014: (Start)
Following is a guide to related trees and sequences; for example, the tree A226080 is represented by (1, x+1, 1/x), meaning that 1 is in S, and if x is in S, then x+1 and 1/x are in S (except for x = 0).
All the positive integers:
A243571, A243572, A232559 (1, x+1, 2x)
A232561, A242365, A243572 (1, x+1, 3x)
A243573 (1, x+1, 4x)
All the integers:
A243610 (1, 2x, 1-x)
All the positive rationals:
A226080, A226081, A242359, A242360 (1, x+1, 1/x)
A243848, A243849, A243850 (1, x+1, 2/x)
A243851, A243852, A243853 (1, x+1, 3/x)
A243854, A243855, A243856 (1, x+1, 4/x)
A243574, A242308 (1, 1/x, 1/(x+1))
A241837, A243575 ({1,2,3}, x+4, 12/x)
A242361, A242363 (1, 1 + 1/x, 1/x)
A243613, A243614 (0, x+1, x/(x+1))
All the rationals:
A243611, A243612 (0, x+1, -1/(x+1))
A226130, A226131 (1, x+1, -1/x)
A243712, A243713 ({1,2,3}, x+1, 1/(x+1))
A243730, A243731 ({1,2,3,4}, x+1, 1/(x+1))
A243732, A243733 ({1,2,3,4,5}, x+1, 1/(x+1))
A243925, A243926, A243927 (1, x+1, -2/x)
A243928, A243929, A243930 (1, x+1, -3/x)
All the Gaussian integers:
A243924 (1, x+1, i*x)
All the Gaussian rational numbers:
A233694, A233695, A233696 (1, x+1, i*x, 1/x).
(End)

Examples

			The denominators are read from the rationals listed in "rabbit order":
1/1, 2/1, 3/1, 1/2, 4/1, 1/3, 3/2, 5/1, 1/4, 4/3, 5/2, 2/3, 6/1, ...
		

Crossrefs

Cf. A000045, A035513, A226081 (numerators), A226130, A226247, A020651.

Programs

  • Mathematica
    z = 10; g[1] = {1}; g[2] = {2}; g[3] = {3, 1/2};
    j[3] = Join[g[1], g[2], g[3]]; j[n_] := Join[j[n - 1], g[n]];
    d[s_List, t_List] := Part[s, Sort[Flatten[Map[Position[s, #] &, Complement[s, t]]]]]; j[3] = Join[g[1], g[2], g[3]]; n = 3; While[n <= z, n++; g[n] = d[Riffle[g[n - 1] + 1, 1/g[n - 1]], g[n - 2]]];
    Table[g[n], {n, 1, z}]; j[z] (* rabbit-ordered rationals *)
    Denominator[j[z]]  (* A226080 *)
    Numerator[j[z]]    (* A226081 *)
    Flatten[NestList[(# /. x_ /; x > 1 -> Sequence[x, 1/x - 1]) + 1 &, {1}, 9]] (* rabbit-ordered rationals, Danny Marmer, Dec 07 2014 *)
  • PARI
    A226080_vec(N=100)={my(T=[1],S=T,A=T); while(N>#A=concat(A, apply(denominator, T=select(t->!setsearch(S,t), concat(apply(t->[t+1,1/t],T))))), S=setunion(S,Set(T)));A} \\ M. F. Hasler, Nov 30 2018
    
  • PARI
    (A226080(n)=denominator(RabbitOrderedRational(n))); ROR=List(1); RabbitOrderedRational(n)={if(n>#ROR, local(S=Set(ROR), i=#ROR*2\/(sqrt(5)+1), a(t)=setsearch(S,t)||S=setunion(S,[listput(ROR,t)])); until( type(ROR[i+=1])=="t_INT" && n<=#ROR, a(ROR[i]+1); a(1/ROR[i])));ROR[n]} \\ M. F. Hasler, Nov 30 2018

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

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

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The fractions are given in their reduced form, thus gcd(a(n), A020651(n)) = 1 for all n. - Antti Karttunen, May 26 2004
From Yosu Yurramendi, Jul 13 2014 : (Start)
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,
2,1,
3,1,3,2,
4,1,4,3,5,2,5,3,
5,1,5,4,7,3,7,4, 7,2, 7,5, 8,3, 8,5,
6,1,6,5,9,4,9,5,10,3,10,7,11,4,11,7,9,2,9,7,12,5,12,7,11,3,11,8,13,5,13,8,
then the sum of the m-th row is 3^m (m = 0,1,2,), and each column is an arithmetic sequence.
If the rows are written in a right-aligned fashion:
1,
2,1,
3,1, 3,2,
4,1, 4,3, 5,2, 5,3,
5,1,5,4, 7,3, 7,4, 7,2, 7,5, 8,3, 8,5,
6,1,6,5,9,4,9,5,10,3,10,7,11,4,11,7,9,2,9,7,12,5,12,7,11,3,11,8,13,5,13,8,
each column k is a Fibonacci sequence. (End)
a(n2^m+1) = a(2n+1), n > 0, m > 0. - Yosu Yurramendi, Jun 04 2016

Examples

			1, 2, 1/2, 3, 1/3, 3/2, 2/3, 4, 1/4, 4/3, ...
		

Crossrefs

Cf. A020651.
Bisection: A086592.

Programs

  • Haskell
    import Data.List (transpose); import Data.Ratio (numerator)
    a020650_list = map numerator ks where
       ks = 1 : concat (transpose [map (+ 1) ks, map (recip . (+ 1)) ks])
    -- Reinhard Zumkeller, Feb 22 2014
    
  • Maple
    A020650 := n -> `if`((n < 2),n, `if`(type(n,even), A020650(n/2)+A020651(n/2), A020651(n-1)));
  • Mathematica
    f[1] = 1; f[n_?EvenQ] := f[n] = f[n/2]+1; f[n_?OddQ] := f[n] = 1/(f[(n-1)/2]+1); a[n_] := Numerator[f[n]]; Table[a[n], {n, 1, 94}] (* Jean-François Alcover, Nov 22 2011 *)
    a[1]=1; a[2]=2; a[3]=1; a[n_] := a[n] = Switch[Mod[n, 4], 0, a[n/2+1] + a[n/2], 1, a[(n-1)/2+1], 2, a[(n-2)/2+1] + a[(n-2)/2], 3, a[(n-3)/2]]; Array[a, 100] (* Jean-François Alcover, Jan 22 2016, after Yosu Yurramendi *)
  • R
    N <- 25 # arbitrary
    a <- c(1,2,1)
    for(n in 1:N){
      a[4*n]   <- a[2*n] + a[2*n+1]
      a[4*n+1] <-          a[2*n+1]
      a[4*n+2] <- a[2*n] + a[2*n+1]
      a[4*n+3] <- a[2*n]
    }
    a
    # Yosu Yurramendi, Jul 13 2014

Formula

a(1) = 1, a(2n) = a(n) + A020651(n), a(2n+1) = A020651(2n) = A020651(n). - Antti Karttunen, May 26 2004
a(2n) = A020651(2n+1). - Yosu Yurramendi, Jul 17 2014
a((2*n+1)*2^m + 1) = A086592(n), n > 0, m > 0. For n = 0, A086592(0) = 1 is needed. For m = 0, a(2*(n+1)) = A086592(n+1). - Yosu Yurramendi, Feb 19 2017
a(n) = A002487(1+A231551(n)), n > 0. - Yosu Yurramendi, Aug 07 2021

A071585 Numerator of the continued fraction expansion whose terms are the first-order differences of exponents in the binary representation of 4*n, with the exponents of 2 being listed in descending order.

Original entry on oeis.org

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

Views

Author

Paul D. Hanna, Jun 01 2002

Keywords

Comments

Thus a(n)/a(m) = d_1 + 1/(d_2 + 1/(d_3 + ... + 1/d_k)) where m = n - 2^floor(log_2(n)) + 1 and where d_j = b_j - b_(j+1) are the differences of the binary exponents b_j > b_(j+1) defined by: 4*n = 2^b_1 + 2^b_2 + 2^b_3 + ... 2^b_k.
All the rationals are uniquely represented by this sequence - compare Stern's diatomic sequence A002487.
This sequence lists the rationals >= 1 in order by the sum of the terms of their continued fraction expansions. For example, the numerators generated from partitions of 5 that do not end with 1 are listed together as 5, 7, 7, 8, 5, 7, 7, 8, since: 5/1 = [5]; 7/2 = [3;2]; 7/3 = [2;3]; 8/3 = [2;1,2]; 5/4 = [1;4]; 7/5 = [1;2,2]; 7/4 = [1;1,3]; 8/5 = [1;1,1,2].
From Yosu Yurramendi, Jun 23 2014: (Start)
If the terms (n>0) are written as an array:
1,
2,
3, 3,
4, 5, 4, 5,
5, 7, 7, 8, 5, 7, 7, 8,
6, 9,10,11, 9,12,11,13, 6, 9,10,11, 9,12,11,13,
7,11,13,14,13,17,15,18,11,16,17,19,14,19,18,21,7,11,13,14,13,17,15,18,11, ...
then the sum of the k-th row is 2*3^(k-2) for k>1, each column is an arithmetic progression. The differences of the arithmetic sequences give the sequence A071585 itself: a(2^(p+1)+k) - a(2^p+k) = a(k). A002487 and A007306 also have these properties. The first terms of columns, excluding a(0), give A086593.
If the rows (n>0) are written on right:
1;
2;
3, 3;
4, 5, 4, 5;
5, 7, 7, 8, 5, 7, 7, 8;
6, 9, 10, 11, 9, 12, 11, 13, 6, 9, 10, 11, 9, 12, 11, 13;
then each column is a Fibonacci sequence: a(2^(p+2)+k) = a(2^(p+1)+k) + a(2^p+k). The first terms of columns, excluding a(0), give A086593. (End)
n>1 occurs in this sequence phi(n) = A000010(n) times, as it occurs in A007306 (Franklin T. Adams-Watters's comment), that is the sequence obtained by adding numerator and denominator in the Calkin-Wilf enumeration system of positive rationals. A229742(n)/A071766(n) is also an enumeration system of all positive rationals (HCS system), 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) (A229742(n)+A071766(n)) has the same terms in each level as A007306. The same property occurs in all numerator+denominator sequences of enumeration systems of positive rationals, as, for example, A007306 (A007305+A047679), A086592 (A020650+A020651), and A268087 (A162909+A162910). - Yosu Yurramendi, Apr 06 2016
a(n) = A086592(A059893(n)), a(A059893(n)) = A086592(n), n > 0. - Yosu Yurramendi, May 30 2017

Examples

			a(37)=17 as it is the numerator of 17/5 = 3 + 1/(2 + 1/2), which is a continued fraction that can be derived from the binary expansion of 4*37 = 2^7 + 2^4 + 2^2; the binary exponents are {7, 4, 2}, thus the differences of these exponents are {3, 2, 2}; giving the continued fraction expansion of 17/5=[3,2,2].
Illustration of Sum_{m=0..2^(k-1)-1} a(2^k + m) = 3^k:
k=2: 3^2 = a(2^2) + a(2^2 + 1) = 4 + 5;
k=3: 3^3 = a(2^3) + a(2^3 + 1) + a(2^3 + 2) + a(2^3 + 3) = 5 + 7 + 7 + 8;
k=4: 3^4 = a(2^4) + a(2^4+1) + a(2^4+2) + a(2^4+3) + a(2^4+4) + a(2^4+5) + a(2^4+6) + a(2^4+7) = 6 + 9 + 10 + 11 + 9 + 12 + 11 + 13.
1, 2, 3, 3/2, 4, 5/2, 4/3, 5/3, 5, 7/2, 7/3, 8/3, 5/4, 7/5, 7/4, 8/5, 6, ...
From _Yosu Yurramendi_, Jun 27 2014: (Start)
a(0) =             = 1;
a(1) = a(0) + a(0) = 2;
a(2) = a(0) + a(1) = 3;
a(3) = a(1) + a(0) = 3;
a(4) = a(0) + a(2) = 4;
a(5) = a(1) + a(3) = 5;
a(6) = a(2) + a(0) = 4;
a(7) = a(3) + a(1) = 5;
a(8) = a(0) + a(4) = 5;
a(9) = a(1) + a(5) = 7;
a(10) = a(2) + a(6) = 7;
a(11) = a(3) + a(7) = 8;
a(12) = a(4) + a(0) = 5;
a(13) = a(5) + a(1) = 7;
a(14) = a(6) + a(2) = 7;
a(15) = a(7) + a(3) = 8. (End)
		

Crossrefs

Cf. A071766.

Programs

  • Mathematica
    ncf[n_]:=Module[{br=Reverse[Flatten[Position[Reverse[IntegerDigits[4 n,2]],1]-1]]}, Numerator[FromContinuedFraction[Flatten[Join[{Abs[ Differences[ br]],Last[br]}]]]]]; Join[{1},Array[ncf,80]] (* Harvey P. Dale, Jul 01 2012 *)
    {1}~Join~Table[Numerator@ FromContinuedFraction@ Append[Abs@ Differences@ #, Last@ #] &@ Log2[NumberExpand[4 n, 2] /. 0 -> Nothing], {n, 120}] (* Version 11, or *)
    {1}~Join~Table[Numerator@ FromContinuedFraction@ Append[Abs@ Differences@ #, Last@ #] &@ Log2@ DeleteCases[# Reverse[2^Range[0, Length@ # - 1]] &@ IntegerDigits[4 n, 2], k_ /; k == 0], {n, 120}] (* Michael De Vlieger, Aug 15 2016 *)
  • R
    blocklevel <- 7  # arbitrary
    a <- c(1,2)
    for(k in 1:blocklevel)
    a <- c(a, a + c(a[((length(a)/2)+1):length(a)],a[1:(length(a)/2)]))
    a
    # Yosu Yurramendi, Jun 26 2014
    
  • R
    blocklevel <- 7  # arbitrary
    a <- c(1,2)
    for(p in 0:blocklevel)
      for(k in 1:2^(p+1)){
        if (k <=  2^p) a[k + 2^(p+1)] = a[k] + a[k + 2^p]
        else           a[k + 2^(p+1)] = a[k] + a[k - 2^p]
    }
    a
    # Yosu Yurramendi, Jun 27 2014

Formula

a(2^k + 2^j + m) = (k-j)*a(2^j + m) + a(m) when 2^k > 2^j > m >= 0.
a(0) = 1, a(2^k) = k + 2,
a(2^k + 1) = 2*k + 1 (k>0),
a(2^k + 2) = 3*k - 2 (k>1),
a(2^k + 3) = 3*k - 1 (k>1),
a(2^k + 4) = 4*k - 7 (k>2).
a(2^k - 1) = Fibonacci(k+2) = A000045(k+2).
Sum_{m=0..2^(k-1)-1} a(2^k + m) = 3^k (k>0).
From Yosu Yurramendi, Jun 27 2014: (Start)
Write n = k + 2^(m+1), k = 0,1,2,...,2^(m+1)-1, m = 0,1,2,...
if 0 <= k < 2^m, a(k + 2^(m+1)) = a(k) + a(k + 2^m).
if 2^m <= k < 2^(m+1), a(k + 2^(m+1)) = a(k) + a(k - 2^m).
with a(0)=1, a(1)=2. (End)
a(n) = A059893(A086592(n)), n>0. - Yosu Yurramendi, Apr 09 2016
a(n) = A093873(n) + A093875(n), n > 0. - Yosu Yurramendi, Jul 22 2016
a(n) = A093873(2n) + A093873(2n+1), n > 0; a(n) = A093875(2n) = A093875(2n+1), n > 0. - Yosu Yurramendi, Jul 25 2016
a(n) = sqrt(A071766(2^(m+1)+n)*A229742(2^(m+1)+n) - A071766(2^m+n)*A229742(2^m+n)), for n > 0, where m = floor(log_2(n)+1). - Yosu Yurramendi, Jun 10 2019
a(n) = A007306(A059893(A233279(n))), n > 0. - Yosu Yurramendi, Aug 07 2021
a(n) = A007306(A059894(A006068(n))), n > 0. - Yosu Yurramendi, Sep 29 2021
Conjecture: a(n) = a(floor(n/2)) + Sum_{k=1..A000120(n)} a(b(n, k))*(-1)^(k-1) for n > 0 with a(0) = 1 where b(n, k) = A025480(b(n, k-1) - 1) for n > 0, k > 0 with b(n, 0) = n. - Mikhail Kurkov, Feb 20 2023

A093873 Numerators in Kepler's tree of harmonic fractions.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 1, 3, 2, 3, 1, 3, 2, 3, 1, 4, 3, 4, 2, 5, 3, 5, 1, 4, 3, 4, 2, 5, 3, 5, 1, 5, 4, 5, 3, 7, 4, 7, 2, 7, 5, 7, 3, 8, 5, 8, 1, 5, 4, 5, 3, 7, 4, 7, 2, 7, 5, 7, 3, 8, 5, 8, 1, 6, 5, 6, 4, 9, 5, 9, 3, 10, 7, 10, 4, 11, 7, 11, 2, 9, 7, 9, 5, 12, 7, 12, 3, 11, 8, 11, 5, 13, 8, 13, 1, 6
Offset: 1

Views

Author

Keywords

Comments

Form a tree of fractions by beginning with 1/1 and then giving every node i/j two descendants labeled i/(i+j) and j/(i+j).

Examples

			The first few fractions are:
1 1 1 1 2 1 2 1 3 2 3 1 3 2 3 1 4 3 4 2 5 3 5 1 4 3 4 2 5 3 5
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ...
1 2 2 3 3 3 3 4 4 5 5 4 4 5 5 5 5 7 7 7 7 8 8 5 5 7 7 7 7 8 8
		

Crossrefs

The denominators are in A093875. Usually one only considers the left-hand half of the tree, which gives the fractions A020651/A086592. See A086592 for more information, references to Kepler, etc.
See A294442 for another version of Kepler's tree of fractions.

Programs

  • Haskell
    {-# LANGUAGE ViewPatterns #-}
    import Data.Ratio((%), numerator, denominator)
    rat :: Rational -> (Integer,Integer)
    rat r = (numerator r, denominator r)
    data Harmony = Harmony Harmony Rational Harmony
    rows :: Harmony -> [[Rational]]
    rows (Harmony hL r hR) = [r] : zipWith (++) (rows hL) (rows hR)
    kepler :: Rational -> Harmony
    kepler r = Harmony (kepler (i%(i+j))) r (kepler (j%(i+j)))
               where (rat -> (i,j)) = r
    -- Full tree of Kepler's harmonic fractions:
    k = rows $ kepler 1 :: [[Rational]] -- as list of lists
    h = concat k :: [Rational] -- flattened
    a093873 n = numerator $ h !! (n - 1)
    a093875 n = denominator $ h !! (n - 1)
    a011782 n = numerator $ (map sum k) !! n -- denominator == 1
    -- length (k !! n) == 2^n
    -- numerator $ (map last k) !! n == fibonacci (n + 1)
    -- denominator $ (map last k) !! n == fibonacci (n + 2)
    -- numerator $ (map maximum k) !! n == n
    -- denominator $ (map maximum k) !! n == n + 1
    -- eop.
    -- Reinhard Zumkeller, Oct 17 2010
  • Maple
    M:= 8: # to get a(1) .. a(2^M-1)
    gen[1]:= [1];
    for n from 2 to M do
      gen[n]:= map(t -> (numer(t)/(numer(t)+denom(t)),
          denom(t)/(numer(t)+denom(t))), gen[n-1]);
    od:
    seq(op(map(numer,gen[i])),i=1..M): # Robert Israel, Jan 11 2016
  • Mathematica
    num[1] = num[2] = 1; den[1] = 1; den[2] = 2; num[n_?EvenQ] := num[n] = num[n/2]; den[n_?EvenQ] := den[n] = num[n/2] + den[n/2]; num[n_?OddQ] := num[n] = den[(n-1)/2]; den[n_?OddQ] := den[n] = num[(n-1)/2] + den[(n-1)/2]; A093873 = Table[num[n], {n, 1, 97}] (* Jean-François Alcover, Dec 16 2011 *)

Formula

a(n) = a([n/2])*(1 - n mod 2) + A093875([n/2])*(n mod 2).
a(A029744(n-1)) = 1; a(A070875(n-1)) = 2; a(A123760(n-1)) = 3. - Reinhard Zumkeller, Oct 13 2006
A011782(k) = SUM(a(n)/A093875(n): 2^k<=n<2^(k+1)), k>=0. [Reinhard Zumkeller, Oct 17 2010]
a(1) = 1. For all n>0 a(2n) = a(n), a(2n+1) = A093875(n). - Yosu Yurramendi, Jan 09 2016
a(4n+3) = a(4n+1), a(4n+2) = a(4n+1) - a(4n), a(4n+1) = A071585(n). - Yosu Yurramendi, Jan 11 2016
G.f. G(x) satisfies G(x) = x + (1+x) G(x^2) + Sum_{k>=2} x (1+x^(2^(k-1))) G(x^(2^k)). - Robert Israel, Jan 11 2016
a(2^(m+1)+k) = a(2^(m+1)+2^m+k) = A020651(2^m+k), m>=0, 0<=k<2^m. - Yosu Yurramendi, May 18 2016
a(k) = A020651(2^(m+1)+k) - A020651(2^m+k), m>0, 0Yosu Yurramendi, Jun 01 2016
a(2^(m+1)+k) - a(2^m+k) = a(k) , m >=0, 0 <= k < 2^m. For k=0 a(0)=0 is needed. - Yosu Yurramendi, Jul 22 2016
a(2^(m+2)-1-k) = a(2^(m+1)-1-k) + a(2^m-1-k), m >= 1, 0 <= k < 2^m. - Yosu Yurramendi, Jul 22 2016
a(2^m-1-(2^r -1)) = A000045(m-r), m >= 1, 0 <= r <= m-1. - Yosu Yurramendi, Jul 22 2016
a(2^m+2^r) = m-r, , m >= 1, 0 <= r <= m-1 ; a(2^m+2^r+2^(r-1)) = m-(r-1), m >= 2, 0 <= r <= m-1. - Yosu Yurramendi, Jul 22 2016
A093875(2n) - a(2n) = A093875(n), n > 0; A093875(2n+1) - a(2n+1) = a(n), n > 0. - Yosu Yurramendi, Jul 23 2016

A294442 Kepler's tree of fractions, read across rows (the fraction i/j is represented as the pair i,j).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Nov 20 2017

Keywords

Comments

The first row contains the single fraction 1/1,
the second row contains the single fraction 1/2,
and thereafter below each fraction i/j we write two fractions i/(i+j), j/(i+j).
If we just look at the numerators we recover the same sequence, and if we just look at the denominators we get A086593 with the terms (after the first) repeated.
Sequence A020651 is almost the same as this, except that it lacks one of the initial 1's, and the definition focuses on single numbers rather than pairs of numbers or fractions. For that reason it seems to be best to have a separate entry (this sequence) for the actual tree.

Examples

			The tree begins as follows:
..............1/1
...............|
..............1/2
.........../.......\
......1/3.............2/3
...../....\........../...\
..1/4.....3/4.....2/5.....3/5
../..\..../..\..../..\..../..\
1/5.4/5.3/7.4/7.2/7.5/7.3/8.5/8
		

Crossrefs

A different version of the Kepler tree is described in A093873.
See A294446 for the tree of Farey fractions.

Programs

  • Maple
    # S[n] is the list of fractions, written as pairs [i,j], in row n of Kepler's triangle
    S[0]:=[[1,1]]; S[1]:=[[1,2]];
    for n from 2 to 10 do
    S[n]:=[];
    for k from 1 to nops(S[n-1]) do
    t1:=S[n-1][k];
    a:=[t1[1],t1[1]+t1[2]];
    b:=[t1[2],t1[1]+t1[2]];
    S[n]:=[op(S[n]),a,b];
    od:
    lprint(S[n]);
    od:
  • Mathematica
    Map[{Numerator@ #, Denominator@ #} &, #] &@ Flatten@ Nest[Append[#, Flatten@ Map[{#1/(#1 + #2), #2/(#1 + #2)} & @@ {Numerator@ #, Denominator@ #} &, Last@ #]] &, {{1/1}, {1/2}}, 5] // Flatten (* Michael De Vlieger, Apr 18 2018 *)
Showing 1-10 of 21 results. Next