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.

A354748 a(n) is the prime reached after A354747(n) steps when repeatedly applying the map x -> 3*x+2 to 2*n-1, or 0 if no prime is ever reached.

This page as a plain text file.
%I A354748 #8 Jul 01 2022 22:16:23
%S A354748 5,11,17,23,29,107,41,47,53,59,197,71,233,83,89,863,101,107,113,359,
%T A354748 2480057,131,137,431,149,467,4373,167,173,179,557,191,197,5507,1889,
%U A354748 647,1997,227,233,239,2213,251,257,263,269,827,281,863,293,2699,2753,311,317
%N A354748 a(n) is the prime reached after A354747(n) steps when repeatedly applying the map x -> 3*x+2 to 2*n-1, or 0 if no prime is ever reached.
%C A354748 Is a(100943) = 0?
%C A354748 If not 0, a(100943) >= 10^10000. - _Michael S. Branicky_, Jun 07 2022
%o A354748 (PARI) a(n) = my(x=2*n-1); while(1, x=3*x+2; if(ispseudoprime(x), return(x)))
%o A354748 (Python)
%o A354748 from sympy import isprime
%o A354748 def f(x): return 3*x + 2
%o A354748 def a(n):
%o A354748     fn, c = f(2*n-1), 1
%o A354748     while not isprime(fn): fn, c = f(fn), c+1
%o A354748     return fn
%o A354748 print([a(n) for n in range(1, 54)]) # _Michael S. Branicky_, Jun 07 2022
%Y A354748 Cf. A052333, A354747.
%K A354748 nonn
%O A354748 1,1
%A A354748 _Felix Fröhlich_, Jun 06 2022