A165802
Primes p with f(p), f(f(p)), ... all prime, where f(n) = (n-1)/2. Stop when f(...f(p)...) is less than 4.
Original entry on oeis.org
2, 3, 5, 7, 11, 23, 47
Offset: 1
(47-1)/2=23(prime);(23-1)/2=11(prime); (11-1)/2=5(prime); (5-1)/2=2.
-
f[n_]:=Module[{k=n},While[k>3,k=(k-1)/2;If[ !PrimeQ[k],Break[]]];PrimeQ[k]]; lst={};Do[p=Prime[n];If[f[p],AppendTo[lst,p]],{n,5!}];lst
A165803
Integers n such that the trajectory of n under repeated applications of the map k->(k-3)/2 is a chain of primes that reaches 2 or 3 (n itself need not be a prime).
Original entry on oeis.org
2, 3, 7, 9, 17, 37, 77
Offset: 1
(77-3)/2 = 37 (prime); (37-3)/2 = 17 (prime); (17-3)/2 = 7 (prime); (7-3)/2 = 2; stop (because 2 has been reached).
-
f[n_] := Module[{k = n}, While[k > 3, k = (k - 3)/2; If[ !PrimeQ[k], Break[]]]; PrimeQ[k]]; A165803 = {}; Do[If[f[n], AppendTo[A165803, n]], {n, 5!}]; A165803
cpQ[n_]:=AllTrue[Rest[NestWhileList[(#-3)/2&,n,#!=2&!=3&,1,20]],PrimeQ]; Select[Range[100],cpQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 24 2019 *)
A165805
Integers that start a trajectory x -> A008619(x) which contains only primes until terminating at 2 or 3.
Original entry on oeis.org
2, 3, 4, 5, 6, 7, 10, 11, 14, 15, 22, 23, 46, 47, 94, 95
Offset: 1
The trajectories of starting with numbers from 91 to 96 are
91 -> 45 -> 22 -> 11 -> 5 -> 2
92 -> 46 -> 23 -> 11 -> 5 -> 2
93 -> 46 -> 23 -> 11 -> 5 -> 2
94 -> 47 -> 23 -> 11 -> 5 -> 2
95 -> 47 -> 23 -> 11 -> 5 -> 2
96 -> 48 -> 24 -> 12 -> 6 -> 3
The trajectories starting at 91 to 93 and 96 contain composites 45, 46 or 48 and their initial numbers do not qualify for the sequence. The trajectories starting at 94 and 95 contain only primes (47, 23, 11, 5, 2) and their two initial integers 94 and 95 are added to the sequence.
-
f[n_]:=Module[{k=n},While[k>3,k=k-Ceiling[k/2];If[ !PrimeQ[k],Break[]]]; PrimeQ[k]]; lst={};Do[If[f[n],AppendTo[lst,n]],{n,7!}];lst
Showing 1-3 of 3 results.
Comments