cp's OEIS Frontend

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.

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).

Original entry on oeis.org

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
Offset: 1

Views

Author

David James Sycamore, Jul 08 2023

Keywords

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).

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • 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

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.