login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A285328 a(n) = 1 if n is squarefree (A005117), otherwise a(n) = Max {m < n | same prime factors as n, ignoring multiplicity}. 16
1, 1, 1, 2, 1, 1, 1, 4, 3, 1, 1, 6, 1, 1, 1, 8, 1, 12, 1, 10, 1, 1, 1, 18, 5, 1, 9, 14, 1, 1, 1, 16, 1, 1, 1, 24, 1, 1, 1, 20, 1, 1, 1, 22, 15, 1, 1, 36, 7, 40, 1, 26, 1, 48, 1, 28, 1, 1, 1, 30, 1, 1, 21, 32, 1, 1, 1, 34, 1, 1, 1, 54, 1, 1, 45, 38, 1, 1, 1, 50, 27, 1, 1, 42, 1, 1, 1, 44, 1, 60, 1, 46, 1, 1, 1, 72, 1, 56, 33, 80, 1, 1, 1, 52, 1, 1, 1, 96 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..10000

FORMULA

If A008683(n) <> 0, a(n) = 1, otherwise a(n) = the largest number k < n for which A007947(k) = A007947(n).

Other identities. For all n >= 1:

a(A065642(n)) = n.

EXAMPLE

From Michael De Vlieger, Dec 31 2018: (Start)

a(1) = 1 since 1 is squarefree.

a(2) = 1 since 2 is squarefree.

a(4) = 2 since 4 is not squarefree and 2 is the largest number less than 4 that has all the distinct prime divisors that 4 has.

a(6) = 1 since 6 is squarefree.

a(12) = 6 since 12 is not squarefree and 6 is the largest number less than 12 that has all the distinct prime divisors that 12 has. (6 is also the squarefree root of 12).

a(16) = 8 since 16 is not squarefree and 8 is the largest number less than 16 that has all the distinct prime divisors that 16 has.

a(18) = 12 since 18 is not squarefree and 12 is the largest number less than 18 that has all the distinct prime divisors that 18 has.

(End)

MATHEMATICA

Table[With[{r = DivisorSum[n, EulerPhi[#] Abs@ MoebiusMu[#] &]}, If[MoebiusMu@ n != 0, 1, SelectFirst[Range[n - 2, 2, -1], DivisorSum[#, EulerPhi[#] Abs@ MoebiusMu[#] &] == r &]]], {n, 108}] (* Michael De Vlieger, Dec 31 2018 *)

PROG

(Scheme)

(definec (A285328 n) (if (not (zero? (A008683 n))) 1 (let ((k (A007947 n))) (let loop ((n (- n k))) (if (= (A007947 n) k) n (loop (- n k)))))))

(PARI)

A007947(n) = factorback(factorint(n)[, 1]); \\ From Andrew Lelechenko, May 09 2014

A285328(n) = { my(r=A007947(n)); if(core(n)==n, 1, n = n-r; while(A007947(n) <> r, n = n-r); n); }; \\ After Python-code below - Antti Karttunen, Apr 17 2017

A285328(n) = { my(r); if((n > 1 && !bitand(n, (n-1))), (n/2), r=A007947(n); if(r==n, 1, n = n-r; while(A007947(n) <> r, n = n-r); n)); }; \\ Version optimized for powers of 2.

(Python)

from operator import mul

from sympy import primefactors

from sympy.ntheory.factor_ import core

def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))

def a(n):

    if core(n) == n: return 1

    r = a007947(n)

    k = n - r

    while k>0:

        if a007947(k) == r: return k

        else: k -= r

print [a(n) for n in xrange(1, 121)] # Indranil Ghosh and Antti Karttunen, Apr 17 2017

CROSSREFS

A left inverse of A065642.

Cf. A005117, A007947, A008479, A008683, A284571, A285111, A285331, A285329.

Cf. also A079277.

Sequence in context: A295666 A322020 A294895 * A321030 A290529 A266349

Adjacent sequences:  A285325 A285326 A285327 * A285329 A285330 A285331

KEYWORD

nonn

AUTHOR

Antti Karttunen, Apr 17 2017

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 23 18:13 EDT 2019. Contains 321433 sequences. (Running on oeis4.)