OFFSET
1,2
COMMENTS
As the sequence is infinite no term, except a(1), can be a power of 10.
The majority of terms are concentrated along a line with gradient ~1.14, see the attached image of the first 1 million terms. However also present are scalloped lines each of which is composed of multiples of a different prime - these initially start off lower than the line of concentration but many eventually move above it. It is unclear what causes the scalloping behavior.
In the first 1 million terms there are no fixed points other than 1 and 2, but due to the pattern formed by the primes it is plausible more may exist.
LINKS
Scott R. Shannon, Table of n, a(n) for n = 1..10000.
Scott R. Shannon, Image of the first 1 million terms. The green line is a(n) = n.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^16, showing primes in red, proper prime powers in gold, squarefree composites in green, and numbers neither squarefree nor prime powers in blue and purple, where purple represents powerful numbers that are not prime powers.
EXAMPLE
a(8) = 15 as a(7) = 12 and digsum(12) = 3, and 15 is the smallest unused number that shares a factor with 3.
MATHEMATICA
Block[{c, i, j, k, m, d, nn, u}, nn = 120; c[_] := False; m[_] := 1; j = d = 1; u = 2; Array[Set[c[10^#], True] &, 21, 0]; {1}~Join~Reap[Do[If[PrimePowerQ[d], d = FactorInteger[d][[1, 1]]; While[c[Set[k, m[d]*d]], m[d]++], k = u; While[Or[c[k], CoprimeQ[k, d]], k++]]; Sow[k]; Set[{c[k], j, d}, {True, k, Total@ IntegerDigits[k]}]; If[k == u, While[c[u], u++]], {n, 2, nn}] ][[-1, 1]] ] (* Michael De Vlieger, Feb 03 2026 *)
PROG
(Python)
from math import gcd
from itertools import count, islice
def is_pow10(k): return str(k).strip("0") == "1"
def agen(): # generator of terms
yield from [1, 2]
aset, an, m = {1, 2}, 2, 3
while True:
s = sum(map(int, str(an)))
an = next(i for i in count(m) if i not in aset and gcd(i, s) > 1 and not is_pow10(i))
yield an
aset.add(an)
while m in aset or is_pow10(m): m += 1
print(list(islice(agen(), 68))) # Michael S. Branicky, Feb 03 2026
CROSSREFS
KEYWORD
AUTHOR
Scott R. Shannon, Feb 02 2026
STATUS
approved
