Skip to content

StarNumbers ​

The star numbers 1,13,37,73,…1, 13, 37, 73, … — 6n2−6n+16n^2-6n+1 — centered figurate numbers of a six-pointed star.

StarNumbers6n2−6n+16n^2-6n+1 for n=1,2,3,…n = 1, 2, 3, ….

Domain: Collections

Details
  • A lazy indexed collection: Count(StarNumbers)=+∞Count(StarNumbers) = +\infty, and At(StarNumbers,k)=6k2−6k+1At(StarNumbers, k) = 6k^2-6k+1 unranks in closed form -- At(StarNumbers,5)=121At(StarNumbers, 5) = 121.
  • OEIS A003154.
  • Membership goes through Element by inverting the closed form exactly -- Element(121,StarNumbers)Element(121, StarNumbers) is true, Element(120,StarNumbers)Element(120, StarNumbers) is false.
  • Every star number is both centered hexagonal and centered triangular in disguise (it is the centered figurate number of the {6/2}\{6/2\} hexagram).

Definition

Epsil, as the implementation runs it.

count()

PositiveInfinity

unrank(_r)

6 * (_r + 1) * (_r + 1 - 1) + 1

rank(_x)

Apply(
       (sq_at: integer) => sq_at if 6 * (sq_at + 1) * (sq_at + 1 - 1) + 1 == _x else -1,
       Fold(Function(
                      sq_at + 2 ^ sq_b if 6 * (sq_at + 2 ^ sq_b + 1) *
                                          (sq_at + 2 ^ sq_b + 1 - 1) + 1 <= _x else sq_at,
                      sq_at,
                      sq_b,
                    ), 0, Range(Floor(Log(_x, 2)) + 1, 0, -1)),
     ) if True else -1

valid(_x)

Apply(
       (sq_at: integer) => 6 * (sq_at + 1) * (sq_at + 1 - 1) + 1 == _x,
       Fold(Function(
                      sq_at + 2 ^ sq_b if 6 * (sq_at + 2 ^ sq_b + 1) *
                                          (sq_at + 2 ^ sq_b + 1 - 1) + 1 <= _x else sq_at,
                      sq_at,
                      sq_b,
                    ), 0, Range(Floor(Log(_x, 2)) + 1, 0, -1)),
     ) if True && _x >= 1 else False

Enumeration

Examples

1 more kept as data, checked against the oracles
About
Examples1
CrosswalkOEIS

See also: CenteredHexagonalNumbers, Count, At, Element