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.

A124123 Primes not of the form nextprime(f(p)) with p prime, where f(p)=p/2 if p=2 (mod 3), f(p)=2p otherwise (cf. A138750).

This page as a plain text file.
%I A124123 #38 May 16 2023 14:25:37
%S A124123 5,19,61,73,83,103,107,109,113,139,151,167,173,191,199,229,269,271,
%T A124123 277,313,337,349,359,379,397,439,463,503,523,563,571,601,607,619,733,
%U A124123 773,823,827,829,859,883,887,911,971,983,997,1013,1031,1063,1091,1093,1103
%N A124123 Primes not of the form nextprime(f(p)) with p prime, where f(p)=p/2 if p=2 (mod 3), f(p)=2p otherwise (cf. A138750).
%C A124123 These are the primes which cannot be part of a gb-sequence (except as seed).
%C A124123 Is this sequence finite or infinite?
%C A124123 From _M. F. Hasler_, Mar 27 2008: (Start)
%C A124123 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.
%C A124123 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.
%C A124123 This sequence lists primes p' not in the range of the map p -> nextprime(f(p)), defined on the primes.
%C A124123 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).
%C A124123 This characterization allows easy computation of the sequence, cf. PARI code.
%C A124123 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)
%C A124123 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
%D A124123 Communication paper by Georges Brougnard.
%H A124123 Vincenzo Librandi, <a href="/A124123/b124123.txt">Table of n, a(n) for n = 1..6470</a>
%H A124123 Georges Brougnard, <a href="https://www.echolalie.org/echolaliste/gbnums/gb0.jpg">Definition of GB-sequences</a>.
%H A124123 Georges Brougnard, <a href="https://www.echolalie.org/echolaliste/gbnums/gb1.jpg">GB-sequence of length 96, obtained for gb[0]=1381</a>.
%H A124123 Georges Brougnard, <a href="https://www.echolalie.org/echolaliste/gbnums/gb4.jpg">GB-sequence of length 63337, obtained for gb[0]=4499221</a>.
%F A124123 Complement of A007918(A138750(A000040)) = nextprime(f({primes})).
%F A124123 Recurrence for a gb-sequence starting with gb(0) = a prime > 2 (the seed):
%F A124123 | If gb(n) = 2 (mod 3) then gb(n+1) := least prime > gb(n)/2;
%F A124123 | otherwise gb(n+1) := least prime > gb(n)*2.
%F A124123 A gb-sequence of length L ends in the loop 7, 17, 11, 7, ... ; gb(L-1) = 7.
%e A124123 Example: a(1) = 5 because there is no prime gb(n) such that gb(n+1) = 5.
%t A124123 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 *)
%o A124123 From _M. F. Hasler_, Mar 27 2008: (Start)
%o A124123 (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", " ))}
%o A124123 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 )) }
%o A124123 t=2;vector(200,i,t=nextA124123(t)) \\ 60% of the first 200 terms are in 1+3Z:
%o A124123 t=[0,0];vector(#%,i,t[%[i]%3]++);t \\ yields [120, 80]
%o A124123 t=10^11;vector(200,i,t=nextA124123(t)) \\ exactly 50% of these terms are in 1+3Z:
%o A124123 t=[0,0];vector(#%,i,t[%[i]%3]++);t \\ yields [100, 100]
%o A124123 t=10^30;vector(200,i,t=nextA124123(t+1));t-10^30 \\ yields 31773 = distance of 200th term beyond 10^30
%o A124123 t=10^30;vector(200,i,t=nextprime(t+1));(t-1e30)/% \\ yields 0.52..., approx. local density in the primes. (End)
%Y A124123 Cf. A007918 (nextprime), A138750 (function f), A138751, A138752, A138753, A138754.
%K A124123 easy,nonn
%O A124123 1,1
%A A124123 _Jacques Tramu_, Dec 13 2006
%E A124123 Edited by _M. F. Hasler_, Mar 27 2008, Nov 18 2018