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.
%I A237053 #17 Sep 04 2025 10:52:34 %S A237053 2,1,0,0,3,0,1,0,1,1,3,0,3,0,1,1,3,0,1,0,1,1,3,0,4,3,1,5,3,0,1,0,3,1, %T A237053 3,1,1,0,3,1,3,0,3,0,1,3,4,0,1,3,1,1,3,0,1,3,1,5,3,0,5,0,3,1,3,1,4,0, %U A237053 1,1,6,0,4,0,1,1,3,3,1,0,3,1,3,0,3,3,1,5,3,0,1,3,3,3,3,1,1 %N A237053 Smallest number k such that some subset of n+1..n+k can be summed and added to n to produce a prime. %C A237053 a(n) = 0 iff n is prime. %C A237053 a(n) = 2 only for n=0; the only possible sums for k=2 are n+(n+2) = 2n+2, divisible by 2, and n+(n+1)+(n+2) = 3n+3, divisible by 3. %C A237053 There are infinitely many 1's in the sequence; if p > 5 is a prime == 1 (mod 4), a((p-1)/2) = 1. %C A237053 Conjecture: every nonnegative integer except 2 occurs infinitely often in the sequence. %H A237053 Alois P. Heinz, <a href="/A237053/b237053.txt">Table of n, a(n) for n = 0..100000</a> %e A237053 If n is prime, sum({n}) is prime, so we can take k = 0, whence n+1..n+0 is empty, so a(n) = 0. %e A237053 6 is not prime, but 6+7 = 13 is prime, so a(6) = 1. %e A237053 4 is not prime, and 4+5 is not prime, but 4+7 = 11 and 4+6+7 = 17 are prime; either of these suffices to make a(4) = 3. %p A237053 b:= (n, i, t)-> isprime(n) or t>0 and %p A237053 (b(n, i+1, t-1) or b(n+i, i+1, t-1)): %p A237053 a:= proc(n) local k; %p A237053 for k from 0 while not b(n, n+1, k) do od; k %p A237053 end: %p A237053 seq(a(n), n=0..100); # _Alois P. Heinz_, Feb 07 2014 %t A237053 b[n_, i_, t_] := PrimeQ[n] || t > 0 && (b[n, i+1, t-1] || b[n+i, i+1, t-1]); %t A237053 a[n_] := Module[{k}, For[k = 0, !b[n, n+1, k], k++]; k]; %t A237053 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Sep 04 2025, after _Alois P. Heinz_ *) %Y A237053 Cf. A000040, A005097, A104636, A077654, A089306. %K A237053 nonn,changed %O A237053 0,1 %A A237053 _Franklin T. Adams-Watters_, Feb 03 2014