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

A308190 Number of steps to reach 5 when iterating x -> A111234(x) starting at x=n.

Original entry on oeis.org

0, 1, 3, 2, 2, 4, 4, 3, 4, 3, 3, 5, 6, 5, 5, 4, 5, 5, 5, 4, 5, 4, 4, 6, 8, 7, 7, 6, 4, 6, 4, 5, 7, 6, 6, 6, 7, 6, 6, 5, 6, 6, 6, 5, 4, 5, 5, 7, 10, 9, 6, 8, 6, 8, 8, 7, 6, 5, 5, 7, 6, 5, 7, 6, 5, 8, 8, 7, 8, 7, 7, 7, 6, 8, 8, 7, 8, 7, 7, 6, 6, 7, 7, 7, 8, 7, 5, 6, 7, 5, 5, 6, 7, 6, 6, 8, 12
Offset: 5

Views

Author

N. J. A. Sloane, Jun 14 2019

Keywords

Comments

It is easy to show that every number n >= 5 eventually reaches 5. This was conjectured by Ali Sada. For A111234 sends a composite n > 5 to a smaller number, and sends a prime > 5 to a smaller number in two steps. Furthermore no number >= 5 can reach a number less than 5. So all numbers >= 5 eventually reach 5.

References

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{c = 0, x = n, y}, While[x != 5, y = Min[FactorInteger[x][[All, 1]]]; x = y + Quotient[x, y]; c++]; c];
    Table[a[n], {n, 5, 100}] (* Jean-François Alcover, Jun 15 2019, from Python *)
  • Python
    from sympy import factorint
    def A308190(n):
        c, x = 0, n
        while x != 5:
            y = min(factorint(x))
            x = y + x//y
            c += 1
        return c # Chai Wah Wu, Jun 14 2019

A068319 a(n) = if n <= lpf(n)^2 then lpf(n) else a(lpf(n) + n/lpf(n)), where lpf = least prime factor, A020639.

Original entry on oeis.org

1, 2, 3, 2, 5, 5, 7, 5, 3, 7, 11, 5, 13, 3, 5, 7, 17, 11, 19, 5, 7, 13, 23, 3, 5, 5, 5, 7, 29, 17, 31, 11, 3, 19, 5, 5, 37, 7, 7, 13, 41, 23, 43, 3, 11, 5, 47, 5, 7, 5, 5, 7, 53, 29, 7, 17, 13, 31, 59, 11, 61, 3, 3, 19, 11, 5, 67, 5, 5, 37, 71, 7, 73, 7
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 27 2002, Jul 13 2007

Keywords

Comments

n>1: a(n) is prime and a(n)=n iff n is prime.
a(n) = if n <= A088377(n) then A020639(n) else a(A111234(n)).

Examples

			a(12)=a(2*6)=a(8)=a(2*4)=a(6)=a(2*3)=a(5)=a(5*1)=5.
		

Crossrefs

Cf. A032742.

Programs

  • Haskell
    a068319 n = if n <= spf ^ 2 then spf else a068319 $ spf + div n spf
                where spf = a020639 n
    -- Reinhard Zumkeller, Jun 24 2013
  • Mathematica
    lpf[n_] := FactorInteger[n][[1, 1]]; a[n_] := a[n] = If[n <= lpf[n]^2, lpf[n], a[lpf[n] + n/lpf[n]]]; Table[a[n], {n, 1, 74}](* Jean-François Alcover, Dec 21 2011 *)

A308191 a(n) = smallest m such that A308190(m) = n, or -1 if no such m exists.

Original entry on oeis.org

5, 6, 8, 7, 10, 16, 17, 30, 29, 54, 53, 102, 101, 198, 197, 390, 389, 774, 773, 1542, 3080, 3079, 6154, 12304, 24604, 36901, 73798, 147592, 295180, 295517, 591030, 1182056, 1574849, 3149694, 4728211, 6299383, 12598762, 25197520, 25197533, 50395062, 100790120, 100790119, 201580234, 403160464, 806320924, 1232145821, 2464291638
Offset: 0

Views

Author

N. J. A. Sloane, Jun 14 2019

Keywords

Comments

It seems plausible that m exists for all n >= 0.
From Chai Wah Wu, Jun 14 2019: (Start)
All terms are even or prime. If a(n+1) is even, then 2*a(n)-a(n+1) = 4. a(n+1) <= 2*(a(n)-2) and thus m exists for all n >= 0. The proof in the comments of A308193 is applicable for this sequence as well.
If a(n) is prime, then a(n-1) <= a(n) + 1. For the prime terms 7, 17, 29, 53, 101, 197, 389, 773, 3079, 100790119, a(n-1) = a(n) + 1.
(End)

Crossrefs

Extensions

a(24)-a(41) from Chai Wah Wu, Jun 14 2019
a(42)-a(44) from Chai Wah Wu, Jun 15 2019
a(45)-a(46) from Chai Wah Wu, Jun 16 2019

A308193 Indices of records in A308190.

Original entry on oeis.org

5, 6, 7, 10, 16, 17, 29, 53, 101, 197, 389, 773, 1542, 3079, 6154, 12304, 24604, 36901, 73798, 147592, 295180, 295517, 591030, 1182056, 1574849, 3149694, 4728211, 6299383, 12598762, 25197520, 25197533, 50395062, 100790119, 201580234, 403160464, 806320924, 1232145821, 2464291638
Offset: 1

Views

Author

N. J. A. Sloane, Jun 14 2019

Keywords

Comments

For terms a(1) through a(16), with one exception, 2*a(n) - a(n+1) is either 4 or 5. Does this pattern continue, and if so, why?
From Chai Wah Wu, Jun 14 2019: (Start)
The pattern does not continue. a(17) = 24604, a(18) = 36901.
Theorem:
1. All terms are even or prime.
2. If a(n+1) is even, then 2*a(n)-a(n+1) = 4.
3. a(n+1) <= 2*(a(n)-2).
Proof: If a(n+1) = x is even, then A111234(x) = 2+x/2 = y. If we assume that x >= 6, then y < x. Thus A308190(x) = A308190(y)+1, i.e., a(n) <= y. If a(n) < y, then A308190(2*(a(n)-2)) = A308190(a(n)) + 1.
Since a(n) is a record value, this means that the next record value is at most at 2*(a(n)-2), i.e., 2*(a(n)-2) < x = a(n+1), a contradiction.
Thus we have shown that if a(n+1) is even, then 2*a(n) = a(n+1)+4.
If a(n+1) = x is an odd composite with smallest prime factor p > 2, then A308190(x) = A308190(y)+1 where y = p+x/p. On the other hand, A308190(2*(y-2)) = A308190(y)+1. Since 2*(y-2) < x, this contradicts the fact that a(n+1) = x is a record value.
(End)

Crossrefs

Extensions

a(17)-a(36) from Chai Wah Wu, Jun 14 2019
a(37)-a(38) from Chai Wah Wu, Jun 16 2019

A140777 a(n) = 2*prime(n) - 4.

Original entry on oeis.org

0, 2, 6, 10, 18, 22, 30, 34, 42, 54, 58, 70, 78, 82, 90, 102, 114, 118, 130, 138, 142, 154, 162, 174, 190, 198, 202, 210, 214, 222, 250, 258, 270, 274, 294, 298, 310, 322, 330, 342, 354, 358, 378, 382, 390, 394, 418, 442, 450, 454, 462, 474, 478, 498, 510, 522
Offset: 1

Views

Author

Leroy Quet, May 29 2008, May 31 2008

Keywords

Comments

A number n is included if (p + n/p) is prime, where p is the smallest prime that divides n. Since all terms of this sequence are even (or otherwise p + n/p would be even and not a prime), p is always 2. So this sequence is the set of all even numbers n where (2 + n/2) is prime.
The entries are also encountered via the bilinear transform approximation to the natural log (unit circle). Specifically, evaluating 2(x-1)/(x+1) at x = 2, 3, 4, ..., the terms of this sequence are seen ahead of each new prime encountered. Additionally, the position of those same primes will occur at the entry positions. For clarity, the evaluation output is 2, 3, 1, 1, 6, 5, 4, 3, 10, 7, 3, 2, 14, 9, 8, 5, 18, 11, ..., where the entries ahead of each new prime are 2, 6, 10, 18, ... . As an aside, the same mechanism links this sequence to A165355. - Bill McEachen, Jan 08 2015
As a follow-up to previous comment, it appears that the numerators and denominators of 2(x-1)/(x+1) are respectively given by A145979 and A060819, but with different offsets. - Michel Marcus, Jan 14 2015
Subset of the union of A017641 & A017593. - Michel Marcus, Sep 01 2020

Examples

			The smallest prime dividing 42 is 2. Since 2 + 42/2 = 23 is prime, 42 is included in this sequence.
		

Crossrefs

Programs

  • Magma
    [2*NthPrime(n)-4: n in [1..80]]; // Vincenzo Librandi, Feb 19 2015
  • Maple
    A020639 := proc(n) local dvs,p ; dvs := sort(convert(numtheory[divisors](n),list)) ; for p in dvs do if isprime(p) then RETURN(p) ; fi ; od: error("%d",n) ; end: A111234 := proc(n) local p ; p := A020639(n) ; p+n/p ; end: isA140777 := proc(n) RETURN(isprime(A111234(n))) ; end: for n from 2 to 1200 do if isA140777(n) then printf("%d,",n) ; fi ; od: # R. J. Mathar, May 31 2008
    seq(2*ithprime(i)-4, i=1..1000); # Robert Israel, Jan 09 2015
  • Mathematica
    fQ[n_] := Block[{p = First@ First@ Transpose@ FactorInteger@ n}, PrimeQ[p + n/p] == True]; Select[ Range[2, 533], fQ@# &] (* Robert G. Wilson v, May 30 2008 *)
    Table[2 Prime[n] - 4, {n, 60}] (* Vincenzo Librandi, Feb 19 2015 *)
  • PARI
    vector(100, n, 2*prime(n) - 4) \\ Michel Marcus, Jan 09 2015
    

Formula

a(n) = 2*A040976(n). - Michel Marcus, Jan 09 2015

Extensions

More terms from Robert G. Wilson v and R. J. Mathar, May 30 2008

A308194 Number of steps to reach 5 when iterating x -> A063655(x) starting at x=n.

Original entry on oeis.org

0, 1, 3, 2, 2, 4, 5, 4, 4, 3, 3, 3, 4, 3, 4, 3, 5, 5, 6, 5, 5, 4, 5, 6, 7, 6, 6, 5, 4, 5, 5, 5, 7, 6, 4, 5, 6, 5, 5, 4, 4, 6, 5, 4, 4, 4, 4, 5, 5, 4, 4, 4, 6, 7, 5, 4, 6, 5, 4, 4, 4, 5, 7, 6, 5, 5, 6, 5, 6, 5, 4, 7, 4, 5, 5, 4, 4, 6, 6, 5, 6, 5, 6, 5, 6, 5, 4, 6, 6, 5, 6, 4, 7, 6, 4, 4, 8, 7, 7, 6, 6, 5
Offset: 5

Views

Author

N. J. A. Sloane, Jun 14 2019

Keywords

Comments

It is easy to show that every number n >= 5 eventually reaches 5. This was conjectured by Ali Sada. For A111234 sends a composite n > 5 to a smaller number, and sends a prime > 5 to a smaller number in two steps. Furthermore no number >= 5 can reach a number less than 5. So all numbers >= 5 eventually reach 5.

References

Crossrefs

Programs

  • PARI
    b(n) = { my(c=1); fordiv(n, d, if((d*d)>=n, if((d*d)==n, return(2*d), return(c+d))); c=d); (0); } \\ after A063655
    a(n) = for (k=0, oo, if (n==5, return (k), n=b(n))) \\ Rémy Sigrist, Jun 14 2019
    
  • Python
    from sympy import divisors
    def A308194(n):
        c, x = 0, n
        while x != 5:
            d = divisors(x)
            l = len(d)
            x = d[(l-1)//2] + d[l//2]
            c += 1
        return c # Chai Wah Wu, Jun 14 2019

A308192 Record values in A308190.

Original entry on oeis.org

0, 1, 3, 4, 5, 6, 8, 10, 12, 14, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54
Offset: 1

Views

Author

N. J. A. Sloane, Jun 14 2019

Keywords

Crossrefs

Extensions

a(17)-a(36) from Chai Wah Wu, Jun 14 2019
a(37)-a(38) from Chai Wah Wu, Jun 16 2019
a(39)-a(41) from Chai Wah Wu, Jun 17 2019
a(42)-a(45) from Chai Wah Wu, Jun 24 2019
Showing 1-7 of 7 results.