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.

A356438 Numbers k such that A309892(k) = k/gpf(k), where gpf = A006530.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 19, 20, 21, 22, 23, 25, 26, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 46, 47, 49, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 73, 74, 76, 77, 78, 79, 82, 83, 85
Offset: 1

Views

Author

Jianing Song, Aug 07 2022

Keywords

Comments

Note that A309892(k) <= k/gpf(k); these sequence lists k such that the equality holds.
For k >= 2, k is a term if and only if k/gpf(k) < nextprime(gpf(k)), where nextprime = A151800.

Examples

			15 is a term since the number of steps needed to reach 0 of the iteration x -> x - gpf(x) starting at 15 is 3: 15 -> 10 -> 5 -> 0, and 3 = 15/gpf(15).
		

Crossrefs

Other than 1, indices of 1 in A356428.
Includes A000040 and A001358 as subsequences.
Complement of A356441.

Programs

  • PARI
    isA356438(n) = if(n>1, my(p=vecmax(factor(n)[, 1])); n/p
    				

A356441 Numbers k such that A309892(k) < k/gpf(k), where gpf = A006530; complement of A356438.

Original entry on oeis.org

8, 16, 18, 24, 27, 32, 36, 40, 45, 48, 50, 54, 60, 64, 72, 75, 80, 81, 84, 90, 96, 98, 100, 105, 108, 112, 120, 125, 126, 128, 135, 140, 144, 147, 150, 154, 160, 162, 165, 168, 175, 176, 180, 189, 192, 196, 198, 200, 210, 216, 220, 224, 225, 231, 234, 240, 242, 243
Offset: 1

Views

Author

Jianing Song, Aug 07 2022

Keywords

Comments

k is a term if and only if k/gpf(k) > nextprime(gpf(k)), where nextprime = A151800.

Examples

			8 is a term since the number of steps needed to reach 0 of the iteration x -> x - gpf(x) starting at 8 is 3: 8 -> 6 -> 3 -> 0, and 3 < 8/gpf(8).
		

Crossrefs

Programs

  • PARI
    isA356441(n) = if(n>1, my(p=vecmax(factor(n)[, 1])); n/p>nextprime(p+1), 0)

A175126 a(0) = a(1) = 0, for n >= 2, a(n) = number of steps of iteration of {r - (smallest prime divisor of r)} needed to reach 0 starting at r = n.

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 3, 1, 4, 4, 5, 1, 6, 1, 7, 7, 8, 1, 9, 1, 10, 10, 11, 1, 12, 11, 13, 13, 14, 1, 15, 1, 16, 16, 17, 16, 18, 1, 19, 19, 20, 1, 21, 1, 22, 22, 23, 1, 24, 22, 25, 25, 26, 1, 27, 26, 28, 28, 29, 1, 30, 1, 31, 31, 32, 31, 33, 1, 34, 34, 35, 1, 36, 1, 37, 37, 38, 36, 39, 1, 40, 40
Offset: 0

Views

Author

Jaroslav Krizek, Feb 15 2010

Keywords

Comments

See A005843 and A175127 for the smallest and greatest numbers m such that a(m) = k for k >= 2.

Examples

			Example (a(6)=3): 6-2=4, 4-2=2, 2-2=0; iterations has 3 steps.
a(25) = 11, as we have 25 -> 20 -> 18 -> 16 -> 14 -> 12 -> 10 -> 8 -> 6 -> 4 -> 2 -> 0, in total eleven steps to reach zero. - _Antti Karttunen_, Aug 22 2019
		

Crossrefs

From a(2) on, one more than A046667.

Programs

  • Maple
    Contribution from R. J. Mathar, Mar 11 2010: (Start)
    A020639 := proc(n) min(op(numtheory[factorset](n))) ; end proc:
    A046666 := proc(n) n-A020639(n) ; end proc:
    A175126 := proc(n) local a; if n = 1 then 0; elif n = 0 then 0; else 1+procname(A046666(n)) ; end if; end proc:
    seq(A175126(n),n=1..100) ; (End)
  • Mathematica
    stps[n_]:=Length[NestWhileList[#-FactorInteger[#][[1,1]]&,n,#>0&]]-1; Join[{0},Rest[Array[stps,90]]] (* Harvey P. Dale, Aug 15 2012 *)
  • PARI
    A020639(n) = if(1==n, n, factor(n)[1, 1]);
    A175126(n) = if(n<2,0,1+A175126(n-A020639(n))); \\ Antti Karttunen, Aug 22 2019
    
  • PARI
    a(n) = if(n>1, (n-factor(n)[1, 1])/2 + 1, 0) \\ Jianing Song, Aug 07 2022

Formula

a(2n) = n >= 2; a(p) = 1 for p = prime.
a(n) = 0 if n<=1, else a(n) = 1+a(A046666(n)). - R. J. Mathar, Mar 11 2010
a(n) = (n-lpf(n))/2 + 1 for n > 1, lpf = A020639. - Jianing Song, Aug 07 2022

Extensions

Corrected A-number typo in the comment - R. J. Mathar, Mar 11 2010
Extended beyond a(30) by R. J. Mathar, Mar 11 2010
Term a(0) = 0 prepended by Antti Karttunen, Aug 22 2019

A356428 a(0) = a(1) = 0; for n > 1, a(n) is the number of distinct gpf(x)'s in the iterations x -> x - gpf(x) starting at n and ending at 0, where gpf = A006530.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1
Offset: 0

Views

Author

Jianing Song, Aug 07 2022

Keywords

Comments

Conjecture: sequence is unbounded. Since a(n) - a(n-gpf(n)) = 0 or 1 (see the formula below), this would imply that every number occurs in this sequence. But it seems that the bigger terms appear rather late: 6 does not appear until a(6664), and 7 does not appear until a(135450) (see A356429).
The last largest prime p in this iteration is found when p^2 > x in this iteration. - David A. Corneth, Aug 09 2022

Examples

			In the following examples the numbers produced by the iterations are listed together with their GPFs.
48 (3) -> 45 (5) -> 40 (5) -> 35 (7) -> ... -> 7 (7) -> 0, the distinct gpf(x)'s are 3, 5, and 7, so a(48) = 3.
96 (3) -> 93 (31) -> 62 (31) -> 31 (31) -> 0, the distinct gpf(x)'s are 3 and 31, so a(96) = 2.
320 (5) -> 315 (7) -> 308 (11) -> 297 (11) -> 286 (13) -> 273 (13) -> 260 (13) -> 247 (19) -> ... -> 19 (19) -> 0, the distinct gpf(x)'s are 5, 7, 11, 13, and 19, so a(320) = 5.
In the above computation for a(320) the calculation can stop at 247 (19) as all largest prime factors in positive x are 19. - _David A. Corneth_, Aug 09 2022
		

Crossrefs

Programs

  • PARI
    gpf(n) = vecmax(factor(n)[, 1]);
    a(n) = if(n>1, my(s=n, k=0, p); while(s, p=gpf(s); s-=p; k+=(s==0)||(gpf(s)>p)); k, 0)
    
  • PARI
    a(n) = {if(n <= 1, return(0)); my(cn = n, maxpr, pr = List()); while(cn > 1, maxpr = h(cn); listput(pr, maxpr); cn-=maxpr; if(maxpr^2 > cn, return(#Set(pr)))); #Set(pr)}
    h(n) = {my(f = factor(n)); f[#f~, 1]} \\ David A. Corneth, Aug 08 2022
    
  • Python
    from sympy import factorint
    def gpf(n): return 1 if n == 1 else max(factorint(n))
    def a(n):
        s = set()
        while n != 0: g = gpf(n); s.add(g); n = n - g
        return len(s - {1})
    print([a(n) for n in range(92)]) # Michael S. Branicky, Aug 08 2022

Formula

For n > 1, let p = gpf(n), then a(n) = 1+a(n-p) if p = n or gpf(n-p) > p; otherwise a(n) = a(n-p).

A356427 a(0) = 0, a(1) = 1; for n > 1, a(n) is the last step before reaching 0 of the iterations x -> x - gpf(x) starting at n, where gpf = A006530.

Original entry on oeis.org

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

Views

Author

Jianing Song, Aug 07 2022

Keywords

Comments

For n > 1, a(n) is the unique prime in the iterations x -> x - gpf(x) starting at n and ending at 0.

Examples

			In the following examples the numbers produced by the iterations are listed together with their GPFs.
48 (3) -> 45 (5) -> 40 (5) -> 35 (7) -> ... -> 7 (7) -> 0, so a(48) = 7.
96 (3) -> 93 (31) -> 62 (31) -> 31 (31) -> 0, so a(96) = 31.
		

Crossrefs

Programs

  • PARI
    a(n) = if(n>1, my(s=n); while(!isprime(s), s=s-vecmax(factor(s)[, 1])); s, n)

Formula

For n > 0, a(n) = gpf(n) if n is in A356438; otherwise a(n) > gpf(n).

A356429 Smallest m such that A356428(m) = n, or -1 if there is no such m.

Original entry on oeis.org

2, 8, 48, 315, 320, 6664, 135450, 273000, 518661, 519440, 519622, 148830266, 558797841, 558797968, 24900609294
Offset: 1

Views

Author

Jianing Song, Aug 07 2022

Keywords

Comments

a(n) is the smallest m such that there are exactly n distinct gpf(x)'s in the iterations x -> x - gpf(x) starting at m and ending at 0, where gpf = A006530.
Conjecture: a(n) != -1 for all n. This would be true if A356428 is unbounded; otherwise, this sequence consists of entirely -1's after some point.
Since A356428(n) - A356428(n-gpf(n)) = 0 or 1, sequence is strictly increasing if no term equals -1.
If a(m) > -1 for m >= 15 then a(m) > 10^9. - David A. Corneth, Aug 09 2022

Examples

			In the following examples the numbers produced by the iterations are listed together with their GPFs.
320 (5) -> 315 (7) -> 308 (11) -> 297 (11) -> 286 (13) -> 273 (13) -> 260 (13) -> 247 (19) -> ... -> 19 (19) -> 0, the distinct gpf(x)'s are 5, 7, 11, 13, and 19. 320 is the smallest number such that the distinct gpf(x)'s in the iterations is 5, so a(5) = 320.
6664 (17) -> 6647 (23) -> 6624 (23) -> 6601 (41) -> 6560 (41) -> 6519 (53) -> 6466 (53) -> 6413 (53) -> 6360 (53) -> 6307 (53) -> 6254 (59) -> 6195 (59) -> 6136 (59) -> 6077 (103) -> ... -> 103 (103) -> 0, the distinct gpf(x)'s are 17, 23, 41, 53, 59, and 103. 6664 is the smallest number such that the distinct gpf(x)'s in the iterations is 6, so a(6) = 6664.
		

Crossrefs

Extensions

a(12) from Michael S. Branicky, Aug 08 2022
a(13)-a(14) from David A. Corneth, Aug 09 2022
a(15) from Jinyuan Wang, Jul 07 2025
Showing 1-6 of 6 results.