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

A163485 Permutation of integers used for constructing A147995 and A163545.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

Inverse: A163486. This permutation can be used to construct array A147995 and its transpose A163545. See A163355 for a bit similarly defined recursive permutation.

A163545 Transpose of A147995.

Original entry on oeis.org

0, 3, 1, 14, 2, 6, 15, 13, 7, 5, 58, 12, 8, 4, 26, 57, 59, 11, 9, 25, 27, 62, 56, 54, 10, 30, 24, 22, 63, 61, 55, 53, 31, 29, 23, 21, 234, 60, 50, 52, 32, 28, 18, 20, 106, 233, 235, 49, 51, 35, 33, 17, 19, 105, 107, 228, 232, 236, 48, 46, 34, 38, 16, 100, 104, 108, 229
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

Inverse: A163546. a(n) = A163485(A054238(n)).

A163544 Inverse permutation to A147995.

Original entry on oeis.org

0, 1, 4, 2, 11, 6, 3, 7, 12, 17, 24, 18, 13, 8, 5, 9, 58, 48, 38, 47, 37, 28, 21, 29, 22, 16, 10, 15, 39, 30, 23, 31, 40, 49, 60, 50, 83, 70, 59, 71, 84, 97, 112, 98, 85, 72, 61, 73, 62, 52, 42, 51, 41, 32, 25, 33, 26, 20, 14, 19, 43, 34, 27, 35, 260, 238, 216, 237, 177
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

Inverse: A147995. a(n) = A061579(A163546(n)).

A163484 Antidiagonal sums of A147995 and A163545.

Original entry on oeis.org

0, 4, 22, 40, 108, 188, 258, 336, 600, 884, 1190, 1528, 1804, 2092, 2394, 2720, 3760, 4836, 5942, 7112, 8324, 9564, 10890, 12272, 13360, 14484, 15598, 16792, 17996, 19212, 20490, 21824, 25952, 30148, 34390, 38760, 43164, 47612, 52242, 56976
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

A088696 Triangle read by rows, giving number of partial quotients in continued fraction representation of terms in the left branch of the infinite Stern-Brocot tree.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Oct 07 2003

Keywords

Comments

Each next row is the last row concatenated with the last row reversed with elements incremented. A000120 is produced by a similar principle, omitting the reversal step. [Edited by Andrey Zabolotskiy, Mar 27 2020]
From Gary W. Adamson, Aug 08 2009: (Start)
The row with 8 terms: (1, 2, 3, 2, 3, 4, 3, 2); can be used to generate the numbers of hydrogen bonds per codon/anti-codon; superimposed on the DNA codon array of A147995 as follows: top row and left column of an 8 X 8 array is composed of the 8 terms (1, 2, 3, 2, 3, 4, 3, 2). If rows and columns have an offset of "1", then odd rows circulate downward starting from the position (n,n). Even rows circulate in the opposite direction starting from position (n,n).
This produces the array:
1 2 3 2 3 4 3 2
2 1 2 3 4 3 2 3
3 2 1 2 3 2 3 4
2 3 2 1 2 3 2 3
3 4 3 2 1 2 3 2
4 3 2 3 2 1 4 3
3 2 3 4 3 2 1 2
2 3 4 3 2 3 2 1
...
This produces a semi-magic square with a diagonal of (1,1,1,...). Using the simple replacement rule ("complement to 10"): (1->9); (2->8); (3->7); (4->6) we obtain the chart of DNA hydrogen bonds per codon/anti-codon shown in A147995. Top row of the hydrogen bond array as well as left column = (9, 8, 7, 8, 7, 6, 7, 8).
Alternatively, using the circulant rule for alternate rows and putting all 9's along the diagonal, we obtain the chart of hydrogen bonds. (End)
Rows tend to A088748 (which can also be generated from the dragon curve, A014577). - Gary W. Adamson, Aug 30 2009
Positions of records are A081254. - Andrey Zabolotskiy, Mar 27 2020

Examples

			Fractions in the left branch of the infinite Stern-Brocot tree (the fractions between 0 and 1), are:
  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;
  ...
and their corresponding continued fraction representations are:
  [2]
  [3] [1,2]
  [4] [2,2] [1,1,2] [1,3]
  [5] [3,2] [2,1,2] [2,3] [1,1,3] [1,1,1,2] [1,2,2] [1,4]
  ...
with the number of terms in each continued fraction representation generating the present triangle:
  1
  1 2
  1 2 3 2
  1 2 3 2 3 4 3 2
  ...
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, pp. 116-117.

Crossrefs

Programs

  • Haskell
    a088696 n = a088696_list !! (n-1)
    a088696_list = f [1] where
       f (x:xs) = x : f (xs ++ [x + 1 - x `mod` 2, x + x `mod` 2])
    -- Reinhard Zumkeller, Mar 07 2011
    
  • Mathematica
    sb[n_List] := Block[{k = l = Length[n], a = n}, While[k > 1, a = Insert[ a, (Numerator[ a[[k]]] + Numerator[ a[[k - 1]]]) / (Denominator[ a[[k]]] + Denominator[ a[[k - 1]]]), k]; k-- ]; a]; sbn[n_] := Complement[ Nest[ sb, {0, 1}, n], Nest[ sb, {0, 1}, n - 1]]; f[n_] := Length /@ (ContinuedFraction /@ sbn[n]) - 1; Flatten[ Table[ f[n], {n, 7}]] (* Robert G. Wilson v, Jun 09 2004 *)
    Flatten[NestList[Join[#, Reverse[#] + 1] &, {1}, 7]]; (* from A164738, Jon Maiga, Sep 26 2019 *)
  • Python
    a = [[1]]
    for n in range(6):
        a.append(a[-1] + [x+1 for x in a[-1][::-1]])
    print(sum(a, []))
    # Andrey Zabolotskiy, Mar 27 2020, after Jon Maiga

Extensions

Edited and extended by Robert G. Wilson v, Jun 09 2004

A163233 Two-dimensional Binary Reflected Gray Code: a(i,j) = bits of binary expansion of A003188(i) interleaved with that of A003188(j).

Original entry on oeis.org

0, 1, 2, 5, 3, 10, 4, 7, 11, 8, 20, 6, 15, 9, 40, 21, 22, 14, 13, 41, 42, 17, 23, 30, 12, 45, 43, 34, 16, 19, 31, 28, 44, 47, 35, 32, 80, 18, 27, 29, 60, 46, 39, 33, 160, 81, 82, 26, 25, 61, 62, 38, 37, 161, 162, 85, 83, 90, 24, 57, 63, 54, 36, 165, 163, 170, 84, 87, 91
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Comments

The top left 8 X 8 corner of the array is
+0 +1 +5 +4 20 21 17 16
+2 +3 +7 +6 22 23 19 18
10 11 15 14 30 31 27 26
+8 +9 13 12 28 29 25 24
40 41 45 44 60 61 57 56
42 43 47 46 62 63 59 58
34 35 39 38 54 55 51 50
32 33 37 36 52 53 49 48
By taking the top left 2 X 2 corner, 2 X 4 rectangle ((0,1,5,4),(2,3,7,6)) or 4 X 4 corner one obtains Karnaugh map templates for 2, 3 or 4 variables respectively (although not the standard ones usually given in the textbooks).

Crossrefs

Inverse: A163234. a(n) = A057300(A163235(n)). Transpose: A163235. Row sums: A163242. Cf. A054238, A147995.

Programs

  • Mathematica
    Table[Function[k, FromDigits[#, 2] &@ Apply[Function[{a, b}, Riffle @@ Map[PadLeft[#, Max[Length /@ {a, b}]] &, {a, b}]], Map[IntegerDigits[#, 2] &@ BitXor[#, Floor[#/2]] &, {k, j}]]][i - j], {i, 0, 11}, {j, i, 0, -1}] // Flatten (* Michael De Vlieger, Jun 25 2017 *)
  • Python
    def a000695(n):
        n=bin(n)[2:]
        x=len(n)
        return sum([int(n[i])*4**(x - 1 - i) for i in range(x)])
    def a003188(n): return n^(n>>1)
    def a(n, k): return a000695(a003188(n)) + 2*a000695(a003188(k))
    for n in range(21): print([a(n - k, k) for k in range(n + 1)]) # Indranil Ghosh, Jun 25 2017
  • Scheme
    (define (A163233bi x y) (+ (A000695 (A003188 x)) (* 2 (A000695 (A003188 y)))))
    (define (A163233 n) (A163233bi (A025581 n) (A002262 n)))
    

Formula

a(x,y) = A000695(A003188(x)) + 2*A000695(A003188(y)).

A163235 Two-dimensional Binary Reflected Gray Code, transposed version: a(i,j) = bits of binary expansion of A003188(j) interleaved with that of A003188(i).

Original entry on oeis.org

0, 2, 1, 10, 3, 5, 8, 11, 7, 4, 40, 9, 15, 6, 20, 42, 41, 13, 14, 22, 21, 34, 43, 45, 12, 30, 23, 17, 32, 35, 47, 44, 28, 31, 19, 16, 160, 33, 39, 46, 60, 29, 27, 18, 80, 162, 161, 37, 38, 62, 61, 25, 26, 82, 81, 170, 163, 165, 36, 54, 63, 57, 24, 90, 83, 85, 168, 171, 167
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Comments

The top left 8x8 corner of this array
+0 +2 10 +8 40 42 34 32
+1 +3 11 +9 41 43 35 33
+5 +7 15 13 45 47 39 37
+4 +6 14 12 44 46 38 36
20 22 30 28 60 62 54 52
21 23 31 29 61 63 55 53
17 19 27 25 57 59 51 49
16 18 26 24 56 58 50 48
corresponds with Adamson's "H-bond codon-anticodon magic square" (see page 287 in Pickover's book):
CCC CCU CUU CUC UUC UUU UCU UCC
CCA CCG CUG CUA UUA UUG UCG UCA
CAA CAG CGG CGA UGA UGG UAG UAA
CAC CAU CGU CGC UGC UGU UAU UAC
AAC AAU AGU AGC GGC GGU GAU GAC
AAA AAG AGG AGA GGA GGG GAG GAA
ACA ACG AUG AUA GUA GUG GCG GCA
ACC ACU AUU AUC GUC GUU GCU GCC
when the base-triples are interpreted as quaternary (base-4) numbers, with the following rules: C = 0, A = 1, U = 2, G = 3.

References

  • Clifford A. Pickover, The Zen of Magic Squares, Circles, and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002, pp. 285-289.

Crossrefs

Inverse: A163236. a(n) = A057300(A163233(n)). Transpose: A163233. Row sums: A163242. Cf. A054238, A147995.

Programs

  • Mathematica
    Table[Function[k, FromDigits[#, 2] &@Apply[Function[{a, b}, Riffle @@ Map[PadLeft[#, Max[Length /@ {a, b}]] &, {a, b}]], Map[IntegerDigits[#, 2] &@ BitXor[#, Floor[#/2]] &, {k, j}]]][i - j], {i, 0, 11}, {j, 0, i}] // Flatten (* Michael De Vlieger, Jun 25 2017 *)
  • Python
    def a000695(n):
        n=bin(n)[2:]
        x=len(n)
        return sum(int(n[i])*4**(x - 1 - i) for i in range(x))
    def a003188(n): return n^(n>>1)
    def a(n, k): return a000695(a003188(n)) + 2*a000695(a003188(k))
    for n in range(21): print([a(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, Jun 25 2017
  • Scheme
    (define (A163235 n) (A163233bi (A002262 n) (A025581 n)))
    

A164057 Complement to A164056, change A164056 bits (0->1; 1->0). Provides a coding template for Petoukhov matrices, relating to DNA codons.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Aug 09 2009

Keywords

Comments

Sequences by rows can be used as mapping tools for generating Gray code maps.
Jay Kappraff alerted me to the connection between the multiplication version (below) and the 2*3 multiplication table of A036561, in that the terms of the multiplication table (below): (27, 18, 12, 8) are seen as a diagonal in:
1...3,...9,...27,...
2,..6,..18,.........
4..12...............
8...................
.
We may recreate the top row (below): (27, 18, 12, 18, 12, 8, 12, 18), by starting at "27" in the above array, then given the code (1,0,0,1,0,0,1,1), and (8, 12, 18, 27), we mark down the term to the left if the code = 0, (1 otherwise), giving "27" then L,L,R,L,L,R,R or: (27, 18, 12, 18, 12, 8, 12, 18).
Such operations preserve the harmonic character of the isomorphic array in terms of multiplication or division by (2/3) or (3/2) linked to the 2*3 multiplication table. The Gray code map preserves the "one operation" procedure as well as a binomial distribution as to frequency.
The 8*8 array below with top row [27, 18, 12, 18, 12, 8, 12, 18]... has been investigated extensively by Petoukhov, relating to the 64 DNA codons (Cf. A164091, A147995). Petoukhov has made the remarkable discovery that such (Petoukhov matrices) can be generated as squares of matrices with irrational terms, in this case phi, 1.618...

Examples

			First few rows of the triangle in 2^n term strings:
1;
1, 0;
1, 0, 0, 1;
1, 0, 0, 1, 0, 0, 1, 1;
1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1;
...
Given the 16 bit Gray code string (0,...->15): 0000, 0001, 0011, 0010, 0110, 0111, 0101, 0100, 1100, 1101, 1111, 1110, 1010, 1011, 1001, 1000; the number f of 1's per term = (0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1). Then using the increase/decrease rule, we get row 5 of A164056
.
0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0 = row 5 of A164056.
Change to
1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1 = row 5 of A164057.
.
We may use row 3 to generate arrays that make use of the terms by addition or multiplication: By addition: we recreate an array of the number of hydrogen bonds per codon/anti-codon (Cf. A147995, the 64 codons mapped on a Gray code format). Beginning with "9" and using row 4: (1,0,0,1,0,0,1,1); we increase by 1 starting from left if we encounter a 1, and decrease by 1 if the next term = 0. We get: (9, 8, 7, 8, 7, 6, 7, 8) = A. Next, the same sequence A along the left border and 9's as the diagonal. Given upper left term = (1,1), for odd numbered columns (n), begin at position (n,n) and circulate A downward. For even numbered columns, circulate A upward.
This gets us:
.
9, 8, 7, 8, 7, 6, 7, 8
8, 9, 8, 7, 6, 7, 8, 7
7, 8, 9, 8, 7, 8, 7, 6
8, 7, 8, 9, 8, 7, 8, 7
7, 6, 7, 8, 9, 8, 7, 8
6, 7, 8, 7, 8, 9, 6, 7
7, 8, 7, 6, 7, 8, 9, 8
8, 7, 6, 7, 8, 7, 8, 9
.
As shown, (for example), column 4 begins at (4,4), then circulates upwards with sequence A. Last, we superimpose the hydrogen bond array on the DNA array as shown in A147995. Mapping the terms according to the Gray code rules preserves the "1" rule in any Knights's move direction including wrap-arounds: Every neighbor differs from any entry by "1" by addition or subtraction.
Note that in the previous array, (6, 7, 8, 9) may be obtained by the appropriate addition of terms (2 or 3). In the next example, we use the rows to generate A164091, (which I name Petoukhov matrices) as follows:
.
Again, we refer to row 5: (1, 0, 0, 1, 0, 0, 1, 1) and given the upper left term of an 8x8 array = (1,1), we begin with "27" (= 3*3*3 rather than 3+3+3 = 9 as in the addition case. Then, when encountering an 0, multiply current term by (2/3). If the next term = 1, multiply current term by (3/2). Then use the identical circulate rule using "B" = (27, 18, 12, 18, 12, 8, 12, 18) since given (1, 0, 0, 1, 0, 0, 1, 1) and "27", the next term (an 18) = (2/3) * 27, followed by 12 = (2/3)*18, etc; getting: (Cf. A164091):
.
27, 18, 12, 18, 12, 08, 12, 18
18, 27, 18, 12, 08, 12, 18, 12
12, 18, 27, 18, 12, 18, 12, 08
18, 12, 18, 27, 18, 12, 08, 12
12, 08, 12, 18, 27, 18, 12, 18
08, 12, 18, 12, 18, 27, 18, 12
12, 18, 12, 08, 12, 18, 27, 18
18, 12, 08, 12, 18, 12, 18, 27
.
Both the addition case and the multiplication case have a binomial frequency of terms by rows and columns: (one 9, three 7's, three 8's and one 6); while the multiplication case has (one 27, three 18's three 12's and one 8). Both versions preserve the Gray code "one operation" rule in any Knight's move including wrap arounds, since given the second case, any neighbor may be obtained by multiplication of (2/3) or (3/2).
		

References

  • Sergei Petoukhov and Matthew He, "Symmetrical Analysis Techniques for Genetic Systems and Bioinformatics - Advanced Patterns and Applications", IGI Global, (978-1-60566-127-9); October, 2009, Chapters (2, 4, and 6) Clifford Pickover, "The Zen of Magic Squares, Circles, and Stars", Princeton University Press, 2002, pages 285-289.

Crossrefs

Formula

By rows, change bits of A164056: (0->1); (1->0). Note that A164056 can be derived from 2^n strings of Gray code terms by recording the number of 1's in the Gray code terms for n, followed by the rule "1" is recorded if next term is greater than current; 0 otherwise.

A163237 a(i,j) = bits of binary expansion of A003188(i) interleaved with that of A003188(j), then converted with A163241.

Original entry on oeis.org

0, 1, 3, 5, 2, 15, 4, 6, 14, 12, 20, 7, 10, 13, 60, 21, 23, 11, 9, 61, 63, 17, 22, 27, 8, 57, 62, 51, 16, 18, 26, 24, 56, 58, 50, 48, 80, 19, 30, 25, 40, 59, 54, 49, 240, 81, 83, 31, 29, 41, 43, 55, 53, 241, 243, 85, 82, 95, 28, 45, 42, 39, 52, 245, 242, 255, 84, 86, 94
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Crossrefs

Inverse: A163238. a(n) = A163241(A163233(n)). Transpose: A163239. Cf. A147995.

A163239 Transpose of array A163237.

Original entry on oeis.org

0, 3, 1, 15, 2, 5, 12, 14, 6, 4, 60, 13, 10, 7, 20, 63, 61, 9, 11, 23, 21, 51, 62, 57, 8, 27, 22, 17, 48, 50, 58, 56, 24, 26, 18, 16, 240, 49, 54, 59, 40, 25, 30, 19, 80, 243, 241, 53, 55, 43, 41, 29, 31, 83, 81, 255, 242, 245, 52, 39, 42, 45, 28, 95, 82, 85, 252, 254, 246
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Comments

The top left 8x8 corner of this array
+0 +3 15 12 60 63 51 48
+1 +2 14 13 61 62 50 49
+5 +6 10 +9 57 58 54 53
+4 +7 11 +8 56 59 55 52
20 23 27 24 40 43 39 36
21 22 26 25 41 42 38 37
17 18 30 29 45 46 34 33
16 19 31 28 44 47 35 32
corresponds with Adamson's "H-bond codon-anticodon magic square" (see page 287 in Pickover's book):
CCC CCU CUU CUC UUC UUU UCU UCC
CCA CCG CUG CUA UUA UUG UCG UCA
CAA CAG CGG CGA UGA UGG UAG UAA
CAC CAU CGU CGC UGC UGU UAU UAC
AAC AAU AGU AGC GGC GGU GAU GAC
AAA AAG AGG AGA GGA GGG GAG GAA
ACA ACG AUG AUA GUA GUG GCG GCA
ACC ACU AUU AUC GUC GUU GCU GCC
when the base-triples are interpreted as quaternary (base-4) numbers, with the following rules: C = 0, A = 1, G = 2, U = 3.

References

  • Clifford A. Pickover, The Zen of Magic Squares, Circles, and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002, pp. 285-289.

Crossrefs

Inverse: A163240. a(n) = A163241(A163235(n)). Transpose: A163237. Cf. A147995.
Showing 1-10 of 12 results. Next