login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007978 Least non-divisor of n. 33
2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Least k >= 2 such that sigma(n) divides sigma(n*k), where sigma is A000203. - Benoit Cloitre, Dec 01 2002
Contains all and only the prime powers p^k, k > 0. The first occurrence of p^k is at A003418(p^k-1); so new records occur at indices in A051451. - Franklin T. Adams-Watters, Jun 13 2011
LINKS
Bakir Farhi, On the average asymptotic behavior of a certain type of sequences of integers, Integers, Vol. 9 (2009), pp. 555-567.
FORMULA
a(n) = A053669(n) + A061853(n) = A055874(n) + 1. - Henry Bottomley, May 10 2001
G.f.: sum(k >= 2, -k*(x^A003418(k) - x^A003418(k-1))/((x^A003418(k) - 1)*(x^A003418(k-1) - 1))). - Robert Israel, Sep 02 2014
From Alonso del Arte, Sep 23 2017: (Start)
a(n) < n for all n > 2.
a(2n + 1) = 2, a(2n) >= 3.
a(2^k) = 3 for k > 0.
a(n!) = prime(pi(n) + 1) for n >= 0, except for a(3!) = 4. (End)
Asymptotic mean: lim_{n->oo} Sum_{k=1..n} a(k) = 1 + A064859 (Farhi, 2009). - Amiram Eldar, Jun 29 2021
MAPLE
a:= proc(n) local k;
for k from 2 while n mod k = 0 do od:
k
end proc:
seq(a(n), n=1..100); # Robert Israel, Sep 02 2014
MATHEMATICA
Table[k := 1; While[Mod[n, k] == 0, k++]; k, {n, 2000}] (* Clark Kimberling, Jun 16 2012 *)
Join[{2, 3}, Table[Complement[Range[n], Divisors[n]][[1]], {n, 3, 100}]] (* Alonso del Arte, Sep 23 2017 *)
PROG
(Haskell)
import Data.List ((\\))
a007978 = head . ([1..] \\) . a027750_row
-- Reinhard Zumkeller, May 10 2014
(PARI) a(n) = {my(k=2); while(!(n % k), k++); k; } \\ Michel Marcus, Sep 25 2017
(Python)
def a(n):
k = 2
while not n%k: k += 1
return k
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jul 09 2022
(Python)
def A007978(n): return next(filter(lambda d:n%d, range(2, n))) if n>2 else n+1 # Chai Wah Wu, Feb 22 2023
CROSSREFS
Cf. also A266620 (least non-divisor of n!).
Sequence in context: A228829 A341982 A337686 * A245575 A333600 A339625
KEYWORD
nonn
AUTHOR
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)