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.

A356272 a(n) is the least k such that exactly n consecutive integers starting from k belong to A124665.

This page as a plain text file.
%I A356272 #17 Aug 03 2022 02:38:30
%S A356272 20,134,1934,9773,19042,138902,104024,512255,1400180,1558490,1441174,
%T A356272 9363253,20454244,98854550,57515874,201139683,49085531,213492618,
%U A356272 475478220,1152519092
%N A356272 a(n) is the least k such that exactly n consecutive integers starting from k belong to A124665.
%e A356272 20 is in A124665, while 19 and 21 are not. This is the 1st such integer so a(1) = 20.
%e A356272 134 and 135 are in A124665, while 133 and 136 are not. This is the 1st such integer so a(2) = 134.
%o A356272 (PARI) is(n)=my(N=10*n, D=10^#Str(n)); forstep(k=n, n+9*D, D, if(isprime(k), return(0))); !(isprime(N+1)||isprime(N+3)||isprime(N+7)||isprime(N+9)); \\ A124665
%o A356272 isok(k, n) = if (!is(k-1), for (i=0, n-1, if (!is(k+i), return (0));); !is(k+n););
%o A356272 a(n) = my(k=2); while (!isok(k, n), k++); k;
%o A356272 (Python)
%o A356272 from itertools import islice
%o A356272 from sympy import isprime
%o A356272 def ok(n):
%o A356272     s = str(n)
%o A356272     if any(isprime(int(s+c)) for c in "1379"): return False
%o A356272     return not any(isprime(int(c+s)) for c in "0123456789")
%o A356272 def agen():
%o A356272     adict = dict()
%o A356272     n = k = 1
%o A356272     while True:
%o A356272         c = 0
%o A356272         while ok(k): k += 1; c += 1
%o A356272         if c not in adict: adict[c] = k-c
%o A356272         while n in adict: yield adict[n]; n += 1
%o A356272         k += 1
%o A356272 print(list(islice(agen(), 6))) # _Michael S. Branicky_, Aug 01 2022
%Y A356272 Cf. A124665.
%K A356272 nonn,base,more
%O A356272 1,1
%A A356272 _Michel Marcus_, Aug 01 2022
%E A356272 a(14)-a(20) from _Michael S. Branicky_, Aug 02 2022