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.

A086956 a(1)=1, for n>1: a(n) is the smallest divisor of n occurring earlier at most twice.

Original entry on oeis.org

1, 1, 1, 2, 5, 2, 7, 2, 3, 5, 11, 3, 13, 7, 3, 4, 17, 6, 19, 4, 7, 11, 23, 4, 5, 13, 9, 14, 29, 6, 31, 8, 11, 17, 35, 6, 37, 19, 13, 8, 41, 14, 43, 22, 9, 23, 47, 8, 49, 10, 17, 26, 53, 9, 55, 14, 19, 29, 59, 10, 61, 31, 21, 16, 65, 22, 67, 34, 23, 10, 71, 12, 73, 37, 15, 38
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 25 2003

Keywords

Comments

For all natural numbers m there exist exactly three numbers u(m) < v(m) < w(m) with m=a(u(m))=a(v(m))=a(w(m)) (see A086957=u, A086958=v, A086959=w).
Permuting {u,v,w} induces 6=3! permutations of natural numbers: [(2,3,1)]->A086960, [(3,2,1)]->A086961, [(1)(2,3)]->A086962, [(2)(3,1)]->A086963, [(3)(2,1)]->A086964 and [(1,2,3)]->A000027.

Examples

			Divisor set of n=20: {1,2,4,5,10,20},
divisors occurring < 20: 1=a(1)=a(2)=a(3), 2=a(4)=a(6)=a(8), 4=a(16),
and as 4 occurs only once a(20)=4.
		

Crossrefs

Programs

  • Maple
    N:= 100:
    V:= Vector(N):
    for n from 1 to N do
      Dn:= select(t -> V[t]<=2,numtheory:-divisors(n));
      v:= min(Dn);
      A[n]:= v; V[v]:= V[v]+1
    od:
    seq(A[i],i=1..N); # Robert Israel, Aug 01 2019
  • Mathematica
    nn = 100;
    V = Table[0, {nn}];
    For[n = 1, n <= nn, n++,
         Dn = Select[Divisors[n], V[[#]] <= 2&];
         v = Min[Dn];
         a[n] = v; V[[v]] = V[[v]]+1];
    Table[a[n], {n, 1, nn}] (* Jean-François Alcover, Dec 13 2021, after Robert Israel *)

Formula

a(p) = p for primes p>3.