OFFSET
1,3
COMMENTS
In other words if a(n-1) is a novel term, a(n) is the product of all primes < Gpf(a(n-1) which do not divide a(n-1), else if a(n-1) seen k times already, up to and including itself then a(n)=k*a(n-1). All positive integers appear eventually in the sequence, and the first occurrences of primes appear in order.
Every squarefree number appears infinitely many times (consequent to both conditions of the definition), whereas numbers m which are not squarefree can appear only from the second condition, and therefore appear finitely many (at most A000005(m)-1) times; see Example.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Log log scatterplot of log_10(a(n)), n = 1..2^20.
FORMULA
If a(n-1) is a novel term and rad(a(n-1)) is primorial then a(n)=1.
EXAMPLE
a(1)=1 is a primorial term so a(2)=1. 1 has now occurred twice so a(3)=2*1=2.
a(3)=2 is a novel primorial term so a(4)=1, and then a(5)=3. Since 3 is novel a(6)=A083720(3)=2.
4 appears twice = A5(4)-1 (as 2*2=a(7), and 4*1=a(9)). It never appears again since A083720(m)!=4 for any m, so 4 can only arise as consequence of the second condition of the definition. Similarly 8 appears only 3 (A5(8)-1) times: 2*4=a(10), 8*1=a(21), and 4*2 a(47). However 16 appears not 5 (A5(16)-1) times but 4 times because 4*4 is prevented since 4 appears only twice.
MATHEMATICA
nn = 120; c[_] := 0; j = 1;
{j}~Join~Reap[Do[
If[c[j] == 0,
k = Product[Prime[i], {i, PrimePi[#[[-1]] ] } ]/Apply[Times, #] &[
FactorInteger[j][[All, 1]] ]; c[j]++,
k = ++c[j]*j ];
j = Sow[k], {nn}] ][[-1, 1]]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David James Sycamore, Dec 31 2024
STATUS
approved