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

A163530 a(n) = A163528(n)+A163529(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

See also: A059261, A059285, A163531.

A342218 The n-th and a(n)-th points of the Peano curve (A163528, A163529) are symmetrical with respect to the line X=Y.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 05 2021

Keywords

Comments

In other words, a(n) is the unique k such that A163528(n) = A163529(k) and A163528(k) = A163529(n).
This sequence is a self-inverse permutation of the nonnegative integers.

Examples

			The Peano curve (A163528, A163529) begins as follows:
       +-----+-----+
       |6     7     8
       |
       +-----+-----+
        5     4    |3
                   |
       +-----+-----+
        0     1     2
- so a(0) = 0,
     a(1) = 5,
     a(2) = 6,
     a(3) = 7,
     a(4) = 4,
     a(8) = 8.
		

Crossrefs

See A342217 and A342224 for similar sequences.

Programs

  • PARI
    See Links section.
    
  • PARI
    my(table=[0,5,6,7,4,1,2,3,8]); a(n) = fromdigits(apply(d->table[d+1], digits(n,9)), 9); \\ Kevin Ryde, Mar 07 2021

Formula

a(n) = n iff n belongs to A338086.
a(n) < 9^k for any n < 9^k.

A163334 Peano curve in an n X n grid, starting rightwards from the top left corner, listed antidiagonally as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ... .

Original entry on oeis.org

0, 1, 5, 2, 4, 6, 15, 3, 7, 47, 16, 14, 8, 46, 48, 17, 13, 9, 45, 49, 53, 18, 12, 10, 44, 50, 52, 54, 19, 23, 11, 43, 39, 51, 55, 59, 20, 22, 24, 42, 40, 38, 56, 58, 60, 141, 21, 25, 29, 41, 37, 69, 57, 61, 425, 142, 140, 26, 28, 30, 36, 70, 68, 62, 424, 426, 143, 139
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Examples

			The top left 9 X 9 corner of the array shows how this surjective self-avoiding walk begins (connect the terms in numerical order, 0-1-2-3-...):
   0  1  2 15 16 17 18 19 20
   5  4  3 14 13 12 23 22 21
   6  7  8  9 10 11 24 25 26
  47 46 45 44 43 42 29 28 27
  48 49 50 39 40 41 30 31 32
  53 52 51 38 37 36 35 34 33
  54 55 56 69 70 71 72 73 74
  59 58 57 68 67 66 77 76 75
  60 61 62 63 64 65 78 79 80
		

Crossrefs

Transpose: A163336. Inverse: A163335. One-based version: A163338. Row sums: A163342. Row 0: A163480. Column 0: A163481. Central diagonal: A163343.
See A163357 and A163359 for the Hilbert curve.

Programs

  • Mathematica
    b[{n_, k_}, {m_}] := (A[k, n] = m - 1);
    MapIndexed[b, List @@ PeanoCurve[4][[1]]];
    Table[A[n - k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Mar 07 2021 *)

Formula

a(n) = A163332(A163328(n)).

Extensions

Links to further derived sequences added by Antti Karttunen, Sep 21 2009
Name corrected by Kevin Ryde, Aug 22 2020

A059252 Hilbert's Hamiltonian walk on N X N projected onto x axis: m(3).

Original entry on oeis.org

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

Views

Author

Claude Lenormand (claude.lenormand(AT)free.fr), Jan 23 2001

Keywords

Comments

This is the X-coordinate of the n-th term in Hilbert's Hamiltonian walk A163359 and the Y-coordinate of its transpose A163357.

Examples

			[m(1)=0 0 1 1, m'(1)= 0 1 10] [m(2) =0 0 1 1 2 3 3 2 2 3 3 2 1 1 0 0, m'(2)=0 1 1 0 0 0 1 1 2 2 3 3 3 2 2 3].
		

Crossrefs

See also the y-projection, m'(3), A059253, as well as: A163539, A163540, A163542, A059261, A059285, A163547 and A163529.

Programs

  • C
    void h(unsigned int *x, unsigned int *y, unsigned int l){
    x[0] = y[0] = 0; unsigned int *t = NULL; unsigned int n = 0, k = 0;
    for(unsigned int i = 1; i>(2*n)){
    case 1: x[i] = y[i&k]; y[i] = x[i&k]+(1<Jared Rager, Jan 09 2021 */
    (C++) See Fxtbook link.

Formula

Initially [m(0) = 0, m'(0) = 0]; recursion: m(2n + 1) = m(2n).m'(2n).f(m'(2n), 2n).c(m(2n), 2n + 1); m'(2n + 1) = m'(2n).f(m(2n), 2n).f(m(2n), 2n).mir(m'(2n)); m(2n) = m(2n - 1).f(m'(2n - 1), 2n - 1).f(m'(2n - 1), 2n - 1).mir(m(2n - 1)); m'(2n) = m'(2n - 1).m(2n - 1).f(m(2n - 1), 2n - 1).c(m'(2n - 1), 2n); where f(m, n) is the alphabetic morphism i := i + 2^n [example: f(0 0 1 1 2 3 3 2 2 3 3 2 1 1 0 0, 2) = 4 4 5 5 6 7 7 6 6 7 7 6 5 5 4 4]; c(m, n) is the complementation to 2^n - 1 alphabetic morphism [example: c(0 0 1 1 2 3 3 2 2 3 3 2 1 1 0 0, 3) = 7 7 6 6 5 4 4 5 5 4 4 5 6 6 7 7]; and mir(m) is the mirror operator [example: mir(0 1 1 0 0 0 1 1 2 2 3 3 3 2 2 3) = 3 2 2 3 3 3 2 2 1 1 0 0 0 1 1 0].
a(n) = A002262(A163358(n)) = A025581(A163360(n)) = A059906(A163356(n)).

Extensions

Extended by Antti Karttunen, Aug 01 2009

A163528 The X-coordinate of the n-th point in the Peano curve A163334.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Comments

There is a 2-state automaton that accepts exactly those pairs (n,a(n)) where n is represented in base 9 and a(n) in base 3; see accompanying file a163528.pdf - Jeffrey Shallit, Aug 10 2023

Crossrefs

Formula

a(n) = A025581(A163335(n)) = A002262(A163337(n)) = A163325(A163332(n)).

Extensions

Name corrected by Kevin Ryde, Aug 28 2020

A163332 Self-inverse permutation of the integers for constructing the Peano curve in an N X N grid.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Comments

The integers [0,(3^k)-1] are confined to range [0,(3^k)-1].
From Kevin Ryde, Sep 04 2020: (Start)
To calculate a(n), write n in ternary digits n[k],..,n[0], where n[0] is the least significant digit. Then the ternary digits of a(n) are a[j] = k^{n[j+1]+n[j+3]+...}(n[j]) where Peano's complement operator k^{s}(d) = d if s even or 2-d if s odd.
A single complement is k(d) = 2-d and the "exponent" is repeats k(k(k(...))). Sum s = n[j+1] + n[j+3] + ... is every second digit above j, so digit j flips 0 <-> 2 when an odd number of odd digits (1's) among these. The complement does not change digit parity so a second transformation re-complements back to the original digits and so self-inverse a(a(n)) = n.
Peano's curve is formed by digits of a(n) put alternately to x and y coordinates, so a(n) maps between the Peano curve the ternary Z-order curve per the formulas in A163528, A163529.
(End)

Crossrefs

Coordinates using this transform: A163528, A163529.
A163334 & A163336 give two variants of the Peano curve in an N X N grid.
Cf. A163355 (Hilbert curve).

Programs

  • Mathematica
    a[n_] := FromDigits[With[{d = Reverse@IntegerDigits[n, 3]}, Reverse@Table[
      If[EvenQ@Total@d[[j+1 ;; ;; 2]], d[[j]], 2-d[[j]]], {j, Length@d}]], 3];
    Array[a, 100] (* Andrey Zabolotskiy, Apr 08 2021, after Kevin Ryde *)
  • PARI
    a(n) = my(v=digits(n,3)); for(start=2,3, my(s=0); forstep(i=start,#v,2, s+=v[i-1]; if(s%2,v[i]=2-v[i]))); fromdigits(v,3); \\ Kevin Ryde, Sep 04 2020

Formula

a(n) = A163327(A163333(A163327(n))).

Extensions

Name corrected by Kevin Ryde, Aug 27 2020

A083884 a(n) = (3^(2*n) + 1) / 2.

Original entry on oeis.org

1, 5, 41, 365, 3281, 29525, 265721, 2391485, 21523361, 193710245, 1743392201, 15690529805, 141214768241, 1270932914165, 11438396227481, 102945566047325, 926510094425921, 8338590849833285, 75047317648499561, 675425858836496045, 6078832729528464401
Offset: 0

Views

Author

Paul Barry, May 09 2003

Keywords

Comments

Number of compositions of even natural numbers into n parts <= 8. - Adi Dani, May 28 2011
a(n) for n >= 1 gives the number of line segments in the n-th iteration of the Peano curve given by plotting (A163528, A163529) or by (Siromoney 1982) when parallel line segments that are connected end-to-end are counted as a single line segment. - Jason V. Morgan, Oct 08 2021

Examples

			From _Adi Dani_, May 28 2011: (Start)
a(2)=41: there are 41 compositions of even natural numbers into 2 parts <=8:
(0,0);
(0,2),(2,0),(1,1);
(0,4),(4,0),(1,3),(3,1),(2,2);
(0,6),(6,0),(1,5),(5,1),(2,4),(4,2),(3,3);
(0,8),(8,0),(1,7),(7,1),(2,6),(6,2),(3,5),(5,3),(4,4);
(2,8),(8,2),(3,7),(7,3),(4,6),(6,4),(5,5);
(4,8),(8,4),(5,7),(7,5),(6,6);
(6,8),(8,6),(7,7);
(8,8).  (End)
		

References

  • Siromoney, R., & Subramanian, K.G. (1982). Space-filling curves and infinite graphs. Graph-Grammars and Their Application to Computer Science.

Crossrefs

Programs

Formula

a(0) = 1, a(n) = 9*a(n-1) - 4.
a(n) = Sum_{k=0..n} binomial(2*n, 2*k)*4^k.
a(n) = A002438(n) / A000364(n); A000364(n) : Euler numbers.
G.f.: (1-5*x)/((1-x)*(1-9*x)).
a(n) = (3^n + 1^n + (-1)^n + (-3)^n)/4.
E.g.f.: exp(3*x) + exp(x) + exp(-x) + exp(-3*x).
Each term expresses a Pythagorean relationship, along with (a(n)-1) and a power of 3, n>0, such that sqrt((a(n))^2 - (a(n)-1)^2) = 3^n. E.g., 365^2 - 364^2 - 3^3 = 27 (the Pythagorean triangle (365, 364, 27)). - Gary W. Adamson, Jun 25 2006
a(n) = 10*a(n-1) - 9*a(n-2). - Wesley Ivan Hurt, Apr 21 2021

Extensions

Additional comments from Philippe Deléham, Jul 10 2005

A163531 The square of the distance from the origin to the n-th point in the Peano curve A163334.

Original entry on oeis.org

0, 1, 4, 5, 2, 1, 4, 5, 8, 13, 20, 29, 26, 17, 10, 9, 16, 25, 36, 49, 64, 65, 50, 37, 40, 53, 68, 73, 58, 45, 52, 65, 80, 89, 74, 61, 50, 41, 34, 25, 32, 41, 34, 25, 18, 13, 10, 9, 16, 17, 20, 29, 26, 25, 36, 37, 40, 53, 50, 49, 64, 65, 68, 73, 80, 89, 74, 65, 58, 45, 52, 61
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

See also: A163530, A163547.

Formula

a(n) = A000290(A163528(n)) + A000290(A163529(n)).

Extensions

Name corrected by Kevin Ryde, Aug 28 2020

A191681 a(n) = (9^n - 1)/2.

Original entry on oeis.org

0, 4, 40, 364, 3280, 29524, 265720, 2391484, 21523360, 193710244, 1743392200, 15690529804, 141214768240, 1270932914164, 11438396227480, 102945566047324, 926510094425920, 8338590849833284, 75047317648499560, 675425858836496044
Offset: 0

Views

Author

Adi Dani, Jun 11 2011

Keywords

Comments

Number of compositions of odd numbers into n parts < 9.
These are also the junctions of the Collatz trajectories of 2^(2k-1)-1 and 2^2k-1. - David Rabahy, Nov 01 2017
a(n) gives the number of turns in the n-th iteration of the Peano curve given by plotting (A163528, A163529) or by (Siromoney 1982). - Jason V. Morgan, Oct 08 2021

Examples

			a(2)=40: there are 40 compositions of odd numbers into 2 parts < 9:
1:  (0,1),(1,0);
3:  (0,3),(3,0),(1,2),(2,1);
5:  (0,5),(5,0),(1,4),(4,1),(2,3),(3,2);
7:  (0,7),(7,0),(1,6),(6,1),(2,5),(5,2),(3,4),(4,3);
9:  (1,8),(8,1),(2,7),(7,2),(3,6),(6,3),(4,5),(5,4);
11: (3,8),(8,3),(4,7),(7,4),(5,6),(6,5);
13: (5,8),(8,5),(6,7),(7,6);
15: (7,8),(8,7).
		

Crossrefs

Programs

Formula

a(0)=0, a(1)=4, a(n) = 10*a(n-1) - 9*a(n-2). - Harvey P. Dale, Jun 19 2011
G.f.: 4*x / ((x-1)*(9*x-1)). - Colin Barker, May 16 2013
a(n) = 2 * A125857(n+1) = 4 * A002452(n). - Bernard Schott, Oct 29 2021

Extensions

Example corrected by L. Edson Jeffery, Feb 13 2015

A163533 The change in Y-coordinate when moving from the n-1:th to the n-th point in the Peano curve A163334.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

These are the first differences of A163529. See also: A163532, A163534, A163536.

Formula

a(0)=0, a(n) = A163529(n) - A163529(n-1).

Extensions

Name corrected by Kevin Ryde, Aug 29 2020
Showing 1-10 of 13 results. Next