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.

Previous Showing 21-22 of 22 results.

A376928 The largest noncomposite number k such that n is divisible by all the primes that do not exceed k.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1
Offset: 1

Views

Author

Amiram Eldar, Oct 11 2024

Keywords

Comments

First differs from A062356 and A257993 at n = 30.
The least index n such that a(n) = prime(k) is A002110(k).
Let p be a prime and prev(p) = A151799(p) if p >= 3, and prev(2) = 1 (i.e., prev(p) is the largest noncomposite number that is smaller than p). Then, the asymptotic density of the occurrences of prev(p) in this sequence is 1/prev(p)# - 1/p#, where # denotes primorial (second definition, A034386). For example, the asymptotic densities of the occurrences of 1, 2, 3, 5 and 7 are 1/2, 1/3, 2/15, 1/35 and 1/231, respectively.

Examples

			a(30) = 5 since 30 is divisible by all the primes <= 5, i.e., by 2, 3 and 5.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = 1}, While[Divisible[n, p], p = NextPrime[p]]; If[p > 2, NextPrime[p, -1], 1]]; Array[a, 100]
  • PARI
    a(n) = {my(p = 1); while(!(n % p), p = nextprime(p+1)); if(p > 2, precprime(p-1), 1);}

Formula

a(n) = 1 if and only if n is odd.
a(n) = gpf(n) = A006530(n) if and only if n is in A055932.
a(n) = prime(A276084(n)) = A000040(A276084(n)) if A276084(n) > 0, and 1 otherwise.
primepi(a(n)) = A000720(a(n)) = A276084(n).
A034386(a(n)) = A053589(n).
a(n) = prev(A053669(n)), where prev(p) is defined in the Comments section.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{p prime} prev(p) * (1/prev(p)# - 1/p#) = 1.744663405017... (A377010).

A343783 a(n) is the largest primorial number (A002110) which divides phi(n).

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 6, 2, 6, 2, 2, 2, 6, 6, 2, 2, 2, 6, 6, 2, 6, 2, 2, 2, 2, 6, 6, 6, 2, 2, 30, 2, 2, 2, 6, 6, 6, 6, 6, 2, 2, 6, 6, 2, 6, 2, 2, 2, 6, 2, 2, 6, 2, 6, 2, 6, 6, 2, 2, 2, 30, 30, 6, 2, 6, 2, 6, 2, 2, 6, 2, 6, 6, 6, 2, 6, 30, 6, 6, 2, 6, 2, 2, 6, 2, 6
Offset: 1

Views

Author

Amiram Eldar, Apr 29 2021

Keywords

Examples

			a(3) = 2 since phi(3) = 2 and 2 = A002110(1).
a(5) = 2 since phi(5) = 4 and 2 = A002110(1) is the largest primorial dividing 4.
a(7) = 6 since phi(7) = 6 and 6 = A002110(2).
		

Crossrefs

Programs

  • Mathematica
    prim[n_] := Times @@ Prime[Range[n]]; gp[n_] := Module[{k = 1}, While[Divisible[n, prim[k]], k++]; prim[k - 1]]; a[n_] := gp[EulerPhi[n]]; Array[a, 100]
  • PARI
    f(n) = my(s=1); forprime(p=2, , if(n%p, return(s), s *= p)); \\ A053589
    a(n) = f(eulerphi(n)); \\ Michel Marcus, May 01 2021

Formula

a(n) = A053589(A000010(n)).
Let pr(n) be the largest prime divisor of a(n) (i.e., a(n) = pr(n)# = A034386(pr(n))). Then pr(n) ~ log(log(n))/log(log(log(n))) on a set of integers of asymptotic density 1 (Pollack and Pomerance, 2020).
From Bernard Schott, May 05 2021: (Start)
a(2n) = a(n) for n>=1.
a(n) = 1 iff n = 1 or n = 2.
a(n) = 2 iff 3 does not divide phi(n) (A088232)
a(n) >= 6 iff 3 divides phi(n) (A066498). (End)
Previous Showing 21-22 of 22 results.