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

%I #9 Jul 01 2022 12:19:29

%S 18,10,5,17,25,80,97,145,386,3060,997,1681,4194,6544,1508,8450,9721,

%T 22178,10728,5185,16130,154730,58441,31681,52418,401506,176837,101377,

%U 105601,678386,241913,501748,393850,284036,685576,1437389,1751333,3225616,3439297,2479634

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

%F a(n) = A355237(n) + n.

%o (Python)

%o from itertools import count

%o from sympy import factorint

%o def A355238(n):

%o m = 2

%o for k in count(2):

%o c = False

%o for p in (f:=factorint(k)):

%o if (q:= p & 3)==3 and f[p]&1:

%o break

%o elif q == 1:

%o c = True

%o else:

%o if c or f.get(2,0)&1:

%o if k-m == n:

%o return k

%o m = k # _Chai Wah Wu_, Jul 01 2022

%Y Cf. A000404, A355237.

%K nonn

%O 1,1

%A _Hugo Pfoertner_, Jun 30 2022