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

A165406 Sequence A165404 shown in binary, or equivalently, sequence A163901 in quaternary base.

Original entry on oeis.org

0, 1, 100, 110, 111, 10000, 10010, 10011, 11000, 11001, 11100, 11110, 11111, 1000000, 1000010, 1000011, 1001000, 1001001, 1001100, 1001110, 1001111, 1100000, 1100001, 1100100, 1100110, 1100111, 1110000, 1110010, 1110011
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Crossrefs

a(n) = A007088(A165404(n)) = A007090(A163901(n)). For n>0, A147600(n-1) seems to give the number of terms with n binary digits.

A163355 Permutation of integers for constructing Hilbert curve in N x N grid.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Crossrefs

Inverse: A163356. A163357 & A163359 give two variants of Hilbert curve in N x N grid. Cf. also A163332.
Second and third "powers": A163905, A163915.
In range [A000302(n-1)..A024036(n)] of this permutation, the number of cycles is given by A163910, number of fixed points seems to be given by A147600(n-1) (fixed points themselves: A163901). Max. cycle sizes is given by A163911 and LCM's of all cycle sizes by A163912.

Programs

  • Maple
    A057300 := proc(n)
        option remember;
        `if`(n=0, 0, procname(iquo(n, 4, 'r'))*4+[0, 2, 1, 3][r+1])
    end proc:
    A163355 := proc(n)
        option remember ;
        local d,base4,i,r ;
        if n <= 1 then
            return n ;
        end if;
        base4 := convert(n,base,4) ;
        d := op(-1,base4) ;
        i := nops(base4)-1 ;
        r := n-d*4^i ;
        if ( d=1 and type(i,even) ) or ( d=2 and type(i,odd)) then
            4^i+procname(A057300(r)) ;
        elif d= 3 then
            2*4^i+procname(A057300(r)) ;
        else
            3*4^i+procname(4^i-1-r) ;
        end if;
    end proc:
    seq(A163355(n),n=0..100) ; # R. J. Mathar, Nov 22 2023
  • PARI
    A057300(n) = { my(t=1, s=0); while(n>0,  if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); };
    A163355(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); if(((1==d)&&!(i%2))||((2==d)&&(i%2)), f+A163355(A057300(r)), if(3==d,f+f+A163355(A057300(r)), (3*f)+A163355(f-1-r)))); \\ Antti Karttunen, Apr 14 2018

Formula

a(0) = 0, and given d=1, 2 or 3, then a((d*(4^i))+r)
= (4^i) + a(A057300(r)), if d=1 and i is even, or if d=2 and i is odd
= 2*(4^i) + a(A057300(r)), if d=3,
= 3*(4^i) + a((4^i)-1-r) in other cases.
From Alan Michael Gómez Calderón, May 06 2025: (Start)
a(3*A000695(n)) = 2*A000695(n);
a(3*(A000695(n) + 2^A000695(2*m))) = 2*(A000695(n) + 2^A000695(2*m)) for m >= 2;
a((2 + 16^n)*2^(-1 + 4*m)) = 4^(2*(n + m) - 1) + (11*16^m - 2)/3. (End)

Extensions

Links to further derived sequences added by Antti Karttunen, Sep 21 2009

A163356 Inverse permutation to A163355, related to Hilbert's curve in N x N grid.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Crossrefs

Inverse: A163355.
Second and third "powers": A163906, A163916. See also A059252-A059253.
In range [A000302(n-1)..A024036(n)] of this permutation, the number of cycles is given by A163910, number of fixed points seems to be given by A147600(n-1) (fixed points themselves: A163901). Max. cycle sizes is given by A163911 and LCM's of all cycle sizes by A163912.
Cf. also A302844, A302846, A302781.

Programs

  • PARI
    A057300(n) = { my(t=1,s=0); while(n>0, if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); };
    A163356(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); (((((2+(i%2))^d)%5)-1)*f) + if(3==d,f-1-A163356(r),A057300(A163356(r)))); \\ Antti Karttunen, Apr 14 2018

Formula

a(0) = 0, and provided that d=1, 2 or 3, then a((d*(4^i))+r) = (((2+(i mod 2))^d mod 5)-1) * [either A024036(i) - a(r), if d is 3, and A057300(a(r)) in other cases].
From Antti Karttunen, Apr 14 2018: (Start)
A059905(a(n)) = A059253(n).
A059906(a(n)) = A059252(n).
a(n) = A000695(A059253(n)) + 2*A000695(A059252(n)).
(End)

Extensions

Links to further derived sequences and a nicer Scheme function & formula added by Antti Karttunen, Sep 21 2009

A163900 Squared distance between n's location in A054238 array and A163357 array.

Original entry on oeis.org

0, 0, 1, 1, 8, 18, 5, 5, 4, 2, 9, 5, 2, 2, 9, 9, 0, 2, 1, 1, 0, 0, 1, 1, 4, 4, 9, 1, 2, 4, 5, 9, 16, 10, 25, 17, 16, 16, 25, 9, 36, 36, 49, 25, 10, 4, 5, 1, 10, 18, 5, 5, 10, 16, 17, 25, 10, 20, 25, 29, 36, 36, 25, 49, 128, 162, 113, 113, 128, 128, 113, 145, 100, 100, 89, 113, 162
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Crossrefs

Positions of zeros: A163901. See also A163898, A163899.

Formula

a(n) = A000290(abs(A059906(n)-A059252(n))) + A000290(abs(A059905(n)-A059253(n))).

A165465 Positions of zeros in A165464. Fixed points of A166041/A166042.

Original entry on oeis.org

0, 1, 7, 8, 15, 16, 22, 23, 24, 25, 1702855, 1702856, 1702857, 1702872, 1702873, 2220150, 3327583, 3329174, 3329270, 3329271, 3329279
Offset: 0

Views

Author

Antti Karttunen, Oct 06 2009

Keywords

Comments

Consider two immortal sage kings traveling on the infinite chessboard, visiting every square at the leisurely pace of one square per day. Both start their journey at the beginning of the year from the upper left-hand corner square at the day zero (being sages, they can comfortably stay in the same square without bloodshed). One decides to follow the Hilbert curve on his never-ending journey, while the other follows the Peano curve. (These are both illustrated in the entry A166041.) This sequence gives the days when they will meet, when they both come to the same square on the same day.
Both walk first one square towards east, where they meet at Day 1. Then one turns south, while the other one proceeds to the east. However, just six days later, on Day 7, they meet again, at the square (2,1), two squares south and one square east of the starting corner. They also meet the next day (Day 8), as well as another week later (Day 15), and before January is over, they meet still five more times, on Days 16, 22, 23, 24 and 25. However, it takes 4662 years and about three months before they meet again, on three successive days (Days 1702855, 1702856 and 1702857). - Antti Karttunen, Oct 13 2009 [Edited to Hilbert vs Peano by Kevin Ryde, Aug 30 2020]
Subset of A165480. - Antti Karttunen, Oct 13 2009

Crossrefs

A165467 Positions of zeros in A165466. Fixed points of A166043/A166044.

Original entry on oeis.org

0, 8, 9, 105, 1126, 6643718, 6643719, 6643727, 6643728, 6643729, 6643735, 6643736, 6643743, 6643744, 6643745, 6643752, 7746856, 7746857, 7746886, 7746887, 7746888, 7746889, 7747606, 7747718, 7747719, 7747720, 7747737
Offset: 0

Views

Author

Antti Karttunen, Oct 06 2009

Keywords

Comments

Here is a little parable for illustrating the magnitudes of the numbers involved. Consider two immortal sage kings traveling on the infinite chessboard, visiting every square at a leisurely pace of one square per day. Both start their journey at the beginning of the year from the upper left-hand corner square at Day 0 (being sages, they can comfortably stay in the same square). One decides to follow the Hilbert curve (as in A163357) on his never-ending journey, while the other follows the Peano curve (as in A163336; both walks are illustrated in entry A166043). This sequence gives the days when they will meet, when they both arrive at the same square on the same day.
From the corner, one king walks first towards the east, while the other walks towards the south, so their paths diverge at the beginning. However, about a week later (Day 8), they meet again on square (2,2), two squares south and two squares east of the starting corner. The next day they are both traveling towards the south, so they meet also on Day 9, at square (3,2). After that, they meet briefly three months later (Day 105), and also about three years later (Day 1126), after which they loathe each other so much that they both walk in solitude for the next 18189 (eighteen thousand one hundred and eighty nine) years before they meet again, total of eleven times in just about one month's time (days 6643718-6643752). - Antti Karttunen, Oct 13 2009 [Edited to Hilbert vs Peano by Kevin Ryde, Aug 29 2020]

Crossrefs

Subset of A165480. Cf. also A165465, A163901.

A163903 The positions i where A163915(i) = i, but not A163355(i) = i, that is, the 3-cycles of permutation A163355.

Original entry on oeis.org

5, 6, 10, 11, 13, 15, 17, 18, 19, 80, 81, 85, 86, 90, 91, 93, 95, 105, 106, 160, 161, 165, 166, 170, 171, 173, 175, 190, 191, 213, 215, 240, 241, 245, 246, 250, 251, 253, 255, 257, 258, 259, 276, 277, 278, 279, 282, 296, 297, 298, 299, 303, 309, 316, 317, 318
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Crossrefs

A165404 The positions of zeros in the top row of A163898 (and A163899).

Original entry on oeis.org

0, 1, 4, 6, 7, 16, 18, 19, 24, 25, 28, 30, 31, 64, 66, 67, 72, 73, 76, 78, 79, 96, 97, 100, 102, 103, 112, 114, 115, 120, 121, 124, 126, 127, 256, 258, 259, 264, 265, 268, 270, 271, 288, 289, 292, 294, 295, 304, 306, 307, 312, 313, 316, 318, 319, 384, 385, 388
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Comments

Equivalently, the positions of ones in the top row of A163904.

Crossrefs

a(n) = A025581(A165403(n)). Same sequence in binary: A165406. For n>0, A147600(n-1) seems to give the number of terms with binary width n. See also A163901.

A163902 The positions i where A163905(i) = i, but not A163355(i) = i, that is, the 2-cycles of permutation A163355.

Original entry on oeis.org

2, 3, 22, 23, 25, 26, 29, 31, 37, 38, 40, 41, 42, 43, 53, 55, 60, 61, 62, 63, 262, 263, 265, 266, 269, 271, 322, 323, 342, 343, 345, 346, 349, 351, 357, 358, 360, 361, 362, 363, 373, 375, 380, 381, 382, 383, 405, 406, 408, 409, 410, 411, 416, 420, 421, 422
Offset: 0

Views

Author

Antti Karttunen, Sep 19 2009

Keywords

Crossrefs

See also A163901, A163903, A163910.
Showing 1-9 of 9 results.