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.

Showing 1-10 of 36 results. Next

A213633 [A000027/A007978], where [ ] = floor.

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 3, 2, 4, 3, 5, 2, 6, 4, 7, 5, 8, 4, 9, 6, 10, 7, 11, 4, 12, 8, 13, 9, 14, 7, 15, 10, 16, 11, 17, 7, 18, 12, 19, 13, 20, 10, 21, 14, 22, 15, 23, 9, 24, 16, 25, 17, 26, 13, 27, 18, 28, 19, 29, 8, 30, 20, 31, 21, 32, 16, 33, 22, 34, 23, 35, 14, 36, 24, 37
Offset: 1

Views

Author

Clark Kimberling, Jun 16 2012

Keywords

Comments

a(n) = floor(n/m), where m is the least positive nondivisor of n, as in A007978.

Examples

			a(10) = floor(10/3) = 3.
		

Crossrefs

Programs

  • Mathematica
    y=120; z=2000;
    t = Table[k := 1; While[Mod[n, k] == 0, k++]; k, {n, 1, z}]  (* A007978 *)
    Table[Floor[n/t[[n]]], {n, 1, y}] (* A213633 *)
    Table[n - Floor[n/t[[n]]], {n, 1, y}] (* A213634 *)
    Table[t[[n]]*Floor[n/t[[n]]], {n, 1, y}] (* A213635 *)
    t1 = Table[n - t[[n]]*Floor[n/t[[n]]], {n, 1, z}] (* A213636 *)
    Flatten[Position[t1, 1]] (* A213637 *)
    Flatten[Position[t1, 2]] (* A213638 *)

A374381 Triangle T(n, k), n > 0, k = 0..n-1, read by rows; T(n, k) = (n mod m) - (k mod m) where m = A007978(n-k).

Original entry on oeis.org

1, 2, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, 2, 1, 2, -1, -2, -1, -1, -1, 1, 2, 1, 1, 1, -1, 1, 2, -1, -2, -1, 1, -1, 2, -1, 1, -1, 1, -2, 1, -2, 1, -1, 1, 1, -1, -1, -1, 2, -1, 1, -1, -1, -1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, -1, -2, -1, -1, -1, -2, -1, -2, -1, -1, -1
Offset: 1

Views

Author

Rémy Sigrist, Jul 07 2024

Keywords

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  ---------------------------------------------
   1  1
   2  2, -1
   3  1, -1, 1
   4  1, -1, -1, -1
   5  1, 1, 1, 2, 1
   6  2, -1, -2, -1, -1, -1
   7  1, 2, 1, 1, 1, -1, 1
   8  2, -1, -2, -1, 1, -1, 2, -1
   9  1, -1, 1, -2, 1, -2, 1, -1, 1
  10  1, -1, -1, -1, 2, -1, 1, -1, -1, -1
  11  1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1
  12  2, -1, -2, -1, -1, -1, -2, -1, -2, -1, -1, -1
		

Crossrefs

Programs

  • PARI
    T(n, k) = { for (m = 2, oo, my (d = (n%m) - (k%m)); if (d, return (d););); }

Formula

T(n, 0) = A213636(n).
T(n, n-1) = (-1)^(n-1).

A213634 n-[n/m], where m is the least nondivisor of n (as in A007978) and [ ] = floor.

Original entry on oeis.org

1, 2, 2, 3, 3, 5, 4, 6, 5, 7, 6, 10, 7, 10, 8, 11, 9, 14, 10, 14, 11, 15, 12, 20, 13, 18, 14, 19, 15, 23, 16, 22, 17, 23, 18, 29, 19, 26, 20, 27, 21, 32, 22, 30, 23, 31, 24, 39, 25, 34, 26, 35, 27, 41, 28, 38, 29, 39, 30, 52, 31, 42, 32, 43, 33, 50, 34, 46, 35, 47, 36
Offset: 1

Views

Author

Clark Kimberling, Jun 16 2012

Keywords

Comments

If n is odd, a(n) = (n+1)/2. - Robert Israel, Oct 09 2016

Examples

			a(10) = 10 - [10/3] = 7.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local m;
           for m from 2 do if n mod m <> 0 then return n - iquo(n,m) fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 09 2016
  • Mathematica
    (See A213633.)

A213635 m*[n/m], where m is the least nondivisor of n (as in A007978) and [ ] = floor.

Original entry on oeis.org

0, 0, 2, 3, 4, 4, 6, 6, 8, 9, 10, 10, 12, 12, 14, 15, 16, 16, 18, 18, 20, 21, 22, 20, 24, 24, 26, 27, 28, 28, 30, 30, 32, 33, 34, 35, 36, 36, 38, 39, 40, 40, 42, 42, 44, 45, 46, 45, 48, 48, 50, 51, 52, 52, 54, 54, 56, 57, 58, 56, 60, 60, 62, 63, 64, 64, 66, 66, 68
Offset: 1

Views

Author

Clark Kimberling, Jun 16 2012

Keywords

Crossrefs

Cf. A213633.

Programs

  • Mathematica
    (See A213633.)
  • Python
    def A213635(n): return n-next(filter(None, (n%d for d in range(2,n)))) if n>2 else 0 # Chai Wah Wu, Feb 22 2023

A346155 Partial sums of A007978.

Original entry on oeis.org

2, 5, 7, 10, 12, 16, 18, 21, 23, 26, 28, 33, 35, 38, 40, 43, 45, 49, 51, 54, 56, 59, 61, 66, 68, 71, 73, 76, 78, 82, 84, 87, 89, 92, 94, 99, 101, 104, 106, 109, 111, 115, 117, 120, 122, 125, 127, 132, 134, 137, 139, 142, 144, 148, 150, 153, 155, 158, 160, 167
Offset: 1

Views

Author

Shobhit Tewari, Jul 09 2021

Keywords

Examples

			If b(n) is least non-divisor of n then, a(6) = b(1)+b(2)+b(3)+b(4)+b(5)+b(6) => 2+3+2+3+2+4 = 16.
		

Crossrefs

Programs

  • Mathematica
    lnd[n_] := Module[{k = 2}, While[Divisible[n, k], k++]; k]; Accumulate @ Array[lnd, 100] (* Amiram Eldar, Jul 11 2021 *)
  • PARI
    f(n) = {my(k=2); while(!(n % k), k++); k; } \\ A007978
    a(n) = sum(k=1, n, f(k)); \\ Michel Marcus, Jul 11 2021

Formula

a(n) ~ (1 + A064859) * n. - Amiram Eldar, Jul 11 2021

A346563 a(n) = n + A007978(n).

Original entry on oeis.org

3, 5, 5, 7, 7, 10, 9, 11, 11, 13, 13, 17, 15, 17, 17, 19, 19, 22, 21, 23, 23, 25, 25, 29, 27, 29, 29, 31, 31, 34, 33, 35, 35, 37, 37, 41, 39, 41, 41, 43, 43, 46, 45, 47, 47, 49, 49, 53, 51, 53, 53, 55, 55, 58, 57, 59, 59, 61, 61, 67, 63, 65, 65, 67, 67
Offset: 1

Views

Author

Keywords

Comments

Beginning at n=3, a(n) represents the maximum length of consecutive numbers that are divisible by the product of their nonzero digits in base n. In particular, if n=10, the sequence of numbers that are divisible by the product of their nonzero digits is given by A055471.

Examples

			For n=6, the least non-divisor of 6 is 4, so a(6) = 6+4 = 10. As seen in the Comments section, 55980, 55981, ..., 55989 form a sequence of length 10, where every number is divisible by the product of its nonzero digits in base n=6. Work has been done to show that 10 is the maximum length for such sequences.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[Divisible[n, k], k++]; n + k]; Array[a, 100] (* Amiram Eldar, Jul 23 2021 *)
  • PARI
    a(n) = my(k=2); while(!(n % k), k++); n+k; \\ Michel Marcus, Jul 23 2021
  • Python
    goal = 100
    these = []
    n = 1
    while n <= goal:
        k = 1
        while n % k == 0:
            k = k + 1
        these.append(n + k)
        n += 1
    print(these)
    

Formula

a(2k+1) = 2k+3.
a(2k) >= 2k+3.

A020639 Lpf(n): least prime dividing n (when n > 1); a(1) = 1. Or, smallest prime factor of n, or smallest prime divisor of n.

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 7, 2, 3, 2, 11, 2, 13, 2, 3, 2, 17, 2, 19, 2, 3, 2, 23, 2, 5, 2, 3, 2, 29, 2, 31, 2, 3, 2, 5, 2, 37, 2, 3, 2, 41, 2, 43, 2, 3, 2, 47, 2, 7, 2, 3, 2, 53, 2, 5, 2, 3, 2, 59, 2, 61, 2, 3, 2, 5, 2, 67, 2, 3, 2, 71, 2, 73, 2, 3, 2, 7, 2, 79, 2, 3, 2, 83, 2, 5, 2, 3, 2, 89, 2, 7, 2, 3, 2, 5, 2, 97
Offset: 1

Views

Author

Keywords

Comments

Also, the largest number of distinct integers such that all their pairwise differences are coprime to n. - Max Alekseyev, Mar 17 2006
The unit 1 is not a prime number (although it has been considered so in the past). 1 is the empty product of prime numbers, thus 1 has no least prime factor. - Daniel Forgues, Jul 05 2011
a(n) = least m > 0 for which n! + m and n - m are not relatively prime. - Clark Kimberling, Jul 21 2012
For n > 1, a(n) = the smallest k > 1 that divides n. - Antti Karttunen, Feb 01 2014
For n > 1, records are at prime indices. - Zak Seidov, Apr 29 2015
The initials "lpf" might be mistaken for "largest prime factor" (A009190), using "spf" for "smallest prime factor" would avoid this. - M. F. Hasler, Jul 29 2015
n = 89 is the first index > 1 for which a(n) differs from the smallest k > 1 such that (2^k + n - 2)/k is an integer. - M. F. Hasler, Aug 11 2015
From Stanislav Sykora, Jul 29 2017: (Start)
For n > 1, a(n) is also the smallest k, 1 < k <= n, for which the binomial(n,k) is not divisible by n.
Proof: (A) When k and n are relatively prime then binomial(n,k) is divisible by n because k*binomial(n,k) = n*binomial(n-1,k-1). (B) When gcd(n,k) > 1, one of its prime factors is the smallest; let us denote it p, p <= k, and consider the binomial(n,p) = (1/p!)*Product_{i=0..p-1} (n-i). Since p is a divisor of n, it cannot be a divisor of any of the remaining numerator factors. It follows that, denoting as e the largest e > 0 such that p^e|n, the numerator is divisible by p^e but not by p^(e+1). Hence, the binomial is divisible by p^(e-1) but not by p^e and therefore not divisible by n. Applying (A), (B) to all considered values of k completes the proof. (End)
From Bob Selcoe, Oct 11 2017, edited by M. F. Hasler, Nov 06 2017: (Start)
a(n) = prime(j) when n == J (mod A002110(j)), n, j >= 1, where J is the set of numbers <= A002110(j) with smallest prime factor = prime(j). The number of terms in J is A005867(j-1). So:
a(n) = 2 when n == 0 (mod 2);
a(n) = 3 when n == 3 (mod 6);
a(n) = 5 when n == 5 or 25 (mod 30);
a(n) = 7 when n == 7, 49, 77, 91, 119, 133, 161 or 203 (mod 210);
etc. (End)
For n > 1, a(n) is the leftmost term, other than 0 or 1, in the n-th row of A127093. - Davis Smith, Mar 05 2019

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section IV.1.

Crossrefs

Cf. A090368 (bisection).
Cf. A046669 (partial sums), A072486 (partial products).
Cf. A127093.

Programs

  • Haskell
    a020639 n = spf a000040_list where
      spf (p:ps) | n < p^2      = n
                 | mod n p == 0 = p
                 | otherwise    = spf ps
    -- Reinhard Zumkeller, Jul 13 2011
    
  • Maple
    A020639 := proc(n) if n = 1 then 1; else min(op(numtheory[factorset](n))) ; end if; end proc: seq(A020639(n),n=1..20) ; # R. J. Mathar, Oct 25 2010
  • Mathematica
    f[n_]:=FactorInteger[n][[1,1]]; Join[{1}, Array[f,120,2]]  (* Robert G. Wilson v, Apr 06 2011 *)
    Join[{1}, Table[If[EvenQ[n], 2, FactorInteger[n][[1,1]]], {n, 2, 120}]] (* Zak Seidov, Nov 17 2013 *)
    Riffle[Join[{1},Table[FactorInteger[n][[1,1]],{n,3,101,2}]],2] (* Harvey P. Dale, Dec 16 2021 *)
  • PARI
    A020639(n) = { vecmin(factor(n)[,1]) } \\ [Will yield an error for n = 1.] - R. J. Mathar, Mar 02 2012
    
  • PARI
    A020639(n)=if(n>1, if(n>n=factor(n,0)[1,1], n, factor(n)[1,1]), 1) \\ Avoids complete factorization if possible. Often the smallest prime factor can be found quickly even if it is larger than primelimit. If factoring takes too long for large n, use debugging level >= 3 (\g3) to display the smallest factor as soon as it is found. - M. F. Hasler, Jul 29 2015
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else min(factorint(n))
    print([a(n) for n in range(1, 98)]) # Michael S. Branicky, Dec 09 2021
  • Sage
    def A020639_list(n) : return [1] + [prime_divisors(n)[0] for n in (2..n)]
    A020639_list(97) # Peter Luschny, Jul 16 2012
    
  • Sage
    [trial_division(n) for n in (1..100)] # Giuseppe Coppoletta, May 25 2016
    
  • Scheme
    (define (A020639 n) (if (< n 2) n (let loop ((k 2)) (cond ((zero? (modulo n k)) k) (else (loop (+ 1 k))))))) ;; Antti Karttunen, Feb 01 2014
    

Formula

A014673(n) = a(A032742(n)); A115561(n) = a(A054576(n)). - Reinhard Zumkeller, Mar 10 2006
A028233(n) = a(n)^A067029(n). - Reinhard Zumkeller, May 13 2006
a(n) = A027746(n,1) = A027748(n,1). - Reinhard Zumkeller, Aug 27 2011
For n > 1: a(n) = A240694(n,2). - Reinhard Zumkeller, Apr 10 2014
a(n) = A000040(A055396(n)) = n / A032742(n). - Antti Karttunen, Mar 07 2017
a(n) has average order n/(2 log n) [Brouwer] - N. J. A. Sloane, Sep 03 2017

Extensions

Deleted wrong comment from M. Lagneau in 2012, following an observation by Gionata Neri. - M. F. Hasler, Aug 11 2015
Edited by M. F. Hasler, Nov 06 2017
Expanded definition to make this easier to find. - N. J. A. Sloane, Sep 21 2020

A055874 a(n) = largest m such that 1, 2, ..., m divide n.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2
Offset: 1

Views

Author

Leroy Quet, Jul 16 2000

Keywords

Comments

From Antti Karttunen, Nov 20 2013 & Jan 26 2014: (Start)
Differs from A232098 for the first time at n=840, where a(840)=8, while A232098(840)=7. A232099 gives all the differing positions. See also the comments at A055926 and A232099.
The positions where a(n) is an odd prime is given by A017593 up to A017593(34)=414 (so far all 3's), after which comes the first 7 at a(420). (A017593 gives the positions of 3's.)
(Continued on Jan 26 2014):
Only terms of A181062 occur as values.
A235921 gives such n where a(n^2) (= A235918(n)) differs from A071222(n-1) (= A053669(n)-1). (End)
a(n) is the largest m such that A003418(m) divides n. - David W. Wilson, Nov 20 2014
a(n) is the largest number of consecutive integers dividing n. - David W. Wilson, Nov 20 2014
A051451 gives indices where record values occur. - Gionata Neri, Oct 17 2015
Yuri Matiyasevich calls this the maximum inheritable divisor of n. - N. J. A. Sloane, Dec 14 2023

Examples

			a(12) = 4 because 1, 2, 3, 4 divide 12, but 5 does not.
		

Crossrefs

Programs

  • Haskell
    a055874 n = length $ takeWhile ((== 0) . (mod n)) [1..]
    -- Reinhard Zumkeller, Feb 21 2012, Dec 09 2010
    
  • Maple
    N:= 1000: # to get a(1) to a(N)
    A:= Vector(N,1);
    for m from 2 do
      Lm:= ilcm($1..m);
      if Lm > N then break fi;
      if Lm mod (m+1) = 0 then next fi;
      for k from 1 to floor(N/Lm) do
        A[k*Lm]:=m
      od
    od:
    convert(A,list); # Robert Israel, Nov 28 2014
  • Mathematica
    a[n_] := Module[{m = 1}, While[Divisible[n, m++]]; m - 2]; Array[a, 100] (* Jean-François Alcover, Mar 07 2016 *)
  • PARI
    a(n) = my(m = 1); while ((n % m) == 0, m++); m - 1; \\ Michel Marcus, Jan 17 2014
    
  • Python
    from itertools import count
    def A055874(n):
        for m in count(1):
            if n % m:
                return m-1 # Chai Wah Wu, Jan 02 2022
  • Scheme
    (define (A055874 n) (let loop ((m 1)) (if (not (zero? (modulo n m))) (- m 1) (loop (+ 1 m))))) ;; Antti Karttunen, Nov 18 2013
    

Formula

a(n) = A007978(n) - 1. - Antti Karttunen, Jan 26 2014
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A064859 (Farhi, 2009). - Amiram Eldar, Jul 25 2022

A246491 Smallest k such that 3^^n is not congruent to 3^^(n-1) mod k, where 3^^n denotes the power tower 3^3^...^3 (in which 3 appears n times).

Original entry on oeis.org

3, 5, 11, 23, 47, 283, 719, 1439, 2879, 34549, 138197, 1266767, 14920303, 36449279, 377982107
Offset: 1

Views

Author

Wayne VanWeerthuizen, Aug 27 2014

Keywords

Comments

This sequence is a member of an interesting class of sequences defined by the rule, "Smallest k such that b^^n is not congruent to b^^(n-1) mod k, where b^^n denotes the power tower b^b^...^b (in which b appears n times)," for some constant b. Different choices for b, with b>=2, determine a sequence of this class. The first sequence of this class is A027763, which uses b=2. This is the sequence for b=3. Adjacent sequences follow for b=4 through b=9.
Sequences of this class can contain only terms that are either prime numbers or powers of primes (A000961).
Powers of three (A000244) are commonplace as terms in sequences of this class, occurring significantly more often than powers of other primes.
For successive values of b, the sequence of first terms of all sequences of this class is A007978.
It appears that the sequence for b=x contains the term y, if and only if the sequence for b=x+A003418(y) also contains the term y, where A003418(y) is the least common multiple of all the integers from 1 to y. Can this be proved?
Sequences of this class generally share many terms with other sequences of this class, although each appears to be unique. These individual sequences are very similar to each other, so much so that among the first 7000 of them, only 120 distinct values less than 50000 occur (compare that to the 5217 available primes or powers of primes that are less than 50000.)
Sequences of this class tend to share many terms with A056637, the least prime of class n-.

Examples

			(3^^3) mod 11 = 9, (3^^2) mod 11 = 5. 11 is the least whole number for which this is true, thus a(3)=11.
		

Crossrefs

A071222 Smallest k such that gcd(n,k) = gcd(n+1,k+1).

Original entry on oeis.org

1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2
Offset: 0

Views

Author

Benoit Cloitre, Jun 10 2002

Keywords

Comments

a(n) = least m>0 such that gcd(n!+1+m,n-m) = 1. [Clark Kimberling, Jul 21 2012]
From Antti Karttunen, Jan 26 2014: (Start)
a(n-1)+1 = A053669(n) = Smallest k >= 2 coprime to n = Smallest prime not dividing n.
Note that a(n) is equal to A235918(n+1) for the first 209 values of n. The first difference occurs at n=210 and A235921 lists the integers n for which a(n) differs from A235918(n+1).
(End)

Crossrefs

One less than A053669(n+1).

Programs

  • Haskell
    a071222 n = head [k | k <- [1..], gcd (n + 1) (k + 1) == gcd n k]
    -- Reinhard Zumkeller, Oct 01 2014
  • Mathematica
    sgcd[n_]:=Module[{k=1},While[GCD[n,k]!=GCD[n+1,k+1],k++];k]; Array[sgcd,110] (* Harvey P. Dale, Jul 13 2012 *)
  • PARI
    for(n=1,140,s=1; while(gcd(s,n)
    				
  • Scheme
    (define (A071222 n) (let loop ((k 1)) (cond ((= (gcd n k) (gcd (+ n 1) (+ k 1))) k) (else (loop (+ 1 k)))))) ;; Antti Karttunen, Jan 26 2014
    

Formula

Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A249270 - 1. - Amiram Eldar, Jul 26 2022

Extensions

Added a(0)=1. - N. J. A. Sloane, Jan 19 2014
Showing 1-10 of 36 results. Next