A138751 a(n) = nextprime( p(n)/2 if p(n)=2 (mod 3), 2p(n) else ) = A007918( A138750( A000040( n ))).
2, 7, 3, 17, 7, 29, 11, 41, 13, 17, 67, 79, 23, 89, 29, 29, 31, 127, 137, 37, 149, 163, 43, 47, 197, 53, 211, 59, 223, 59, 257, 67, 71, 281, 79, 307, 317, 331, 89, 89, 97, 367, 97, 389, 101, 401, 431, 449, 127, 461, 127, 127, 487, 127, 131, 137, 137, 547, 557, 149
Offset: 1
Examples
a(1) = nextprime(2/2) = 2, a(2) = nextprime(2*3) = 7, a(3) = nextprime(5/2) = 7.
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
- Georges Brougnard, Definition of GB-sequences.
- Index entries for sequences related to 3x+1 (or Collatz) problem
Programs
-
Mathematica
A138751[n_]:=With[{p=Prime[n]},NextPrime[If[Mod[p,3]==2,p/2,2p]]];Array[A138751,100] (* Paolo Xausa, Jul 28 2023 *)
-
PARI
A138751(n) = { n=prime(n); nextprime( if( n%3==2, ceil(n/2), 2*n ))}
Comments