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

A232751 Permutation of natural numbers obtained by entangling even and odd numbers with Hofstadter's complementary pair A005228 & A030124; inverse permutation to A232752.

Original entry on oeis.org

0, 1, 3, 2, 7, 5, 15, 6, 11, 31, 13, 23, 4, 63, 27, 47, 9, 127, 14, 55, 95, 19, 255, 29, 111, 191, 10, 39, 511, 59, 223, 383, 21, 79, 1023, 30, 119, 447, 767, 43, 159, 2047, 61, 239, 895, 12, 1535, 87, 319, 4095, 123, 479, 1791, 25, 3071, 175, 22, 639, 8191
Offset: 0

Views

Author

Antti Karttunen, Nov 30 2013

Keywords

Comments

The permutation A135141 was obtained in analogous way by entangling even and odd numbers with primes and composites.
Note how all even numbers occur in positions given by A005228 from its second term 3 onward: 3, 7, 12, 18, 26, 35, 45, ... .
Note how all odd numbers occur in positions given by A030124: 2, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, ... .
See also the comments in A232752.
Interesting observation: For all numbers of form (2^n)-1, from 7 onward, the next term in the sequence which has that (2^n)-1 as its proper prefix (in decimal notation), appears to be 10*((2^n)-1)+9. For example, a(4)=7 and a(33)=79 is the first term of more than one decimal digits beginning with 7. For the higher values of A000225, we have examples of a(6)=15 & a(40)=159, a(9)=31 & a(48)=319, a(13)=63 & a(57)=639, a(17)=127 & a(66)=1279, a(22)=255 & a(76)=2559, a(28)=511 & a(87)=5119, a(34)=1023 & a(99)=10239, a(41)=2047 & a(111)=20479, a(49)=4095 & a(124)=40959, a(58)=8191 & a(138)=81919, a(67)=16383 & a(153)=163839, a(77)=32767 & a(168)=327679, a(88)=65535 & a(184)=655359.
So while each A000225(n) occurs at positions given by sequence 1, 2, 4, 6, 9, 13, 17, 22, 28, 34, 41, 49, 58, 67, 77, 88, 100, 112, 125, 139, 154, 169, 185, 202, 220, 239, 258, 278, 299, 321, 344, 367, ... (which from 2 onward are A232739, the iterates of A030124, cf. comment at A232752), each (10*A000225(n))+9 occurs at positions given by sequence 21, 27, 33, 40, 48, 57, 66, 76, 87, 99, 111, 124, 138, 153, 168, 184, 201, 219, 238, 257, 277, 298, 320, 343, 366, 390, 415, 441, 468, 496, 524, 553, ... Note how these seem to be one less than the previous sequence shifted 7 steps left.

Crossrefs

Inverse permutation: A232752.
Cf. also the permutation pair A167151 & A225850.

Formula

a(0)=0, a(1)=1; for n > 1, when A232747(n)>0 (when n is in A005228), a(n) = 2*a(A232747(n)-1), otherwise (when n is in A030124) a(n) = (2*a(A232749(n))) + 1.
For all n >= 1, a(A232739(n)) = A000225(n+1).

A225850 Inverse of permutation in A167151.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 5, 10, 12, 14, 16, 7, 18, 20, 22, 24, 26, 9, 28, 30, 32, 34, 36, 38, 40, 11, 42, 44, 46, 48, 50, 52, 54, 56, 13, 58, 60, 62, 64, 66, 68, 70, 72, 74, 15, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 17, 96, 98, 100, 102, 104, 106, 108, 110, 112
Offset: 0

Views

Author

Reinhard Zumkeller, May 17 2013

Keywords

Comments

For n > 0: a(A005228(n)) = 2*n-1 and a(A030124(n)) = 2*n.
For n > 0: A232739(n) = a(A232739(n+1))/2. - Antti Karttunen, Dec 04 2013

Crossrefs

Inverse permutation: A167151.
Cf. also A005228, A030124, A232739, A232746, A232747, A232749, and also the permutation pair A232751/A232752.

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a225850 = fromJust . (`elemIndex` a167151_list)
    
  • Mathematica
    nmax = 100; A5228 = {1};
    Module[{d = 2, k = 1}, Do[While[MemberQ[A5228, d], d++]; k += d; d++; AppendTo[A5228, k], {n, 1, nmax}]];
    a46[n_] := For[k = 1, True, k++, If[A5228[[k]] > n, Return[k - 1]]];
    a47[n_] := If[n == 1, 1, a46[n] (a46[n] - a46[n - 1])];
    a48[n_] := a48[n] = If[n == 1, 0, a48[n-1] + (1 - (a46[n] - a46[n-1]))];
    a49[n_] := If[n == 1, 0, a48[n] (a48[n] - a48[n - 1])];
    a[n_] := If[n < 3, n, 2 (a47[n] + a49[n]) - (a46[n] - a46[n - 1])];
    Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Dec 09 2021 *)
  • Scheme
    (define (A225850 n) (if (< n 3) n (- (* 2 (+ (A232747 n) (A232749 n))) (- (A232746 n) (A232746 (- n 1))))))
    ;; Antti Karttunen, Dec 04 2013

Formula

If n < 3, a(n) = n, otherwise a(n) = (2*(A232747(n)+A232749(n))) - (A232746(n)-A232746(n-1)). - Antti Karttunen, Dec 04 2013

A232747 Inverse function to Hofstadter's A005228.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 30 2013

Keywords

Comments

This is an inverse function to Hofstadter's A005228 in the sense that for all n, n = a(A005228(n)). a(n) = 0 when n is not in A005228, but instead in its complement A030124.
Note that a(n)*A232749(n) = 0 for all n.
Used to compute the permutation A232751.

Crossrefs

A030124 gives the positions of zeros.

Programs

  • Mathematica
    nmax = 100; A5228 = {1}; Module[{d = 2, k = 1}, Do[While[MemberQ[A5228, d], d++]; k += d; d++; AppendTo[A5228, k], {n, 1, nmax}]];
    a46[n_] := For[k = 1, True, k++, If[A5228[[k]] > n, Return[k - 1]]];
    a[n_] := If[n == 1, 1, a46[n] (a46[n] - a46[n - 1])];
    Array[a, nmax] (* Jean-François Alcover, Dec 09 2021 *)

Formula

a(1)=1, and for n>1, a(n) = A232746(n) * (A232746(n)-A232746(n-1)).

A232748 Partial sums of the characteristic function of Hofstadter's A030124.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 30 2013

Keywords

Comments

Useful for computing A232749.

Crossrefs

Programs

  • Mathematica
    nmax = 100; A5228 = {1}; Module[{d = 2, k = 1}, Do[While[MemberQ[A5228, d], d++]; k += d; d++; AppendTo[A5228, k], {n, 1, nmax}]];
    a46[n_] := For[k = 1, True, k++, If[A5228[[k]] > n, Return[k-1]]];
    a[n_] := a[n] = If[n == 1, 0, a[n-1] + (1 - (a46[n] - a46[n-1]))];
    Array[a, nmax] (* Jean-François Alcover, Dec 09 2021 *)

Formula

a(1)=0, and for n>1, a(n) = A232748(n-1) + (1-(A232746(n)-A232746(n-1))).
Showing 1-4 of 4 results.