Skip to content

Instantly share code, notes, and snippets.

@FaffyWaffles
FaffyWaffles / gist:8dd5efc19ad4c7ae73f7d6de4f324f49
Created November 24, 2025 03:50
Robbins' Sharp Stepwise Bound for Stirling Sequence
/-
Copyright (c) 2024 Ashton Jenson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Ashton Jenson
-/
import Mathlib.Analysis.SpecialFunctions.Stirling
/-!
# Robbins' Sharp Stepwise Bound for Stirling Sequence
@FaffyWaffles
FaffyWaffles / RobinsStirlingBound.lean
Created October 30, 2025 14:11
This file proves the sharp Robbins bound for successive differences in the logarithm of the Stirling sequence: |log(stirlingSeq(k+1)) - log(stirlingSeq(k))| ≤ 1/(12*k*(k+1))
import Mathlib
open scoped BigOperators
open Filter
open scoped Nat
namespace Real
/-
============================================================
@FaffyWaffles
FaffyWaffles / MovablePoints.cs
Created October 25, 2022 08:15
Moveable Point Cloud
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Sirenix.OdinInspector;
public class MovablePoints : MonoBehaviour
{
public List<Vector2> points = new List<Vector2>();
public List<int> moveablePoints = new List<int>();
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
using Sirenix.OdinInspector;
@FaffyWaffles
FaffyWaffles / UnionPolygonController.cs
Last active June 9, 2022 06:08
Polygon Union Algorithm V1
public class UnionPolygonController : SerializedMonoBehaviour
{
public static List<List<Vector2>> UnionPolygon(List<List<Vector2>> uvPolygons)
{
List<List<Vector2>> newPolygons = new List<List<Vector2>>();
#region Fix Winding Order
for (int i = 0; i < uvPolygons.Count; i++)
{
float sum = new float();
@FaffyWaffles
FaffyWaffles / GizmoBehavior.cs
Last active May 10, 2022 12:15
GizmoScripts
using System;
using System.Linq;
using System.Collections;
using UnityEngine;
using Sirenix.OdinInspector;
public class GizmoBehavior : MonoBehaviour
{
public GameObject target;
@FaffyWaffles
FaffyWaffles / DistinctRandomColors.cs
Last active June 1, 2022 19:32
Unity script to create n number of evenly distributed random colors.
using System.Collections.Generic;
using UnityEngine;
public class DistinctRandomColors : MonoBehaviour
{
public Color[] colors;
void RandomColors(int colorCount, out Color[] colors)
{
colors = new Color[colorCount];