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-4 of 4 results.

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

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

A235921 Numbers n such that smallest number not dividing n^2 (A236454) is different from smallest prime not dividing n (A053669).

Original entry on oeis.org

210, 630, 1050, 1470, 1890, 2310, 2730, 3150, 3570, 3990, 4410, 4830, 5250, 5670, 6090, 6510, 6930, 7350, 7770, 8190, 8610, 9030, 9450, 9870, 10290, 10710, 11130, 11550, 11970, 12390, 12810, 13230, 13650, 14070, 14490, 14910, 15330, 15750, 16170, 16590, 17010
Offset: 1

Views

Author

Antti Karttunen and Michel Marcus, Jan 17 2014

Keywords

Comments

Equivalent definition is: numbers n such that {the largest m such that 1, 2, ..., m divide n^2 = A055874(n^2) = A235918(n)} is different from {the smallest k such that gcd(n-1,k) = gcd(n,k+1) = A071222(n-1)}.
All terms are multiples of 210 = 2*3*5*7, the fourth primorial, A002110(4).
The first term which is an even multiple of 210 (i.e., 210 times an even number), is 446185740 = 2124694 * 210 = 2*223092870 = 2*A002110(9) = 2*A034386(23). Note that 23 is the 9th prime, and 223092870 is its primorial. Thus this sequence differs from its subsequence, A236432, "the odd multiples of 210" = (2n-1)*210, for the first time at n = 1062348, where a(n) = 446185740, while A236432(n) = 446185950.
Note that a more comprehensive description for which terms are included is still lacking. Compare for example to the third definition of A055926.
At least we know the following:
If a number is not divisible by 210, then it cannot be a member, as then it is "missing" (i.e., not divisible by) one of those primes, 2, 3, 5 or 7, and thus its square is also "missing" the same prime. In more detail, this follows because:
If the least nondividing prime is 2, then A053669(n) = A236454(n) = 2. If the least nondividing prime is 3, then A053669(n) = A236454(n) = 3.
If the least nondividing prime is 5 (so 2 and 3 are present), then as 2|n and 4|(n^2), we have A053669(n) = A236454(n) = 5.
If the least nondividing prime is 7, but 2, 3 and 5 are present, then we have A053669(n) = A236454(n) = 7.
On the other hand, when n is an odd multiple of 210 (= 2*3*5*7), i.e., (2k+1)*210, so that its prime factorization is of the form 2*3*5*7*{zero or more additional odd prime factors}, then A053669(n) must be at least 11, the next prime after 7, which is certainly different from A236454(n) = A007978(n^2) which must be 8, as then 4 is the highest power of 2 dividing n^2.
In contrast to that, when n is an even multiple of 210, so that its prime factorization is of the form 2*2*3*5*7*{zero or more additional prime factors}, then also all the composites 8, 9, 10, 12, 14, 15, 16, 18 and 20 divide n^2, thus if A053669(n) is any prime from 11 to 19, A236454(n) will return the same result.
However, if n is of the form k*446185740, where k is not a multiple of 3, so that the prime factorization of n is 2*2*3*5*7*11*13*17*19*23*{zero or more additional prime factors, all different from 3}, then A053669(n) must be at least 29 (next prime after 23), but A236454(n) = 27, because then 9 is the highest power of 3 dividing n^2.
The pattern continues indefinitely: If n is of the form (2k+1)*2*3*200560490130, where 200560490130 = A002110(11), so that n has a prime factorization of the form 2*2*3*3*5*7*11*13*17*19*23*29*31*{zero or more additional odd prime factors}, then A053669(n) must be at least 37, while A236454(n) = 32 = 2^5, because then 16 is the highest power of 2 dividing n^2.

Examples

			210 (= 2*3*5*7) is a member, because A053669(210)=11, while A236454(210) = A007978(210*210) = A007978(44100) = 8.
446185740 (= 2*2*3*5*7*11*13*17*19*23) is a member, because A053669(446185740) = 29, while A236454(446185740) = 27, as there is only one 3 present in 446185740, which means that its square is only divisible by 9, but not by 27 = 3^3.
		

Crossrefs

A236454 Smallest number not dividing n^2.

Original entry on oeis.org

2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2
Offset: 1

Views

Author

Antti Karttunen, Jan 26 2014

Keywords

Comments

Differs from A053669, "smallest prime not dividing n", for the first time at n=210, where a(210)=8, while A053669(210)=11. A235921 lists all n for which a(n) differs from A053669(n).
Differs from A214720 at n=2, 210, 630, 1050, 1470, 1890, 2310,.... - R. J. Mathar, Mar 30 2014

Crossrefs

One more than A235918.

Programs

  • Maple
    A236454 := proc(n)
        for m from 2 do
            if modp(n^2,m) <> 0 then
                return m;
            end if;
        end do:
    end proc:# R. J. Mathar, Mar 30 2014
  • Mathematica
    Join[{2,3},Table[Complement[Range[n],Divisors[n^2]][[1]],{n,3,90}]] (* Harvey P. Dale, Mar 18 2018 *)
  • Scheme
    (define (A236454 n) (A007978 (A000290 n)))

Formula

a(n) = A007978(A000290(n)) = A007978(n^2).
a(n) = A235918(n)+1.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{k>=0} 1/A019554(A003418(k)) = 2.91240643793540602415... . - Amiram Eldar, Jan 14 2024
Showing 1-4 of 4 results.