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.

Previous Showing 11-12 of 12 results.

A177186 a(n+1) = a(n) + p, where p is the largest prime dividing a(n) but not a(n-1), or 1 if there is no such prime.

Original entry on oeis.org

1, 2, 4, 5, 10, 12, 15, 20, 22, 33, 36, 38, 57, 60, 65, 78, 81, 82, 123, 126, 133, 152, 154, 165, 170, 187, 198, 201, 268, 270, 275, 286, 299, 322, 329, 376, 378, 385, 396, 399, 418, 429, 442, 459, 462, 473, 516, 519, 692, 694, 1041, 1044, 1073, 1110, 1115, 1338
Offset: 1

Views

Author

Keywords

Comments

Setting a(1) = 1 is arbitrary; since 1 has no prime divisors, we must then have p = 1 => a(2) = 2, without reference to a(0).
There are three cases where p = 1: n=1 (a(n)=1); n=3 (a(n)=4); n=17 (a(n)=81); and no others through n = 10000. Except that there cannot be such cases consecutively, p=1 iff a(n) is a prime power.

Examples

			After a(9)=22, a(10)=33, the prime divisors of a(10) are 3 and 11; 11 divides 22, so p=3, and a(11)=36.
		

Crossrefs

Programs

  • Mathematica
    p[n1_, n2_] := If[pp = Complement[Transpose[FactorInteger[n2]][[1]],
    Transpose[FactorInteger[n1]][[1]]]; pp == {}, 1, Last[pp]]; a[1] = 1; a[2] = 2; a[n_] := a[n] = a[n-1] + p[a[n-2], a[n-1]]; Table[a[n], {n, 56}] (* Jean-François Alcover, Sep 02 2011 *)
    nxt[{a_,b_}]:={b,b+Max[1,Complement[FactorInteger[b][[All,1]],FactorInteger[ a] [[All,1]]]]}; NestList[nxt,{1,2},60][[All,1]] (* Harvey P. Dale, Dec 17 2022 *)
  • PARI
    invec(v,x)=for(i=1,#v,if(v[i]==x,return(1)));0
    lastnotin(vi,vx,dft)=forstep(i=#vi,1,-1,if(!invec(vx,vi[i]),return(vi[i])));dft
    al(n)=local(r);r=vector(n);r[1]=1;r[2]=2;for(k=3,n,r[k]=r[k-1]+lastnotin(factor(r[k-1])[,1]~,factor(r[k-2])[,1]~,1));r

A284890 a(1)=2, and then a(n+1) = a(n) + k where prime(k) is the least prime dividing a(n).

Original entry on oeis.org

2, 3, 5, 8, 9, 11, 16, 17, 24, 25, 28, 29, 39, 41, 54, 55, 58, 59, 76, 77, 81, 83, 106, 107, 135, 137, 170, 171, 173, 213, 215, 218, 219, 221, 227, 276, 277, 336, 337, 405, 407, 412, 413, 417, 419, 500, 501, 503, 599, 708, 709, 836, 837, 839, 985, 988, 989
Offset: 1

Views

Author

Rémy Sigrist, Apr 05 2017

Keywords

Examples

			a(9) = 24 = prime(1)^3*prime(2), hence a(10) = 24+1 = 25.
a(14) = 41 = prime(13), hence a(15) = 41+13 = 54.
		

Crossrefs

Programs

  • Mathematica
    NestList[#+PrimePi[FactorInteger[#][[1,1]]]&,2,60] (* Harvey P. Dale, May 08 2022 *)

Formula

a(n+1) = a(n) + A055396(a(n)) for any n>1.
Previous Showing 11-12 of 12 results.