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.

This page as a plain text file.
%I A266233 #23 May 04 2021 17:41:27
%S A266233 5,7,11,23,31,47,59,71,79,83,107,127,151,167,179,191,223,227,239,263,
%T A266233 271,347,359,383,431,439,467,479,503,563,587,599,607,631,719,727,839,
%U A266233 863,887,911,919,967,983,991,1019,1031,1087,1103,1151,1187,1231,1279,1283
%N A266233 Primes representable as f(f(f(...f(p)...))) where p is a prime and f(x) = x*2 + 1.
%C A266233 A005385 is a subsequence: f(x) is applied just once.
%H A266233 Robert Israel, <a href="/A266233/b266233.txt">Table of n, a(n) for n = 1..10000</a>
%e A266233 a(5) = f(f(7)) = (7*2 + 1)*2 + 1 = 31.
%e A266233 a(48) = f(f(f(137))) = ((137*2 + 1)*2 + 1)*2 + 1 = 1103.
%p A266233 N:= 10^4: # to get all terms <= N
%p A266233 Primes:= select(isprime, {2,seq(i,i=3..N,2)}):
%p A266233 f:= x -> 2*x+1:
%p A266233 S:= {}: R:= Primes:
%p A266233 for k from 1 while nops(R) > 0 do
%p A266233    R:= select(`<=`,map(f,R),N);
%p A266233    S:= S union (R intersect Primes);
%p A266233 od:
%p A266233 sort(convert(S,list)); # _Robert Israel_, Jun 29 2016
%t A266233 Take[Select[Union@ Flatten[Table[Nest[2 # + 1 &, Prime@ n, #], {n, 120}] & /@ Range@ 120], PrimeQ], 53] (* _Michael De Vlieger_, Jan 06 2016 *)
%o A266233 (Python)
%o A266233 from sympy import isprime
%o A266233 a=[]
%o A266233 TOP=10000
%o A266233 for p in range(TOP):
%o A266233     if isprime(p):
%o A266233          while p<TOP:
%o A266233             p = p*2+1
%o A266233             if isprime(p): a.append(p)
%o A266233 print(sorted(set(a)))
%Y A266233 Cf. A000040, A005385, A266234, A266235.
%K A266233 nonn
%O A266233 1,1
%A A266233 _Alex Ratushnyak_, Dec 25 2015