login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A363159 a(1)=1. Thereafter, if a(n-1) is a novel term, a(n) is the smallest prime which does not divide a(n-1). If a(n-1) has been seen k (>1) times already then a(n) = k*a(n-1). 1
1, 2, 3, 2, 4, 3, 6, 5, 2, 6, 12, 5, 10, 3, 9, 2, 8, 3, 12, 24, 5, 15, 2, 10, 20, 3, 15, 30, 7, 2, 12, 36, 5, 20, 40, 3, 18, 5, 25, 2, 14, 3, 21, 2, 16, 3, 24, 48, 5, 30, 60, 7, 14, 28, 3, 27, 2, 18, 36, 72, 5, 35, 2, 20, 60, 120, 7, 21, 42, 5, 40, 80, 3, 30, 90, 7, 28, 56, 3, 33, 2, 22, 3, 36, 108 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
It follows from the definition that the sequence is infinite. Every number appears multiple times according to its prime factorization. All primes p appear infinitely many times, prime powers p^k (k>1) appear once only, all squarefree semiprimes appear twice, and so on.
On the first occasion of A007947(a(n-1)) = A002110(k-1), a(n) is the first occasion of prime(k).
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^20.
FORMULA
For integer m let f(m) be the number of times m appears in the sequence.
f(1)=1, f(p)->oo for all prime p, and for n composite the following recursion applies:
f(n) = A001221(n) + Sum_{i=1..A321516(n)} [k_i*f(k_i)>=n], where k_i is a composite divisor of n and [] is the Iverson bracket.
EXAMPLE
a(2)=2 since 1 is a novel term and 2 is the least prime which does not divide 1, a(3)=3 since 3 is the smallest prime which does not divide 2.
a(4)=4 since 2 has appeared twice.
a(7) = 6, therefore a(8) = 5.
f(30) = A001221(30) + 1 since f(15)=2 and 2*15=30. No other divisor d of 30 has the property d*f(d) >= 30 thus f(30)=3+1=4.
MATHEMATICA
nn = 120; c[_] := 0; a[1] = c[1] = k = 1;
Do[If[c[j] == 0,
c[j]++; p = 2; While[Divisible[j, p], p = NextPrime[p]]; Set[k, p],
c[j]++; Set[k, j c[j]] ];
Set[{a[n], j}, {k, k}], {n, 2, nn}];
Array[a, nn] (* Michael De Vlieger, Jul 08 2023 *)
PROG
(PARI) lista(nn) = my(c, p, v=vector(nn)); v[1]=1; for(k=2, nn, if(c=sum(i=1, k-2, v[i]==v[k-1]), v[k]=(c+1)*v[k-1], p=2; while(v[k-1]%p==0, p=nextprime(p+1)); v[k]=p)); v \\ Jinyuan Wang, Jul 11 2023
CROSSREFS
Sequence in context: A130526 A351955 A174523 * A261172 A374192 A134834
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 27 08:13 EDT 2024. Contains 375462 sequences. (Running on oeis4.)