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 19 results. Next

A006530 Gpf(n): greatest prime dividing n, for n >= 2; a(1)=1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The initial term a(1)=1 is purely conventional: 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 largest prime factor. - Daniel Forgues, Jul 05 2011
Greatest noncomposite number dividing n, (cf. A008578). - Omar E. Pol, Aug 31 2013
Conjecture: Let a, b be nonzero integers and f(n) denote the maximum prime factor of a*n + b if a*n + b <> 0 and f(n)=0 if a*n + b=0 for any integer n. Then the set {n, f(n), f(f(n)), ...} is finite of bounded size. - M. Farrokhi D. G., Jan 10 2021

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 844.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section IV.1.
  • H. L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 210.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000040, A020639 (smallest prime divisor), A034684, A028233, A034699, A053585.
Cf. A046670 (partial sums), A104350 (partial products).
See A385503 for "popular" primes.

Programs

  • Magma
    [ #f eq 0 select 1 else f[ #f][1] where f is Factorization(n): n in [1..86] ]; // Klaus Brockhaus, Oct 23 2008
    
  • Maple
    with(numtheory,divisors); A006530 := proc(n) local i,t1,t2,t3,t4,t5; t1 := divisors(n); t2 := convert(t1,list); t3 := sort(t2); t4 := nops(t3); t5 := 1; for i from 1 to t4 do if isprime(t3[t4+1-i]) then return t3[t4+1-i]; fi; od; 1; end;
    # alternative
    A006530 := n->max(1,op(numtheory[factorset](n))); # Peter Luschny, Nov 02 2010
  • Mathematica
    Table[ FactorInteger[n][[ -1, 1]], {n, 100}] (* Ray Chandler, Nov 12 2005 and modified by Robert G. Wilson v, Jul 16 2014 *)
  • PARI
    A006530(n)=if(n>1,vecmax(factor(n)[,1]),1) \\ Edited to cover n=1. - M. F. Hasler, Jul 30 2015
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else max(factorint(n))
    print([a(n) for n in range(1, 87)]) # Michael S. Branicky, Aug 08 2022
    
  • SageMath
    def A006530(n): return list(factor(n))[-1][0] if n > 1 else 1
    print([A006530(n) for n in range(1, 87)])  # Peter Luschny, Jan 07 2024
  • Scheme
    ;; The following uses macro definec for the memoization (caching) of the results. A naive implementation of A020639 can be found under that entry. It could be also defined with definec to make it faster on the later calls. See http://oeis.org/wiki/Memoization#Scheme
    (definec (A006530 n) (let ((spf (A020639 n))) (if (= spf n) spf (A006530 (/ n spf)))))
    ;; Antti Karttunen, Mar 12 2017
    

Formula

a(n) = A027748(n, A001221(n)) = A027746(n, A001222(n)); a(n)^A071178(n) = A053585(n). - Reinhard Zumkeller, Aug 27 2011
a(n) = A000040(A061395(n)). - M. F. Hasler, Jan 16 2015
a(n) = n + 1 - Sum_{k=1..n} (floor((k!^n)/n) - floor(((k!^n)-1)/n)). - Anthony Browne, May 11 2016
n/a(n) = A052126(n). - R. J. Mathar, Oct 03 2016
If A020639(n) = n [when n is 1 or a prime] then a(n) = n, otherwise a(n) = a(A032742(n)). - Antti Karttunen, Mar 12 2017
a(n) has average order Pi^2*n/(12 log n) [Brouwer]. See also A046670. - N. J. A. Sloane, Jun 26 2017

Extensions

Edited by M. F. Hasler, Jan 16 2015

A214674 Conway's subprime Fibonacci sequence.

Original entry on oeis.org

1, 1, 2, 3, 5, 4, 3, 7, 5, 6, 11, 17, 14, 31, 15, 23, 19, 21, 20, 41, 61, 51, 56, 107, 163, 135, 149, 142, 97, 239, 168, 37, 41, 39, 40, 79, 17, 48, 13, 61, 37, 49, 43, 46, 89, 45, 67, 56, 41, 97, 69, 83, 76, 53, 43, 48, 13
Offset: 1

Views

Author

Wouter Meeussen, Jul 25 2012

Keywords

Comments

Similar to the Fibonacci recursion starting with (1, 1), but each new nonprime term is divided by its least prime factor. Sequence enters a loop of length 18 after 38 terms on reaching (48, 13).

References

  • Siobhan Roberts, Genius At Play: The Curious Mind of John Horton Conway, Bloomsbury, 2015, pages xx-xxi.

Crossrefs

Programs

  • Mathematica
    guyKhoSal[{a_, b_}] := Block[{c, l, r}, c = NestWhile[(p = Tr[Take[#, -2]]; If[PrimeQ[p], q = p, q = p/Part[FactorInteger[p, FactorComplete -> False], 1, 1]]; Flatten[{#, q}]) &, {a, b}, FreeQ[Partition[#1, 2, 1], Take[#2, -2]] &, 2, 1000]; l = Length[c]; r = Tr@Position[Partition[c,2,1], Take[c,-2], 1, 1]; l-r-1; c]; guyKhoSal[{1,1}]
    f[s_List] := Block[{a = s[[-2]] + s[[-1]]}, If[ PrimeQ[a], Append[s, a], Append[s, a/FactorInteger[a][[1, 1]] ]]]; Nest[f, {1, 1}, 73] (* Robert G. Wilson v, Aug 09 2012 *)
  • PARI
    fatw(n,a=[0,1],p=[])={for(i=2,n,my(f=factor(a[i]+a[i-1])~);for(k=1,#f,setsearch(p,f[1,k])&next;f[2,k]--;p=setunion(p,Set(f[1,k]));break);a=concat(a,factorback(f~)));a}
    fatw(99) /* M. F. Hasler, Jul 25 2012 */

A177904 a(1)=a(2)=a(3)=1; thereafter a(n) = gpf(a(n-1)+a(n-2)+a(n-3)), where gpf = "greatest prime factor".

Original entry on oeis.org

1, 1, 1, 3, 5, 3, 11, 19, 11, 41, 71, 41, 17, 43, 101, 23, 167, 97, 41, 61, 199, 43, 101, 7, 151, 37, 13, 67, 13, 31, 37, 3, 71, 37, 37, 29, 103, 13, 29, 29, 71, 43, 13, 127, 61, 67, 17, 29, 113, 53, 13, 179, 7, 199, 11, 31, 241, 283, 37, 17, 337, 23, 29, 389, 7, 17, 59, 83, 53, 13, 149, 43, 41, 233, 317, 197, 83, 199, 479, 761, 1439, 47, 107
Offset: 1

Views

Author

N. J. A. Sloane, Dec 16 2010

Keywords

Comments

After 86 steps, enters a cycle of length 212 (see A177923).

Crossrefs

Programs

  • Haskell
    a177904 n = a177904_list !! (n-1)
    a177904_list = 1 : 1 : 1 : (map a006530 $ zipWith (+)
       a177904_list (tail $ zipWith (+) a177904_list $ tail a177904_list))
    -- Reinhard Zumkeller, Jul 24 2012
  • Maple
    with(numtheory, divisors); A006530 := proc(n) local i, t1, t2, t3, t4, t5; t1 := divisors(n); t2 := convert(t1, list); t3 := sort(t2); t4 := nops(t3); t5 := 1; for i from 1 to t4 do if isprime(t3[t4+1-i]) then RETURN(t3[t4+1-i]); fi; od; 1; end;
    M:=1000;
    t1:=[1,1,1];
    for n from 4 to M do
    t1:=[op(t1),A006530(t1[n-1]+t1[n-2]+t1[n-3])]; od:
    t1;
  • Mathematica
    nxt[{a_,b_,c_}]:={b,c,FactorInteger[a+b+c][[-1,1]]}; NestList[nxt,{1,1,1},90][[All,1]] (* Harvey P. Dale, Jul 17 2017 *)

A214892 Conway's subprime Fibonacci sequence starting with (4,1).

Original entry on oeis.org

4, 1, 5, 3, 4, 7, 11, 9, 10, 19, 29, 24, 53, 11, 32, 43, 25, 34, 59, 31, 45, 38, 83, 11, 47, 29, 38, 67, 35, 51, 43, 47, 45, 46, 13, 59, 36, 19, 11, 15, 13, 14, 9, 23, 16, 13, 29, 21, 25, 23, 24, 47, 71, 59, 65, 62, 127, 63, 95, 79, 87, 83, 85, 84, 13, 97, 55, 76, 131, 69, 100, 13, 113
Offset: 1

Views

Author

Wouter Meeussen, Jul 29 2012

Keywords

Comments

Similar to the Fibonacci recursion starting with (4, 1), but each new nonprime term is divided by its least prime factor. Sequence enters a loop of length 136 after 8 terms on reaching (11, 9).

Crossrefs

Programs

  • Mathematica
    (* see A214674 *)
    a[1] = 4; a[2] = 1; a[n_] := a[n] = If[an = a[n-2]+a[n-1]; PrimeQ[an], an, an/FactorInteger[an][[1, 1]]]; Array[a, 80] (* Jean-François Alcover, Nov 17 2018 *)

A214898 Conway's subprime Fibonacci sequence, largest loop elements.

Original entry on oeis.org

2, 827, 607, 239, 191, 5693, 347
Offset: 1

Views

Author

Wouter Meeussen, Jul 29 2012

Keywords

Comments

Similar to the Fibonacci recursion starting with a pair of positive integers, but each new nonprime term is divided by its least prime factor. Recursion enters a loop of length A214897(n), of which the largest element a(n) is prime (this sequence).

Crossrefs

Programs

A177923 a(1)=19, a(2)=13, a(3)=37; thereafter a(n) = gpf(a(n-1)+a(n-2)+a(n-3)), where gpf = "greatest prime factor".

Original entry on oeis.org

19, 13, 37, 23, 73, 19, 23, 23, 13, 59, 19, 13, 13, 5, 31, 7, 43, 3, 53, 11, 67, 131, 19, 31, 181, 11, 223, 83, 317, 89, 163, 569, 821, 1553, 109, 191, 109, 409, 709, 409, 509, 1627, 509, 23, 127, 659, 809, 29, 499, 191, 719, 1409, 773, 967, 67, 139, 23, 229, 23, 11, 263, 11, 19, 293, 19, 331, 643, 331, 29, 59, 419, 13, 491, 71, 23, 13, 107, 13, 19, 139, 19, 59, 31, 109, 199, 113, 421, 733, 181, 89, 59, 47, 13, 17, 11, 41, 23, 5, 23, 17, 5, 5, 3, 13, 7, 23, 43, 73, 139, 17, 229, 11, 257, 71, 113, 7, 191, 311, 509, 337
Offset: 1

Views

Author

N. J. A. Sloane, Dec 18 2010

Keywords

Comments

This is the periodic part of A177904 - it is periodic with period 212.
A smaller start is a(1)=3, a(2)=13, a(3)=7, but that would not produce the terms in the order of their first appearance in A177904.
There are several open questions concerning this class of sequences - see the Back-Caragiu reference in A177904.

Crossrefs

Programs

  • Mathematica
    nxt[{a_,b_,c_}]:={b,c,FactorInteger[a+b+c][[-1,1]]}; NestList[nxt,{19,13,37},120][[All,1]] (* Harvey P. Dale, Dec 11 2018 *)

A178095 a(1)=a(2)=a(3)=1; thereafter a(n) = lpf(a(n-1)+a(n-2)+a(n-3)), where lpf = "least prime factor".

Original entry on oeis.org

1, 1, 1, 3, 5, 3, 11, 19, 3, 3, 5, 11, 19, 5, 5, 29, 3, 37, 3, 43, 83, 3, 3, 89, 5, 97, 191, 293, 7, 491, 7, 5, 503, 5, 3, 7, 3, 13, 23, 3, 3, 29, 5, 37, 71, 113, 13, 197, 17, 227, 3, 13, 3, 19, 5, 3, 3, 11, 17, 31, 59, 107, 197, 3, 307, 3, 313, 7, 17, 337, 19, 373, 3, 5, 3, 11, 19, 3, 3, 5, 11, 19, 5, 5, 29, 3, 37, 3, 43, 83, 3, 3, 89, 5, 97, 191, 293, 7, 491, 7
Offset: 1

Views

Author

N. J. A. Sloane, Dec 16 2010

Keywords

Comments

Has period 69, starting with the fourth term: 3, 5, 3, 11, 19, 3, 3, 5, 11, ...

Crossrefs

Programs

  • Mathematica
    nxt[{a_,b_,c_}]:={b,c,FactorInteger[a+b+c][[1,1]]}; Transpose[ NestList[ nxt,{1,1,1},100]][[1]] (* Harvey P. Dale, Aug 19 2014 *)

A180101 a(0)=0, a(1)=1; thereafter a(n) = largest prime factor of sum of all previous terms.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jan 16 2011

Keywords

Comments

More precisely, a(n) = A006530 applied to sum of previous terms.
Inspired by A175723.
Except for initial terms, same as A076272, but the simple definition warrants an independent entry.

Crossrefs

Cf. A006530, A076272, A175723, A180107 (partial sums).

Formula

For the purposes of this paragraph, regard 0 as the (-1)st prime and 1 as the 0th prime. Conjectures: All primes appear; the primes appear in increasing order; the k-th prime p(k) appears p(k+1)-p(k-1) times (cf. A031131); and p(k) appears for the first time at position A164653(k) (sums of two consecutive primes). These assertions are stated as conjectures only because I have not written out a formal proof, but they are surely true.

A178094 a(1)=a(2)=1; thereafter a(n) = lpf(a(n-1)+a(n-2)), where lpf = "least prime factor".

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 16 2010

Keywords

Comments

Cycles with a period of length 9.

Crossrefs

Programs

  • Mathematica
    nxt[{a_,b_}]:={b,FactorInteger[a+b][[1,1]]}; NestList[nxt,{1,1},110][[;;,1]] (* or *) PadRight[ {1,1},110,{5,7,2,3,5,2,7,3,2}] (* Harvey P. Dale, May 29 2023 *)

A178174 a(1)=a(2)=a(3)=a(4)=1; thereafter a(n) = gpf(a(n-1)+a(n-2)+a(n-3)+a(n-4)), where gpf is the greatest prime factor.

Original entry on oeis.org

1, 1, 1, 1, 2, 5, 3, 11, 7, 13, 17, 3, 5, 19, 11, 19, 3, 13, 23, 29, 17, 41, 11, 7, 19, 13, 5, 11, 3, 2, 7, 23, 7, 13, 5, 3, 7, 7, 11, 7, 2, 3, 23, 7, 7, 5, 7, 13, 2, 3, 5, 23, 11, 7, 23, 2, 43, 5, 73, 41, 3, 61, 89, 97, 5, 7, 11, 5, 7, 5, 7, 3, 11, 13, 17, 11, 13, 3, 11, 19, 23, 7, 5, 3, 19, 17, 11, 5, 13, 23, 13, 3, 13, 13, 7, 3, 3, 13, 13, 2, 31, 59, 7, 11, 3, 5, 13, 2, 23, 43, 3, 71, 7, 31
Offset: 1

Views

Author

N. J. A. Sloane, Dec 18 2010

Keywords

Comments

After 133 steps, enters a cycle of length 14.

Crossrefs

Programs

  • Mathematica
    nxt[{a_,b_,c_,d_}]:={b,c,d,FactorInteger[a+b+c+d][[-1,1]]}; Transpose[ NestList[ nxt,{1,1,1,1},120]][[1]] (* Harvey P. Dale, Sep 24 2013 *)
Showing 1-10 of 19 results. Next