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.

A355237 First occurrence of difference n between two consecutive terms of A000404. a(n) gives the lower term. The upper term is A355238.

This page as a plain text file.
%I A355237 #15 Sep 09 2022 08:04:58
%S A355237 17,8,2,13,20,74,90,137,377,3050,986,1669,4181,6530,1493,8434,9704,
%T A355237 22160,10709,5165,16109,154708,58418,31657,52393,401480,176810,101349,
%U A355237 105572,678356,241882,501716,393817,284002,685541,1437353,1751296,3225578,3439258,2479594
%N A355237 First occurrence of difference n between two consecutive terms of A000404. a(n) gives the lower term. The upper term is A355238.
%F A355237 a(n) = A355238(n) - n.
%o A355237 (Python)
%o A355237 from itertools import count
%o A355237 from sympy import factorint
%o A355237 def A355237(n):
%o A355237     m = 2
%o A355237     for k in count(2):
%o A355237         c = False
%o A355237         for p in (f:=factorint(k)):
%o A355237             if (q:= p & 3)==3 and f[p]&1:
%o A355237                 break
%o A355237             elif q == 1:
%o A355237                 c = True
%o A355237         else:
%o A355237             if c or f.get(2,0)&1:
%o A355237                 if k-m == n:
%o A355237                     return m
%o A355237                 m = k # _Chai Wah Wu_, Jul 01 2022
%Y A355237 Cf. A000404, A104271, A355238.
%K A355237 nonn
%O A355237 1,1
%A A355237 _Hugo Pfoertner_, Jun 30 2022