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.

Original entry on oeis.org

17, 8, 2, 13, 20, 74, 90, 137, 377, 3050, 986, 1669, 4181, 6530, 1493, 8434, 9704, 22160, 10709, 5165, 16109, 154708, 58418, 31657, 52393, 401480, 176810, 101349, 105572, 678356, 241882, 501716, 393817, 284002, 685541, 1437353, 1751296, 3225578, 3439258, 2479594
Offset: 1

Views

Author

Hugo Pfoertner, Jun 30 2022

Keywords

Crossrefs

Programs

  • Python
    from itertools import count
    from sympy import factorint
    def A355237(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 m
                    m = k # Chai Wah Wu, Jul 01 2022

Formula

a(n) = A355238(n) - n.