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.

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

This page as a plain text file.
%I A355238 #9 Jul 01 2022 12:19:29
%S A355238 18,10,5,17,25,80,97,145,386,3060,997,1681,4194,6544,1508,8450,9721,
%T A355238 22178,10728,5185,16130,154730,58441,31681,52418,401506,176837,101377,
%U A355238 105601,678386,241913,501748,393850,284036,685576,1437389,1751333,3225616,3439297,2479634
%N A355238 First occurrence of difference n between two consecutive terms of A000404. a(n) gives the upper term. The lower term is A355237.
%F A355238 a(n) = A355237(n) + n.
%o A355238 (Python)
%o A355238 from itertools import count
%o A355238 from sympy import factorint
%o A355238 def A355238(n):
%o A355238     m = 2
%o A355238     for k in count(2):
%o A355238         c = False
%o A355238         for p in (f:=factorint(k)):
%o A355238             if (q:= p & 3)==3 and f[p]&1:
%o A355238                 break
%o A355238             elif q == 1:
%o A355238                 c = True
%o A355238         else:
%o A355238             if c or f.get(2,0)&1:
%o A355238                 if k-m == n:
%o A355238                     return k
%o A355238                 m = k # _Chai Wah Wu_, Jul 01 2022
%Y A355238 Cf. A000404, A355237.
%K A355238 nonn
%O A355238 1,1
%A A355238 _Hugo Pfoertner_, Jun 30 2022