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.

Showing 1-3 of 3 results.

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

Views

Author

Keywords

Examples

			(47-1)/2=23(prime);(23-1)/2=11(prime); (11-1)/2=5(prime); (5-1)/2=2.
		

Crossrefs

Subsequence of A165801.

Programs

  • Mathematica
    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

Extensions

Edited by Charles R Greathouse IV, Oct 05 2009

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

Views

Author

Keywords

Comments

For initial values n > 3, the map is applied at least once, so 9 is in the sequence although it is not a prime. The sequence consists of p = 2 and p = 3 and the two finite chains of primes that are formed by repeated application of p -> 2*p + 3, which are 2 -> 7 -> 17 -> 37 -> 77 and 3 -> 9.

Examples

			(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).
		

Crossrefs

Programs

  • Mathematica
    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 *)

Extensions

Edited by Jon E. Schoenfield, Dec 01 2013
Further edited by N. J. A. Sloane, Dec 02 2013

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

Views

Author

Keywords

Comments

Starting from n, the trajectory of repeated application of x -> x - ceiling(x/2), as represented by A008619, is monitored until it reaches 2 or 3. If the trajectory (ignoring the initial n) contains only primes, n is added to the sequence.
We are essentially requiring a chain of safe primes A005385 down to 2 or 3, in search of reverse Cunningham chains of the first type.
There are no more terms between 95 and 10000000. - R. J. Mathar, Sep 29 2009
No more terms between 95 and 1500000000 (i.e., 1.5*10^9). - Owen Whitby, Oct 16 2009
There are no terms larger than 95, which can be seen by following the chains up from 2 and 3. The only primes that go to 2 or 3 via the map x -> x - ceiling(x/2) are 5 and 7. The only prime that goes to 5 or 7 via that map is 11. The only prime that goes to 11 is 23, the only prime that goes to 23 is 47, and no prime number maps to 47 (since 95 is not prime). Thus the only numbers that can produce prime chains in this way are numbers x such that x-ceiling(x/2) is in {1,2,3,5,7,11,23,47}. - Nathaniel Johnston, Nov 22 2010

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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

Extensions

Edited by R. J. Mathar, Sep 29 2009
Showing 1-3 of 3 results.