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-6 of 6 results.

A174221 a(n) = n/2 if n is even, otherwise add to n the next three primes > n.

Original entry on oeis.org

0, 11, 1, 26, 2, 36, 3, 48, 4, 50, 5, 60, 6, 72, 7, 74, 8, 88, 9, 102, 10, 104, 11, 120, 12, 122, 13, 124, 14, 138, 15, 152, 16, 154, 17, 156, 18, 168, 19, 170, 20, 184, 21, 202, 22, 204, 23, 220, 24, 222, 25, 224, 26, 240, 27, 242, 28, 244, 29, 258, 30, 272, 31, 274, 32, 276, 33, 290, 34, 292, 35, 306, 36, 324, 37, 326, 38, 328, 39, 348, 40, 350, 41, 370, 42
Offset: 0

Views

Author

N. J. A. Sloane, Nov 26 2010

Keywords

Comments

Related to the PrimeLatz conjecture, which states that if this map k -> a(k) is iterated, starting at any n >= 0, then the trajectory will eventually enter a loop.
Computations have shown that up to 10^8, there is only one loop (apart from the fixed point 0). It is given for example by terms 2 through 31 of A193230, the smallest of its 30 elements being 9.
See A293980 for the number of iterations required to reach an element of this loop, and for further study of trajectories under iterations of this map.

References

  • Eric Angelini, Posting to Math Fun Mailing List, Nov 26, 2010
  • Bill Thurston, Posting to Math Fun Mailing List, Nov 26, 2010

Crossrefs

Bisection gives A174223.
Cf. A193230 (trajectory of 1 under this map), A293979 (trajectory of 83), A293980.

Programs

  • Maple
    f:=proc(n) local p; p:=nextprime;
    if n mod 2 = 0 then n/2 else
    n+p(n)+p(p(n))+p(p(p(n))); fi; end;
  • Mathematica
    Array[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 85, 0] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    A174221(n)=bittest(n,0)||return(n\2);n+sum(c=1,3,n=nextprime(n+1)) \\ M. F. Hasler, Oct 25 2017

A293980 Number of iterations of A174221 (the PrimeLatz map) required to enter a loop, for initial value n, or -1 if this never happens.

Original entry on oeis.org

0, 1, 2, 1, 3, 1, 2, 6, 4, 0, 2, 0, 3, 0, 7, 0, 5, 0, 0, 14, 3, 0, 0, 2, 4, 0, 0, 21, 8, 29, 0, 18, 6, 12, 0, 69, 0, 0, 15, 66, 4, 6, 0, 21, 0, 15, 3, 31, 5, 39, 0, 12, 0, 3, 22, 28, 9, 2, 30, 25, 0, 0, 19, 6, 7, 30, 13, 19, 0, 27, 70, 11, 0, 24, 0, 30, 16, 10, 67, 15, 5, 21, 7, 16180, 0
Offset: 0

Views

Author

M. F. Hasler, Oct 25 2017

Keywords

Comments

Apart from the fixed point 0, the only known loop of A174221 appears to be (9, 50, 25, 122, 61, 272, 136, 68, 34, 17, 88, 44, 22, 11, 60, 30, 15, 74, 37, 168, 84, 42, 21, 104, 52, 26, 13, 72, 36, 18), of length 30. This has been verified up to 10^8.
The trajectory of all positive numbers considered so far enters this loop.
If n is a term of that loop (or n = 0), then a(n) = 0. For any positive integer not part of this loop, a(n) is the number of iterations of A174221 until an element of this loop is reached. It can also be defined as the number of iterations until reaching a number which already occurred earlier in the orbit, minus the number of iterations needed to see that number again (which appears to be 30 for all positive integers).
The trajectory of most positive integers merges very soon (say, in a(n) < 100 steps for most n < 1000) into the above loop. For example, starting with 1, one enters this loop right after the first iteration, cf. A193230.
The most remarkable exception is n = 83, which has an orbit of 16180 + 30 elements. A few other small numbers (141, 147, 151, 161, 166, 185, ...) merge within a few steps into the same trajectory (cf. examples), and have an orbit of roughly the same size. See A293979 for more about the trajectory of 83.
The number n = 443 is another exception, with a(n) = 9066, and a trajectory that merges into that of 83 only after 8853 iterations, cf. A293978.
The numbers 418 -> 209 -> 870 -> 435 -> ... also have a comparatively large orbit of about 940 + 30 elements, completely disjoint from that of 83 apart from the loop (which is entered at the value 60, while the orbit of 83 enters it at 26).

Examples

			Starting with 1 (cf. A193230), one gets 1 -> A174221(1) = (1 + 2 + 3 + 5) = 11 which is part of the loop, therefore a(1) = 1. Without having precomputed the loop, one can also iterate until a value occurs for the second time. This would give 1 -> 11 -> 60 -> 30 -> 15 -> 74 -> 37 -> 168 -> 84 -> 42 -> 21 -> 104 -> 52 -> 26 -> 13 -> 72 -> 36 -> 18 -> 9 -> 50 -> 25 -> 122 -> 61 -> 272 -> 136 -> 68 -> 34 -> 17 -> 88 -> 44 -> 22 -> 11: After 31 iterations one gets again 11 which was already there after the first iteration. Since the loop is of length 30, it was entered after 31 - 30 = 1 iteration(s).
Starting with 83, it takes 16179 iterations to reach 3 (not yet in the loop) and one more to reach 26, an element of the loop. In this orbit, the largest value is 10780054699424618132644155893087038044817868609971935265882538442720, reached after 8337 iterations. See A293979 for the trajectory of 83.
The few other n (141, 147, 151, 161, 166, 185, ...) which have an orbit larger than 100 elements mostly have trajectories that merge quite soon into that of 83 (-> 370 -> 185, and 161 -> 664 -> 332 -> 166 -> 83, and 147 -> 604 -> 302 -> 151 -> (6 more steps) -> 675 -> 2726 -> (23 more steps) -> 370, and 141 -> (36 more steps) -> 5452 -> 2726. Therefore these have an orbit of roughly the same size, a(n) ~ 16200. See the comments for the exceptions.
		

Crossrefs

Cf. A174221 (main entry), A174223.
Cf. A193230 (orbit of 1), A293979 (orbit of 83), A293978 (orbit of 443).

Programs

  • Mathematica
    Array[LengthWhile[#, Function[k, k != Last@ #]] &@ NestWhileList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, #, UnsameQ, All] &, 82] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    S=Set(vector(t=30,i,t=A174221(t))); A293980(n)={n&&for(k=0,oo,setsearch(S,n)&&return(k);n=A174221(n))} \\ Uses the hypothesis that Orbit(30) = Orbit(9) is the only "loop". (Precomputed and stored in global variable S.)
    A293980(n,A=vector(30))={n&&for(k=0,oo,A[k%30+1]==n&&return(k-30);n=A174221(A[k%30+1]=n))} \\ Alternative code: store the 30 most recently computed values and stop when a(k) = a(k-30). Roughly the same speed; does not require the precomputed loop & global variable S. Would also work for another hypothetical loop of length 30. Could easily be modified to detect loops of other length, not without performance hit: most efficient would probably be to keep both, a sorted (Set) and unsorted (i.e., "chronological") record of the last N values.)

A293979 Start with 83; if even, divide by 2; if odd, add next three primes: Orbit of 83 under iterations of A174221, the "PrimeLatz" map.

Original entry on oeis.org

83, 370, 185, 766, 383, 1570, 785, 3178, 1589, 6394, 3197, 12826, 6413, 25710, 12855, 51536, 25768, 12884, 6442, 3221, 12954, 6477, 25970, 12985, 51996, 25998, 12999, 52010, 26005, 104072, 52036, 26018, 13009, 52122, 26061, 104350, 52175, 208716, 104358
Offset: 0

Views

Author

M. F. Hasler, Oct 26 2017

Keywords

Comments

Periodic with period of length 30, starting at a(16180) = 26.
Angelini conjectures that the trajectory under A174221 becomes periodic for any initial value. He called this the PrimeLatz conjecture (as tribute to L. Collatz, known for the 3n+1 conjecture).
It has been checked that the loop (9, ..., 18) (= A193230(19..48)) is the only loop (except for the fixed point 0) at least up to values not exceeding 10^8, and the trajectory of every positive integer <= 10^4 does end in this loop.
See A293980 for the number of iterations required to reach an element of this loop, depending on the starting value.
Most small initial values have a very small orbit of few more than the 30 elements of the loop. N = 83 = a(0) is the most remarkable exception (having an orbit of 16180 + 30 elements), which motivates this sequence. Of course, the trajectory of any N = a(n)*2^k, e.g., 2*83 = 166, 4*83 = 332, 8*83 = 664, 2*370 = 740, ..., merges into the same orbit after k steps.
N = 443 = A293978(0) is another exception, with an orbit of 9066+30 elements (see A293978), and N = 209 also has a comparatively large orbit of 941 + 30 elements, distinct from those of 83 and 443.

Examples

			The initial value a(0) = 83 is odd, so we add to 83 the next 3 primes (89, 97 and 101) to get a(1) = 370.
370 is even, so we divide by 2 to get a(2) = 185, and so on.
After 8337 iterations, we get a(8337) = 10780054699424618132644155893087038044817868609971935265882538442720. This is the largest value we will reach. Since this is even we divide by 2 to get a(8338).
The result a(8338) is again even, so we divide by 2 once more to get a(8339), and so on...
After iteration 16171, we reach a(16171) = 768. The next 8 iterations consist of dividing by 2, until we get a(16179) = 3. Since this is odd, we add the next three primes (5, 7 and 11) to reach a(16180) = 26 = A193230(14). This is an element of the loop: 30 iterations later, we get again 26, and the sequence has become periodic.
		

Crossrefs

Cf. A174221, A293980, A293978 (orbit of 443), A193230 (orbit of 1).

Programs

  • Mathematica
    NestList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 83, 101]
  • PARI
    vector(100,i,t=if(i>1,A174221(t),83))

A293978 Start with 443; if even, divide by 2; if odd, add next three primes: Orbit of 443 under iterations of A174221, the "PrimeLatz" map.

Original entry on oeis.org

443, 1810, 905, 3642, 1821, 7322, 3661, 14682, 7341, 29410, 14705, 58858, 29429, 117762, 58881, 235568, 117784, 58892, 29446, 14723, 58932, 29466, 14733, 58958, 29479, 117990, 58995, 236012, 118006, 59003, 236044, 118022, 59011, 236084, 118042, 59021, 236124, 118062, 59031, 236198, 118099, 472536, 236268
Offset: 0

Views

Author

M. F. Hasler, Oct 26 2017

Keywords

Comments

Periodic with period 30, starting at a(9066) = 26 = A193230(14), see there for the next 30 elements which form the repeating part, a.k.a. loop.
Angelini conjectures that the orbit under A174221 becomes periodic for any initial value. He calls this the PrimeLatz conjecture (as a tribute to L. Collatz, known for the 3n+1 conjecture).
It has been checked that the loop (9, ..., 18) (= A193230(19..48)) is the only loop (except for the fixed point 0) at least up to values not exceeding 10^8, and the orbit of every positive integer <= 10^4 does end in this loop. See A293980 for the number of iterations required to reach an element of this loop.
Most small numbers (say, n < 1000) have very small orbits, and they converge into the above mentioned loop within a few iterations. The most remarkable exception is n = 83, whose orbit of 16210 elements is given in A293979. The second largest orbit (for "small" initial values) is that of 443, given here. It merges only near the end into that of 83, cf. Example section. Of course, the trajectory of any N = a(n)*2^k, e.g. 2*443 = 886, merges into the same orbit after k steps.

Examples

			The initial value a(0) = 443 is odd, so we add to 443 the next 3 primes (449, 457 and 461) to get a(1) = 1810.
1810 is even, so we divide by 2 to get a(2) = 905, and so on.
After 2324 iterations, we get a(2324) = 4691214813495590981789155675545600. This is the largest value we will reach.
Since a(2324) is even, we divide by 2 to get a(2325), which is again even. This happens 12 times in a row; only after dividing by 2 for 13 times do we again reach an odd value, a(2337).
After 8853 iterations, we reach a(8853) = 3702 = A293979(15967). From here on, the tail of the orbit is the same as that of 83: 212 iterations later we get a(9065) = 3. Since this is odd, we add the next three primes (5, 7 and 11) to reach a(9066) = 26 = A193230(14). This is an element of the loop: 30 iterations later, we again get 26, and the sequence has become periodic.
		

Crossrefs

Cf. A174221, A293980, A293979 (orbit of 83), A193230 (orbit of 1, includes the "loop" from the 2nd term of that sequence on).

Programs

  • Mathematica
    NestList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 83, 101]
  • PARI
    vector(100,i,t=if(i>1,A174221(t),443))

A174223 Add to 2n+1 the next three primes > 2n+1.

Original entry on oeis.org

11, 26, 36, 48, 50, 60, 72, 74, 88, 102, 104, 120, 122, 124, 138, 152, 154, 156, 168, 170, 184, 202, 204, 220, 222, 224, 240, 242, 244, 258, 272, 274, 276, 290, 292, 306, 324, 326, 328, 348, 350, 370, 372, 374, 390, 392, 394, 396, 408, 410, 420, 432, 434, 456, 480, 482, 508, 510, 512, 514, 516, 518, 520, 534, 536, 556, 558, 560, 576, 596, 598, 600, 602, 604
Offset: 0

Views

Author

N. J. A. Sloane, Nov 26 2010

Keywords

Comments

Bisection of A174221.

Crossrefs

Programs

  • Mathematica
    Array[Total@ Prepend[NextPrime[#, {1, 2, 3}], #] &[2 # + 1] &, 74, 0] (* Michael De Vlieger, Oct 25 2017 *)
  • PARI
    A174223(n)=sum(c=1, 3, n=nextprime(n+1),n=2*n+1) \\ M. F. Hasler, Oct 25 2017
    
  • Python
    from sympy import nextprime
    def a(n):
        base = 2*n + 1
        p1 = nextprime(base)
        p2 = nextprime(p1)
        p3 = nextprime(p2)
        return base + p1 + p2 + p3
    print([a(n) for n in range(74)]) # Michael S. Branicky, Nov 26 2021

A293981 Start with 209; if even, divide by 2; if odd, add the next three primes: Trajectory of 209 under iterations of A174221, the "PrimeLatz" map.

Original entry on oeis.org

209, 870, 435, 1766, 883, 3588, 1794, 897, 3634, 1817, 7318, 3659, 14680, 7340, 3670, 1835, 7410, 3705, 14860, 7430, 3715, 14894, 7447, 29814, 14907, 59698, 29849, 119430, 59715, 238910, 119455, 477960, 238980, 119490, 59745, 239016, 119508, 59754, 29877, 119554, 59777
Offset: 0

Views

Author

M. F. Hasler, Oct 31 2017

Keywords

Comments

Periodic with period of length 30, starting at a(941) = 60.
Angelini conjectures that the trajectory under A174221 becomes periodic for any initial value. He called this the PrimeLatz conjecture (as tribute to L. Collatz, known for the 3n+1 conjecture).
It has been checked that the loop (9, ..., 18) (= A193230(19..48)) is the only loop (except for the fixed point 0) at least up to values not exceeding 10^8 (result due to Hans Havermann), and the trajectory of every positive integer <= 10^4 does end in this loop.
See A293980 for the number of iterations required to reach an element of this loop, depending on the starting value.
Most small initial values have a very small orbit of few more than the 30 elements of the loop. N = 83 = A293979(0) is the most remarkable exception, having an orbit of 16180 + 30 elements, cf. A293979.
N = 443 = A293978(0) is another exception, with an orbit of 9066+30 elements (see A293978).
N = 209 has the third largest genuinely different orbit among small initial values (of course, any N = 2^k*a(n) merges into the sequence a(n) after k steps), of 941 + 30 elements. This motivates the present sequence.
The fact that the loop is entered at a(941) = 60 = A193230(2), while the trajectories of 83 and 443 enter the loop at the term 26 = A193230(14), prove that this orbit is genuinely different from that of 83 and 443.
The horizontal rays in the graph correspond to factors of 2: division by 2 is one possible step, and for large numbers adding the next 3 primes roughly amounts to multiplying the value by 4, the prime gaps being "negligible".

Examples

			The initial value a(0) = 209 is odd, so we add to 209 the next 3 primes (211, 223 and 227) to get a(1) = 870.
a(1) = 870 is even, so we divide by 2 to get a(2) = 435, and so on.
After 667 iterations, we get a(667) = 517468668525760. This is the largest value we will reach. Since this is even we divide by 2 to get a(668).
The result a(668) is again even, so we divide by 2 once more to get a(669), and so on...
After iteration 935, we reach a(935) = 3840. The next 6 iterations consist of dividing by 2, until we get a(941) = 60 = A193230(2). This is an element of the loop: after dividing two more times by 2 and 28 other iterations later, we get again 60, and the sequence has become periodic.
		

Crossrefs

Cf. A174221, A293980, A293979 (orbit of 83), A293978 (orbit of 443), A193230 (orbit of 1, essentially the apparently unique "loop" of A174221).

Programs

  • Mathematica
    NestList[If[EvenQ@ #, #/2, Total@ Prepend[NextPrime[#, {1, 2, 3}], #]] &, 83, 101]
  • PARI
    vector(100,i,t=if(i>1,A174221(t),209))
Showing 1-6 of 6 results.