A266233 Primes representable as f(f(f(...f(p)...))) where p is a prime and f(x) = x*2 + 1.
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
Keywords
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.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
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
Comments