A355269 Lexicographically earliest infinite sequence of distinct positive integers such that a(n+1) is prime to the number of divisors of a(n).
1, 2, 3, 5, 7, 9, 4, 8, 11, 13, 15, 17, 19, 21, 23, 25, 10, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 14, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 6, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119
Offset: 1
Keywords
Examples
a(4)=5 because a(3)=3 has 2 divisors and 5 is the least unused term prime to 2. Likewise a(5) = 7, and a(6) = 9, the first odd square. Since 9 has 3 divisors a(7) is 4, the smallest unused number prime to 3, and the first occurrence of an even square, also having 3 divisors. Consequently a(8)=8, the smallest unused number prime to 3. Thus we see 4,8 the first occasion of a pair of adjacent even terms, consequence of odd square (9) followed by even square (4). The next occasion is a(67,68,69)=121,16,12.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Annotated log log scatterplot of a(n), n = 1..2^16, showing records in red and local minima in blue. Three prominent trajectories appear; that of odd and early terms mostly in red, that of terms divisible by 6 mostly in blue, and even numbers that are not divisible by 6 in green. (It may be that numbers divisible by 6 are not always minima; instead, numbers divisible by a larger primorial may be delayed to a greater degree than those merely divisible by 6 for large n.)
Programs
-
Mathematica
Block[{a, c, j, k, u, v, nn}, nn = 120; a[1] = c[1] = j = 1; u = 2; v = 3; Do[k = u; If[EvenQ[j], k = v; While[Nand[c[k] == 0, CoprimeQ[j, k]], k += 2], While[Nand[c[k] == 0, CoprimeQ[j, k]], k++]]; Set[{a[i], c[k]}, {k, i}]; j = DivisorSigma[0, k]; If[k == u, While[c[u] != 0, u++]]; If[k == v, While[c[v] != 0, v += 2]], {i, 2, nn}]; Array[a, nn] ] (* Michael De Vlieger, Jun 28 2022 *)
-
Python
from math import gcd from sympy import divisor_count from itertools import count, islice def agen(): # generator of terms aset, k, mink = {1, 2}, 1, 3; yield from [1, 2] for n in count(3): an, k = k, mink while k in aset or not gcd(divisor_count(an), k) == 1: k += 1 aset.add(k); yield k while mink in aset: mink += 1 print(list(islice(agen(), 66))) # Michael S. Branicky, Jun 28 2022
Comments