Discover Snippets

@kimee kimee / prime_square_sieve.c Created at Sun Aug 21 14:24:07 EDT 2022
A prime sieve and a prime-factorizer to find primes who's squares have only the prime as factors. Turns out its all of them.
#include <stddef.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>

bool bit_read(uint64_t const* const buf, size_t const idx)
{
size_t const offset = idx >> 6; // log2(64)