A338052 a(n) = A337645(n-1) - n.
Keywords
Links
- N. J. A. Sloane, Table of n, a(n) for n = 2..20001
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.
= 1. If q=2 then a(n) is even. So we may suppose q is odd. If x is odd then a(n+1) = 2*p. If x is even then obviously a(n-1) is even. So one of a(n-1), a(n), or a(n+1) is even for every prime p. So there are infinitely many even terms. QED - N. J. A. Sloane, Aug 28 2020
A337648), that there are precisely 34 instances when q = 3 (see A337649), and q>3 happens just once, at a(5) = 35 when q=5 and p=7.
with(numtheory); N:= 10^4: # to get a(1) to a(n) where a(n+1) is the first term > N B:= Vector(N, datatype=integer[4]): for n from 1 to 2 do A[n]:= n: od: for n from 3 do for k from 3 to N do if B[k] = 0 and igcd(k, A[n-1]) > 1 and igcd(k, A[n-2]) = 1 then if nops(factorset(k) minus factorset(A[n-1])) > 0 then A[n]:= k; B[k]:= 1; break; fi; fi od: if k > N then break; fi; od: s1:=[seq(A[i], i=1..n-1)]; # N. J. A. Sloane, Sep 24 2020, based on Theorem 1 and Robert Israel's program for sequence A098550
M = 1000; A[1] = 1; A[2] = 2; Clear[B]; B[_] = 0; For[n = 3, True, n++, For[k = 3, k <= M, k++, If[B[k] == 0 && GCD[k, A[n-1]] > 1 && GCD[k, A[n-2]] == 1, If[Length[ FactorInteger[k][[All, 1]] ~Complement~ FactorInteger[A[n-1]][[All, 1]]] > 0, A[n] = k; B[k] = 1; Break[]]]]; If[k > M, Break[]]]; Array[A, n-1] (* Jean-François Alcover, Oct 20 2020, after Maple *)
from math import gcd from sympy import factorint from itertools import count, islice def agen(): # generator of terms a, seen, minan = [1, 2], {1, 2}, 3 yield from a for n in count(3): an, fset = minan, set(factorint(a[-1])) while True: if an not in seen and gcd(an, a[-1])>1 and gcd(an, a[-2])==1: if set(factorint(an)) - fset > set(): break an += 1 a.append(an); seen.add(an); yield an while minan in seen: minan += 1 print(list(islice(agen(), 70))) # Michael S. Branicky, Jan 22 2022
Comments