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.

A308987 In the sequence {n^2+1} (A002522), color the primes red. When the number of terms m between successive red terms sets a new record, write down m+1.

This page as a plain text file.
%I A308987 #19 Sep 27 2024 17:25:59
%S A308987 1,2,4,10,14,16,20,34,40,46,88,100,112,130,152,212,288,330,346,444,
%T A308987 502,526,534,564,580,614,624,634,636,640,690
%N A308987 In the sequence {n^2+1} (A002522), color the primes red. When the number of terms m between successive red terms sets a new record, write down m+1.
%C A308987 This sequence represents the highest gaps, given by number of terms (including the starting prime) in sequence A002522 between terms which are prime.
%e A308987 n=6   -->  6^2+1 = 37, prime
%e A308987 n=7   -->  7^2+1 = 50, composite
%e A308987 n=8   -->  8^2+1 = 65, composite
%e A308987 n=9   -->  9^2+1 = 82, composite
%e A308987 n=10  -->  10^2+1 = 101, prime
%e A308987 ...so here m=3 and we get the third term, m + 1 = 10 - 6 = 4
%t A308987 best = c = lastBestAt = 0;
%t A308987 For[i = 2, True, i += 2; c += 2,
%t A308987 If[PrimeQ[i^2 + 1],
%t A308987    If[c > best,
%t A308987     best = c;
%t A308987     bestAt = i - c;
%t A308987     If[bestAt != lastBestAt, Print[{c, bestAt}]];
%t A308987     lastBestAt = bestAt;
%t A308987     ];
%t A308987    c = 0;
%t A308987    ]
%t A308987 ]
%t A308987 Join[{1,2},Rest[DeleteDuplicates[Length/@SplitBy[(Range[5*10^7]^2+1),PrimeQ],GreaterEqual]+1]] (* The program generates the first 19 terms of the sequence. *)(* _Harvey P. Dale_, Sep 27 2024 *)
%Y A308987 Cf. A002496, A002522, A308988.
%Y A308987 A293564 gives essentially the same information.
%K A308987 nonn,more
%O A308987 1,2
%A A308987 _Trevor Cappallo_, Jul 04 2019
%E A308987 a(21)-a(31) from _Giovanni Resta_, Jul 05 2019