login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A355238
First occurrence of difference n between two consecutive terms of A000404. a(n) gives the upper term. The lower term is A355237.
3
18, 10, 5, 17, 25, 80, 97, 145, 386, 3060, 997, 1681, 4194, 6544, 1508, 8450, 9721, 22178, 10728, 5185, 16130, 154730, 58441, 31681, 52418, 401506, 176837, 101377, 105601, 678386, 241913, 501748, 393850, 284036, 685576, 1437389, 1751333, 3225616, 3439297, 2479634
OFFSET
1,1
FORMULA
a(n) = A355237(n) + n.
PROG
(Python)
from itertools import count
from sympy import factorint
def A355238(n):
m = 2
for k in count(2):
c = False
for p in (f:=factorint(k)):
if (q:= p & 3)==3 and f[p]&1:
break
elif q == 1:
c = True
else:
if c or f.get(2, 0)&1:
if k-m == n:
return k
m = k # Chai Wah Wu, Jul 01 2022
CROSSREFS
Sequence in context: A089517 A290345 A035616 * A244093 A195926 A195929
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Jun 30 2022
STATUS
approved