Nothing Special   »   [go: up one dir, main page]

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”).

A354154
a(1) = 0; for n>1, a(n) = prime(n-1) - A090252(n).
2
0, 0, 0, 0, 3, 4, 4, 6, 6, 6, 21, 12, 14, 16, 22, 18, 22, 22, 20, 24, 24, 20, 63, 24, 28, 30, 30, 30, 52, 30, 86, 78, 48, 48, 42, 48, 48, 50, 54, 54, 46, 48, 44, 52, 44, 46, 173, 54, 60, 60, 56, 54, 58, 50, 58, 60, 64, 58, 186, 156, 58, 56, 236, 78, 150, 80, 78, 90, 86, 90, 86, 84, 88, 90, 92, 96, 90, 82, 86, 88, 92, 88, 84, 84, 84, 86, 84, 82, 84
OFFSET
1,5
COMMENTS
Theorem: a(n) >= 0 for all n.
LINKS
EXAMPLE
A090252 begins
1, 2, 3, 5, 4, 7, 9, 11, 13, ...
and we subtract these numbers from
1, 2, 3, 5, 7, 11, 13, 17, 19, ...
to get
0, 0, 0, 0, 3, 4, 4, 6, 6, ...
PROG
(Python)
from math import gcd, prod
from sympy import isprime, nextprime
from itertools import count, islice
def agen(): # generator of terms
alst, aset, mink, p = [1], {1}, 2, 1
yield 0
for n in count(2):
k, s, p = mink, n - n//2, nextprime(p)
prodall = prod(alst[n-n//2-1:n-1])
while k in aset or gcd(prodall, k) != 1: k += 1
alst.append(k); aset.add(k); yield p - k
while mink in aset: mink += 1
print(list(islice(agen(), 89))) # Michael S. Branicky, May 28 2022
CROSSREFS
Cf. A090252.
Sequence in context: A255171 A323712 A215250 * A229022 A014683 A213222
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 28 2022
STATUS
approved