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.

A266233 Primes representable as f(f(f(...f(p)...))) where p is a prime and f(x) = x*2 + 1.

Original entry on oeis.org

5, 7, 11, 23, 31, 47, 59, 71, 79, 83, 107, 127, 151, 167, 179, 191, 223, 227, 239, 263, 271, 347, 359, 383, 431, 439, 467, 479, 503, 563, 587, 599, 607, 631, 719, 727, 839, 863, 887, 911, 919, 967, 983, 991, 1019, 1031, 1087, 1103, 1151, 1187, 1231, 1279, 1283
Offset: 1

Views

Author

Alex Ratushnyak, Dec 25 2015

Keywords

Comments

A005385 is a subsequence: f(x) is applied just once.

Examples

			a(5) = f(f(7)) = (7*2 + 1)*2 + 1 = 31.
a(48) = f(f(f(137))) = ((137*2 + 1)*2 + 1)*2 + 1 = 1103.
		

Crossrefs

Programs

  • Maple
    N:= 10^4: # to get all terms <= N
    Primes:= select(isprime, {2,seq(i,i=3..N,2)}):
    f:= x -> 2*x+1:
    S:= {}: R:= Primes:
    for k from 1 while nops(R) > 0 do
       R:= select(`<=`,map(f,R),N);
       S:= S union (R intersect Primes);
    od:
    sort(convert(S,list)); # Robert Israel, Jun 29 2016
  • Mathematica
    Take[Select[Union@ Flatten[Table[Nest[2 # + 1 &, Prime@ n, #], {n, 120}] & /@ Range@ 120], PrimeQ], 53] (* Michael De Vlieger, Jan 06 2016 *)
  • Python
    from sympy import isprime
    a=[]
    TOP=10000
    for p in range(TOP):
        if isprime(p):
             while p