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

A254132 a(0)=1 and a(1)=2, then each term is x + y + x*y where x and y are the 2 last terms.

Original entry on oeis.org

1, 2, 5, 17, 107, 1943, 209951, 408146687, 85691213438975, 34974584955819144511487, 2997014624388697307377363936018956287, 104819342594514896999066634490728502944926883876041385836543
Offset: 0

Views

Author

Michel Marcus, Jan 26 2015

Keywords

Examples

			a(0) = 1, a(1) = 2, a(2) = 1+2+(1*2) = 5, a(3) = 2+5+(2*5) = 17.
		

Crossrefs

Cf. A000045 (Fibonacci), A063896 (similar, with initial values 0,1).
Cf. A198796 (2^n*3^(n+1)-1).

Programs

  • Mathematica
    a254132[0]=1;a254132[n_]:=2^Fibonacci[n-1]*3^Fibonacci[n]-1;
    a254132/@Range[0,11] (* Ivan N. Ianakiev, Jan 27 2015 *)
  • PARI
    lista(nn) = {x = 1; y = 2; print1(x, ", ", y, ", "); for (j=1, nn, z = x + y + x*y; print1(z, ", "); x = y; y = z;);}
    
  • PARI
    a(n) = if (!n, 1, 2^fibonacci(n)*3^fibonacci(n+1) - 1);

Formula

a(n) = a(n-1) + a(n-2) + a(n-1)*a(n-2).
a(0) = 1 and a(n) = 2^Fibonacci(n)*3^Fibonacci(n+1) - 1 (see 2nd link).
a(n) == 8 mod 9, for n > 2. - Ivan N. Ianakiev, Jan 27 2015

A377624 a(n) is the number of iterations of x -> 6*x + 5 until (# composites reached) = (# primes reached), starting with prime(n).

Original entry on oeis.org

17, 5, 1, 3, 9, 11, 15, 1, 1, 3, 7, 5, 5, 7, 1, 1, 5, 1, 1, 7, 5, 5, 9, 1, 5, 1, 1, 9, 3, 13, 1, 1, 5, 9, 1, 11, 5, 7, 1, 1, 1, 13, 5, 7, 9, 1, 1, 1, 3, 1, 1, 9, 3, 3, 1, 3, 7, 1, 9, 1, 1, 1, 5, 5, 1, 13, 1, 3, 9, 3, 1, 1, 3, 17, 1, 1, 5, 1, 3, 9, 1, 5, 5, 1
Offset: 1

Views

Author

Clark Kimberling, Nov 20 2024

Keywords

Comments

For a guide to related sequences, see A377609.

Examples

			Starting with prime(1) = 2, we have 6*2+5 = 17, then 6*17+5 = 107, etc., resulting in a chain 2, 17, 107, 647, 3887, 23327, 139967, 839807, 5038847, 30233087, 181398527, 1088391167, 6530347007, 39182082047, 235092492287, 1410554953727, 8463329722367, 50779978334207 having 9 primes and 9 composites. Since every initial subchain has fewer composites than primes, a(1) = 18-1 = 17. (For more terms from the mapping x -> 6x-5, see A198796.)
		

Crossrefs

Programs

  • Mathematica
    chain[{start_, u_, v_}] := If[CoprimeQ[u, v] && start*u + v != start,
       NestWhile[Append[#, u*Last[#] + v] &, {start}, !
          Count[#, ?PrimeQ] == Count[#, ?(! PrimeQ[#] &)] &], {}];
    chain[{Prime[1], 6, -5}]
    Map[Length[chain[{Prime[#], 6, -5}]] &, Range[1, 100]] - 1
    (* Peter J. C. Moses, Oct 31 2024 *)
Showing 1-2 of 2 results.