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.

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)).