login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1; thereafter a(n) = smallest prime factor of the powerful number A001694(n).
6

%I #22 Sep 11 2024 00:32:40

%S 1,2,2,3,2,5,3,2,2,7,2,2,3,2,2,11,5,2,2,13,2,2,2,3,3,2,2,17,2,7,19,2,

%T 2,2,3,2,2,2,23,2,5,2,3,2,3,2,2,29,2,2,31,2,2,2,2,3,3,2,2,5,2,3,11,2,

%U 37,2,2,3,2,2,41,2,2,2,43,2,2,2,3,2,2,3

%N a(1) = 1; thereafter a(n) = smallest prime factor of the powerful number A001694(n).

%H Reinhard Zumkeller, <a href="/A258567/b258567.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A020639(A001694(n)).

%F a(A258599(n)) = A000040(n) and a(m) != A000040(n) for m < A258599(n).

%t Table[If[Min[(f = FactorInteger[n])[[;; , 2]]] > 1 || n == 1, f[[1, 1]], Nothing], {n, 1, 3000}] (* _Amiram Eldar_, Jan 30 2023 *)

%o (Haskell)

%o a258567 = a020639 . a001694

%o (Python)

%o from math import isqrt

%o from sympy import mobius, integer_nthroot, primefactors

%o def A258567(n):

%o def squarefreepi(n):

%o return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1)))

%o def bisection(f, kmin=0, kmax=1):

%o while f(kmax) > kmax: kmax <<= 1

%o while kmax-kmin > 1:

%o kmid = kmax+kmin>>1

%o if f(kmid) <= kmid:

%o kmax = kmid

%o else:

%o kmin = kmid

%o return kmax

%o def f(x):

%o c, l = n+x, 0

%o j = isqrt(x)

%o while j>1:

%o k2 = integer_nthroot(x//j**2, 3)[0]+1

%o w = squarefreepi(k2-1)

%o c -= j*(w-l)

%o l, j = w, isqrt(x//k2**3)

%o c -= squarefreepi(integer_nthroot(x, 3)[0])-l

%o return c

%o return min(primefactors(bisection(f,n,n)),default=1) # _Chai Wah Wu_, Sep 10 2024

%Y Cf. A001694, A020639, A258599, A258568, A258569, A258570, A258571.

%K nonn

%O 1,2

%A _Reinhard Zumkeller_, Jun 06 2015

%E Definition made more precise by _N. J. A. Sloane_, Apr 29 2024