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.

A382248 Smallest number k that is neither squarefree nor a prime power such that k is coprime to n.

Original entry on oeis.org

12, 45, 20, 45, 12, 175, 12, 45, 20, 63, 12, 175, 12, 45, 28, 45, 12, 175, 12, 63, 20, 45, 12, 175, 12, 45, 20, 45, 12, 539, 12, 45, 20, 45, 12, 175, 12, 45, 20, 63, 12, 275, 12, 45, 28, 45, 12, 175, 12, 63, 20, 45, 12, 175, 12, 45, 20, 45, 12, 539, 12, 45, 20
Offset: 1

Views

Author

Michael De Vlieger, Mar 31 2025

Keywords

Comments

Let p be the smallest prime that is coprime to n and let q be the second smallest prime that is coprime to n. Then a(n) = p^2 * q.
Records in this sequence are set by n in A002110.

Examples

			a(1) = 12 = 2^2*3, since p = 2, q = 3.
a(2) = 45 = 3^2*5, since p = 3, q = 5.
a(3) = 20 = 2^2*5, since p = 2, q = 5.
a(4) = 45 = 3^2*5, since p = 3, q = 5, a(2^i) = 45 for i > 0.
a(6) = 175 = 5^2*7, since p = 5, q = 7.
a(9) = 20 = 2^2*5, since p = 2, q = 5, a(3^i) = 20 for i > 0.
a(10) = 63 = 3^2*7, since p = 3, q = 7.
a(12) = 175 = 5^2*7, since p = 5, q = 7, a(k) = 175 for n in A033845 (i.e., n such that rad(n) = 6).
a(20) = 63 = 3^2*7, since p = 3, q = 7, a(k) = 63 for n in A033846 (i.e., n such that rad(n) = 10).
a(30) = 539 = 7^2*11, since p = 7, q = 11, etc.
		

Crossrefs

Programs

  • Mathematica
    Table[c = 0; q = 2; Times @@ Reap[While[c < 2, While[Divisible[n, q], q = NextPrime[q]]; Sow[q^(2 - c)]; q = NextPrime[q]; c++] ][[-1, 1]], {n, 120}]
  • PARI
    a(n) = my(k=2); while (isprimepower(k) || issquarefree(k) || (gcd(k, n) != 1) , k++); k; \\ Michel Marcus, Apr 01 2025

Formula

a(n) = A053669(n)^2 * A380539(n).
For k and m such that rad(k) = rad(m), a(k) = a(m), where rad = A007947.