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

A063041 Image of n under Collatz-2 map, a generalization of the classical '3x+1' - function: instead of dividing an even number by 2 a nonprime will be divided by its smallest prime factor and a prime will be multiplied not by 3 but by its prime-predecessor, before one is added.

Original entry on oeis.org

3, 7, 2, 16, 3, 36, 4, 3, 5, 78, 6, 144, 7, 5, 8, 222, 9, 324, 10, 7, 11, 438, 12, 5, 13, 9, 14, 668, 15, 900, 16, 11, 17, 7, 18, 1148, 19, 13, 20, 1518, 21, 1764, 22, 15, 23, 2022, 24, 7, 25, 17, 26, 2492, 27, 11, 28, 19, 29, 3128, 30, 3600, 31, 21, 32, 13, 33, 4088, 34, 23
Offset: 2

Views

Author

Reinhard Zumkeller, Jul 07 2001

Keywords

Examples

			a(17) = 17 * 13 = 222 as 17 is prime and 13 is the largest prime < 17; a(4537) = 349 as 4537 = 13 * 349 hence lpf(4537) = 13; other examples in A063042, A063043, A063044.
For n=2, its prime-predecessor is taken as 1 (because 2 is the first prime), thus a(2) = (1*2)+1 = 3.
		

Crossrefs

Cf. A063042, A063043, A063044, A280707 (trajectories starting from 3, 17, 29 and 47).

Programs

  • Mathematica
    Join[{3}, Table[If[PrimeQ[n], n*Prime[PrimePi[n]-1]+1, n/Min[First/@FactorInteger[n]]], {n,3,69}]] (* Jayanta Basu, May 27 2013 *)
  • Python
    from sympy import isprime, prevprime, primefactors
    def f(n): return 1 if n == 2 else prevprime(n)
    def a(n): return n*f(n)+1 if isprime(n) else n//min(primefactors(n))
    print([a(n) for n in range(2, 70)]) # Michael S. Branicky, Apr 17 2023
  • Scheme
    (define (A063041 n) (if (= 1 (A010051 n)) (+ 1 (* (A064989 n) n)) (A032742 n))) ;; Antti Karttunen, Jan 23 2017
    

Formula

a(n) = if n prime then (n * pp(n) + 1) else (n / lpf(n)) for n > 1 where pp(n) = if n > 2 then Max{p prime | p < n} else 1; [prime-predecessor] and lpf(n) = if n > 2 then Min{p prime | p < n and p divides n} else 1; [where lpf = A020639].
If A010051(n) = 1 [when n is a prime], a(n) = 1 + (A064989(n)*n), otherwise a(n) = A032742(n). - Antti Karttunen, Jan 23 2017

Extensions

More terms from Matthew Conroy, Jul 15 2001
Description clarified by Antti Karttunen, Jan 23 2017

A280707 Collatz-2 (A063041) trajectory starting at 47.

Original entry on oeis.org

47, 2022, 1011, 337, 111548, 55774, 27887, 353, 123198, 61599, 20533, 421357694, 210678847, 44385566460664754, 22192783230332377, 1707137171564029, 165918667661, 27529004277737692540278, 13764502138868846270139, 4588167379622948756713, 352935952278688365901, 3237944516318241889, 1577861856421, 2489648037916767181800822
Offset: 0

Views

Author

Antti Karttunen, Jan 23 2017

Keywords

Comments

Will this sequence ever settle into a finite cycle?

Crossrefs

Programs

  • PARI
    A032742(n) = if(1==n,n,n/vecmin(factor(n)[,1]));
    A063041(n) = if(2==n,3,if(isprime(n),1+(precprime(n-1)*n),A032742(n)));
    n = 0; k = 47; while(n <= 41, write("b280707.txt", n, " ", k); k = A063041(k); n = n+1);

Formula

a(0) = 47 and for n > 1, a(n) = A063041(a(n-1)).
Showing 1-2 of 2 results.