OFFSET
1,1
COMMENTS
These are the primes which cannot be part of a gb-sequence (except as seed).
Is this sequence finite or infinite?
From M. F. Hasler, Mar 27 2008: (Start)
The last comment above probably refers not to this sequence but to the "gb-sequences" themselves, e.g., the one starting with 4499221 which reaches a peak of approximately 10^110, cf. Formula and Links.
The function f(p)=p/2 if p == 2 (mod 3), f(p)=2p otherwise, yields a half-integer for primes p=6k-1 and an even number for primes p=6k+1; in all cases nextprime(f(p)) is defined without ambiguity: f(p) will never be equal to a prime.
This sequence lists primes p' not in the range of the map p -> nextprime(f(p)), defined on the primes.
Equivalently, p' is listed iff: (i) no even number between p' and the next lower prime is of the form 2p with p=0 or p == 1 (mod 3), AND (ii) no half-integer between p' and the next lower prime is of the form p/2 with p == 2 (mod 3) and p prime (in both conditions).
This characterization allows easy computation of the sequence, cf. PARI code.
Experimentally, it does not appear that this sequence is finite. Instead, its (local) density within the primes seems to increase, from roughly 25% for the first terms to about 50% at 10^30. (End)
The function f is discussed in A138750. Composed with the nextprime function and restricted to the primes (cf. A138751), it yields a ("natural") variant of the Collatz function on the set of the primes, with (mod 2) replaced by (mod 3). The gb-sequences are the orbits under that function. - M. F. Hasler, Nov 18 2018
REFERENCES
Communication paper by Georges Brougnard.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..6470
Georges Brougnard, Definition of GB-sequences.
Georges Brougnard, GB-sequence of length 96, obtained for gb[0]=1381.
Georges Brougnard, GB-sequence of length 63337, obtained for gb[0]=4499221.
FORMULA
Recurrence for a gb-sequence starting with gb(0) = a prime > 2 (the seed):
| If gb(n) = 2 (mod 3) then gb(n+1) := least prime > gb(n)/2;
| otherwise gb(n+1) := least prime > gb(n)*2.
A gb-sequence of length L ends in the loop 7, 17, 11, 7, ... ; gb(L-1) = 7.
EXAMPLE
Example: a(1) = 5 because there is no prime gb(n) such that gb(n+1) = 5.
MATHEMATICA
lim = PrimePi[1000]; f[p_ /; Mod[p, 3] == 2] := p/2; f[p_] := 2*p; Complement[Prime[Range[lim]], Table[ NextPrime[ f[Prime[k]]], {k, 1, 2*lim}]] (* Jean-François Alcover, Sep 20 2011 *)
PROG
From M. F. Hasler, Mar 27 2008: (Start)
(PARI) {forprime( p=3, 10^3, for( i=precprime(p-1)+1, p, (2*i)%3==0 & isprime(2*i-1) & next(2); i%2==0 & ( i/2 )%3!=2 & isprime( i/2 ) & next(2)); print1( p", " ))}
nextA124123(p)={ while( p=nextprime(p+1), for( i=precprime(p-1)+1, p, (2*i)%3==0 & isprime(2*i-1) & next(2); i%2==0 & ( i/2 )%3!=2 & isprime( i/2 ) & next(2)); return( p )) }
t=2; vector(200, i, t=nextA124123(t)) \\ 60% of the first 200 terms are in 1+3Z:
t=[0, 0]; vector(#%, i, t[%[i]%3]++); t \\ yields [120, 80]
t=10^11; vector(200, i, t=nextA124123(t)) \\ exactly 50% of these terms are in 1+3Z:
t=[0, 0]; vector(#%, i, t[%[i]%3]++); t \\ yields [100, 100]
t=10^30; vector(200, i, t=nextA124123(t+1)); t-10^30 \\ yields 31773 = distance of 200th term beyond 10^30
t=10^30; vector(200, i, t=nextprime(t+1)); (t-1e30)/% \\ yields 0.52..., approx. local density in the primes. (End)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jacques Tramu, Dec 13 2006
EXTENSIONS
Edited by M. F. Hasler, Mar 27 2008, Nov 18 2018
STATUS
approved