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 A351318 #23 Jun 02 2025 15:25:04 %S A351318 3,7,13,31,47,47,53,53,73,137,103,131,109,137,239,257,229,349,257,269, %T A351318 331,347,389,409,257,389,251,229,499,487,509,491,541,487,353,739,571, %U A351318 743,727,307,883,743,929,827,971,911,887,569,1063,751,1013,883,1451,977,1259,853,983,947,967,1049 %N A351318 a(n) is the least prime prime(k), k > n, such that A036689(k) or A036690(k) is s(n) + s(n+1) + ... + s(j), j < k, where each s(i) is either A036689(i) or A036690(i). %C A351318 a(n) is the least prime p such that p*(p-1) or p*(p+1) is the sum of a sequence where each term is either prime(i)*(prime(i)-1) or prime(i)*(prime(i)+1), for i from n to some j. %H A351318 Robert Israel, <a href="/A351318/b351318.txt">Table of n, a(n) for n = 1..2400</a> %e A351318 a(3) = 13 because prime(3) = 5, the next two primes are 7 and 11, and 5*6 + 7*6 + 11*10 = 182 = 13*14. %p A351318 P:= select(isprime, [2,seq(i,i=3..10^6,2)]): %p A351318 R:= convert(map(p -> (p*(p-1),p*(p+1)),P),set): %p A351318 f:= proc(n) local S,T,SR,i,s; %p A351318 S:= {P[n]*(P[n]-1),P[n]*(P[n]+1)}; %p A351318 for i from n+1 do %p A351318 T:= [P[i]*(P[i]-1),P[i]*(P[i]+1)]; %p A351318 S:= map(s -> (s+T[1],s+T[2]),S); %p A351318 SR:= S intersect R; %p A351318 if SR <> {} then %p A351318 s:= (sqrt(1+4*min(SR))-1)/2; %p A351318 if isprime(s) then return s else return s+1 fi %p A351318 fi %p A351318 od %p A351318 end proc: %p A351318 map(f, [$1..100]); %Y A351318 Cf. A036889, A036890. %K A351318 nonn %O A351318 1,1 %A A351318 _J. M. Bergot_ and _Robert Israel_, Mar 18 2022