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 10 results.

A191611 Places n where A085392(n+1)-A085392(n) = 1.

Original entry on oeis.org

3, 7, 8, 31, 127, 8191, 131071, 524287, 2147483647, 2305843009213693951, 618970019642690137449562111, 162259276829213363391578010288127, 170141183460469231731687303715884105727
Offset: 1

Views

Author

Jaroslav Krizek, Jun 09 2011

Keywords

Comments

Likely the union of the Mersenne primes A000668 and the {8}. [Presence of Mersenne primes M is obvious because A085392(M+1)=2 and A085392(M)=1.
Absence of other primes p is also clear because A085392(p)=1 and A085392(p+1) >=3 because it contains at least one odd prime factor if not of the Mersenne type.
For composite candidates c, we search adjacent c+1 and c with largest noncomposite divisors 2 and 1 or 3 and 2. The first branch enforces c=2 which is immediately discarded. The second branch searches for a power of 3 adjacent to a power of 2, and the solution to this exponential diophantine equation 3^x-2^y=1 is believed to lead only to the 8 (see the Weger review in the link).]

Examples

			Number 8 is in sequence because the difference between A085392(9)=3 and A085392(8)=2 is 1.
31 is in sequence because the difference between A085392(32)=2 and A085392(31)=1 is 1.
		

Crossrefs

Cf. A085392.

Programs

  • PARI
    gpd(n) = if (n==1, 1, n/factor(n)[1,1]);
    gpf(n) = if (n==1, 1, vecmax(factor(n)[,1]));
    f(n) = gpf(gpd(n));
    isok(n) = f(n+1) - f(n) == 1; \\ Michel Marcus, Apr 08 2018

A191615 a(1) = 1; a(n) is the smallest number such that a(n)-a(n-1) = A085392 (m), where A085392(m) is the largest noncomposite divisor

Original entry on oeis.org

1, 2, 3, 6, 7, 14, 16, 17, 34, 51, 54
Offset: 1

Views

Author

Jaroslav Krizek, Jun 09 2011

Keywords

Comments

Sequence is finite with 11 terms.
Lexicographically earliest sequence such that the first differences a(n) - a(n-1) are the largest noncomposite divisor

Crossrefs

A191616 a(1) = 1; a(n) is the largest number m such that m-A085392(m) = a(n-1).

Original entry on oeis.org

1, 2, 4, 5, 10, 15, 20, 25, 30, 32
Offset: 1

Author

Jaroslav Krizek, Jun 09 2011

Keywords

Comments

Lexicographically largest sequence such that a(n) - a(n-1) is the largest noncomposite divisor
Sequence is finite with 10 terms.
(The reason is that m-A085392(m) = 0, 1, 2, 2, 4, 3, 6, 6, 6, 5, 10, 9, 12, 7,.. starts to grow with a lower bound of m/2, and a(10)=32 is not in its list of values.)

Crossrefs

A377403 For n >= 2, a(n) is the number of iterations needed for the map: x -> x / A085392(x) if A085392(x) > 1, otherwise x -> x + A151800(x), to (the first occurrence of) 2.

Original entry on oeis.org

0, 3, 1, 3, 1, 3, 2, 4, 1, 4, 2, 3, 1, 4, 3, 4, 2, 3, 2, 4, 1, 3, 3, 4, 1, 5, 2, 4, 2, 3, 4, 4, 1, 4, 3, 3, 1, 4, 3, 4, 2, 4, 2, 5, 1, 4, 4, 4, 2, 4, 2, 5, 3, 4, 3, 4, 1, 5, 3, 7, 1, 5, 5, 4, 2, 3, 2, 4, 2, 6, 4, 4, 1, 5, 2, 4, 2, 5, 4, 6, 1, 3, 3, 4, 1, 4, 3, 3, 3, 4, 2, 4, 1, 4, 5, 4, 2, 5, 3, 4, 2, 4, 3, 5, 1, 6, 4, 3, 2, 4, 4, 6, 2, 4, 2, 5, 1, 4, 4, 5
Offset: 2

Author

Ctibor O. Zizka, Oct 27 2024

Keywords

Comments

Also a(2*k + 1) = A001222(2*k + 1) + 2 + s, where s >= 1 for k = 5, 8, 14, 20, 21, 23, 26, 29, 30, 35, 36, 39, 48, 50, 51, ...

Examples

			n = 3: 3 -> 8 -> 4 -> 2, 3 iterations needed to reach 2, thus a(3) = 3.
n = 9: 9 -> 3 -> 8 -> 4 -> 2, 4 iterations needed to reach 2, thus a(9) = 4.
n = 11: 11 -> 24 -> 8 -> 4 - > 2, 4 iterations needed to reach 2, thus a(11) = 4.
		

Programs

  • Mathematica
    a[2] = 0; a[n_] := -1 + Length@ NestWhileList[If[CompositeQ[#], #/FactorInteger[#][[-1, 1]], # + NextPrime[#]] &, n, # > 2 &]; Array[a, 120, 2] (* Amiram Eldar, Oct 27 2024 *)

Formula

For n even: a(n) = A001222(n) - 1.
For n odd: a(n) = A001222(n) - 1 + A001222(A013634(A020639(n))).

A014673 Smallest prime factor of greatest proper divisor of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 2, 3, 5, 1, 2, 1, 7, 5, 2, 1, 3, 1, 2, 7, 11, 1, 2, 5, 13, 3, 2, 1, 3, 1, 2, 11, 17, 7, 2, 1, 19, 13, 2, 1, 3, 1, 2, 3, 23, 1, 2, 7, 5, 17, 2, 1, 3, 11, 2, 19, 29, 1, 2, 1, 31, 3, 2, 13, 3, 1, 2, 23, 5, 1, 2, 1, 37, 5, 2, 11, 3, 1, 2, 3, 41, 1, 2, 17, 43, 29, 2, 1, 3, 13, 2, 31, 47
Offset: 1

Author

Reinhard Zumkeller, Jun 24 2003

Keywords

Comments

For n > 1: a(n) = 1 iff n is prime; a(A001358(n)) = A084127(n); a(A025475(n)) = A020639(A025475(n)). [corrected by Peter Munn, Feb 19 2017]
When n is composite, this is the 2nd factor when n is written as a product of primes in nondecreasing order. For example, 12 = 2*2*3, so a(12) = 2. - Peter Munn, Feb 19 2017
For all sufficiently large n the median value of a(1), a(2), ... a(n) is A281889(2) = 7. - Peter Munn, Jul 12 2019

Programs

  • Mathematica
    PrimeFactors[ n_ ] := Flatten[ Table[ # [ [ 1 ] ], {1} ] & /@ FactorInteger[ n ] ]; f[ n_ ] := Block[ {gpd = Divisors[ n ][ [ -2 ] ]}, If[ gpd == 1, 1, PrimeFactors[ gpd ][ [ 1 ] ] ] ]; Table[ If[ n == 1, 1, f[ n ] ], {n, 1, 95} ]
    (* Second program: *)
    Table[If[Or[PrimeQ@ n, n == 1], 1, FactorInteger[n/SelectFirst[Prime@ Range@ PrimePi[Sqrt@ n], Divisible[n, #] &]][[1, 1]] ], {n, 94}] (* Michael De Vlieger, Aug 14 2017 *)
  • PARI
    lpf(n)=if(n>1,factor(n)[1,1],1)
    a(n)=lpf(n/lpf(n)) \\ Charles R Greathouse IV, May 09 2013
    
  • PARI
    a(n)=if(n<4||isprime(n),return(1)); my(f=factor(n)); if(f[1,2]>1, f[1,1], f[2,1]) \\ Charles R Greathouse IV, May 09 2013
    
  • Scheme
    (define (A014673 n) (A020639 (/ n (A020639 n)))) ;; Code for A020639 given under that entry - Antti Karttunen, Aug 12 2017

Formula

a(n) = A020639(A032742(n)).
A117357(n) = A020639(A054576(n)); A117358(n) = A032742(A054576(n)) = A054576(n)/A117357(n). - Reinhard Zumkeller, Mar 10 2006
If A001222(n) >= 2, a(n) = A027746(n,2), otherwise a(n) = 1. - Peter Munn, Jul 13 2019

A087039 If n is prime then 1 else 2nd largest prime factor of n.

Original entry on oeis.org

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

Author

Reinhard Zumkeller, Aug 01 2003

Keywords

Crossrefs

Programs

  • Haskell
    a087039 n | null ps   = 1
              | otherwise = head ps
              where ps = tail $ reverse $ a027746_row n
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Maple
    A087039 := proc(n)
        local pset ,t;
        if isprime(n) or n= 1 then
            1;
        else
            pset := [] ;
            for p in ifactors(n)[2] do
                pset := [op(pset),seq(op(1,p),t=1..op(2,p))] ;
            end do:
            op(-2,sort(pset)) ;
        end if;
    end proc: # R. J. Mathar, Sep 14 2012
  • Mathematica
    gpf[n_] := FactorInteger[n][[-1, 1]];
    a[n_] := If[PrimeQ[n], 1, gpf[n/gpf[n]]];
    Array[a, 105] (* Jean-François Alcover, Dec 16 2021 *)
  • Python
    from sympy import factorint
    def a(n):
        pf = factorint(n, multiple=True)
        return 1 if len(pf) < 2 else pf[-2]
    print([a(n) for n in range(1, 103)]) # Michael S. Branicky, Dec 16 2021

Formula

a(n) = A006530(A052126(n)) = A006530(n/A006530(n));
A087040(n) = a(A002808(n)).

A085393 Difference between the largest and the smallest prime factor of the greatest proper divisor of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 5, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 4, 0, 9, 2, 0, 0, 1, 0, 0, 0, 11, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 4, 0, 0, 8, 0, 15, 0, 2, 0, 1, 0, 0, 0, 17, 0, 10, 0, 3, 0, 0, 0, 5, 0, 0, 0, 9, 0, 2, 0, 21, 0, 0, 0, 1, 0, 0, 8, 3, 0, 14
Offset: 1

Author

Keywords

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_] := Flatten[ Table[ # [[1]], {1}] & /@ FactorInteger[n]]; f[n_] := Block[{gpd = Divisors[n][[ -2]]}, If[gpd == 1, 0, PrimeFactors[gpd][[ -1]] - PrimeFactors[gpd][[1]] ]]; Table[ If[n == 1, 0, f[n]], {n, 1, 102}]
    {1}~Join~Array[#[[-1, 1]] - #[[1, 1]] &@ FactorInteger@ Last@ Most@ Divisors@ # &, 101, 2] (* Michael De Vlieger, Dec 03 2017 *)

Formula

a(n) = A085392(n) - A014673(n).

A365837 Largest proper square divisor of n, for n >= 2; a(1) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 9, 1, 4, 1, 1, 1, 4, 1, 1, 9, 4, 1, 1, 1, 16, 1, 1, 1, 9, 1, 1, 1, 4, 1, 1, 1, 4, 9, 1, 1, 16, 1, 25, 1, 4, 1, 9, 1, 4, 1, 1, 1, 4, 1, 1, 9, 16, 1, 1, 1, 4, 1, 1, 1, 36, 1, 1, 25, 4, 1, 1, 1, 16, 9, 1, 1, 4, 1, 1, 1, 4, 1, 9, 1, 4, 1, 1, 1, 16, 1, 49, 9, 25
Offset: 1

Author

Ilya Gutkovskiy, Oct 17 2023

Keywords

Programs

  • Maple
    f:= proc(n) local F, t;
      if issqr(n) then
        n/min(numtheory:-factorset(n))^2
      else
        F:= ifactors(n)[2];
        mul(t[1]^(2*floor(t[2]/2)),t=F)
      fi
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Nov 20 2023
  • Mathematica
    Join[{1}, Table[Last[Select[Divisors[n], # < n && IntegerQ[Sqrt[#]]  &]], {n, 2, 100}]]
    f[p_, e_] := p^(2*Floor[e/2]); a[n_] := Module[{fct = FactorInteger[n]}, Times @@ f @@@ fct/If[AllTrue[fct[[;; , 2]], EvenQ], fct[[1, 1]]^2, 1]]; Array[a, 100] (* Amiram Eldar, Oct 19 2023 *)
  • PARI
    a(n) = if (n==1, 1, my(d=divisors(n)); vecmax(select(issquare, Vec(d, #d-1)))); \\ Michel Marcus, Oct 17 2023
    
  • Python
    from math import prod
    from sympy import factorint
    def A365837(n):
        if n<=1: return 1
        f = factorint(n)
        return prod(p**(e&-2) for p, e in f.items())//(min(f)**2 if all(e&1^1 for e in f.values()) else 1) # Chai Wah Wu, Oct 20 2023

A366510 Largest prime divisor of n which is < sqrt(n), 1 if n is prime, square of prime or 1.

Original entry on oeis.org

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

Author

Ilya Gutkovskiy, Oct 11 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = {my(m=1); foreach(factor(n)[,1], d, if(d^2 < n, m=max(m,d))); m} \\ Andrew Howroyd, Oct 11 2023

A366649 Largest prime power (including 1) proper divisor of n, for n >= 2; a(1) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 3, 5, 1, 4, 1, 7, 5, 8, 1, 9, 1, 5, 7, 11, 1, 8, 5, 13, 9, 7, 1, 5, 1, 16, 11, 17, 7, 9, 1, 19, 13, 8, 1, 7, 1, 11, 9, 23, 1, 16, 7, 25, 17, 13, 1, 27, 11, 8, 19, 29, 1, 5, 1, 31, 9, 32, 13, 11, 1, 17, 23, 7, 1, 9, 1, 37, 25, 19, 11, 13, 1, 16, 27, 41, 1, 7, 17
Offset: 1

Author

Ilya Gutkovskiy, Oct 17 2023

Keywords

Programs

  • Maple
    f:= proc(n) local F,t;
      F:= ifactors(n)[2];
      if nops(F) = 1 then n/F[1,1]
      else max(map(t -> t[1]^t[2], F))
      fi
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Nov 19 2023
  • Mathematica
    Join[{1}, Table[Last[Select[Divisors[n], # < n && (# == 1 || PrimePowerQ[#]) &]], {n, 2, 85}]]
    a[n_] := Module[{f = FactorInteger[n]}, If[Length[f] == 1, f[[1, 1]]^(f[[1, 2]] - 1), Max[Power @@@ f]]]; Array[a, 100] (* Amiram Eldar, Oct 19 2023 *)
  • PARI
    a(n) = if (n==1, 1, my(d=divisors(n)); vecmax(select(x->(isprimepower(x) || (x==1)), Vec(d, #d-1)))); \\ Michel Marcus, Oct 17 2023
Showing 1-10 of 10 results.