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.

A305992 The sequence whose indicator function is I in conjectured formula A300997(n) = 2*n - Sum_{k=1..n} I(k), as long as the conjecture holds.

This page as a plain text file.
%I A305992 #8 Oct 09 2019 16:28:38
%S A305992 1,2,4,8,15,24,32,48,62,80,101,122,147,171,202,230,267,299,339,377,
%T A305992 418,464,509,559,611,664,719,776,836,896,960,1024,1098,1167,1240,1315,
%U A305992 1392,1471,1553,1642,1724,1816,1906,1999,2094,2190,2290,2392,2499,2599,2713,2818,2937,3048,3166,3288
%N A305992 The sequence whose indicator function is I in conjectured formula A300997(n) = 2*n - Sum_{k=1..n} I(k), as long as the conjecture holds.
%C A305992 A300997(n) is believed to be equal to 2*n - Sum_{k=1..n} I(k), where I is the indicator function of some other sequence -- let it be this sequence. This sequence is finite if the conjecture is false.
%H A305992 Wikipedia, <a href="https://en.wikipedia.org/wiki/Indicator_function">Indicator function</a>
%o A305992 (C)
%o A305992 #include <stdio.h>
%o A305992 #include <string.h>
%o A305992 #define N 10000
%o A305992 void e(int *t, int *s) {
%o A305992   int T[N], i = 0; memset(T, 0, sizeof(T));
%o A305992   while (i < *s) {
%o A305992     int f = t[i] / 2;
%o A305992     T[i] += f + (t[i] % 2);
%o A305992     T[++ i] += f;
%o A305992   }
%o A305992   if (T[*s] != 0) { *s += 1; }
%o A305992   for (i = 0; i < *s; i ++) { t[i] = T[i]; }
%o A305992 }
%o A305992 int f(int n) {
%o A305992   int t[N], s = 1, i = 0; t[0] = n;
%o A305992   while (s != n) { i ++; e(t, &s); }
%o A305992   return 2 * n - i;
%o A305992 }
%o A305992 int main() {
%o A305992   int n, last = 1, current;
%o A305992   for (n = 1; n <= N; n ++) {
%o A305992     current = f(n);
%o A305992     switch (current - last) {
%o A305992     case 0: break;
%o A305992     case 1: printf("%d, ", n); fflush(stdout); break;
%o A305992     default: fprintf(stderr, "CONJECTURE IS FALSE"); return;
%o A305992     }
%o A305992     last = current;
%o A305992   }
%o A305992   printf("\n");
%o A305992 }
%Y A305992 Cf. A300997.
%K A305992 nonn
%O A305992 1,2
%A A305992 _Luc Rousseau_, Jun 16 2018