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-10 of 13 results. Next

A269045 Indices k such that A006255(k) != A070229(k); that is, the k-th term of R. L. Graham's sequence is not equal to k + lpf(k).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 28, 30, 32, 35, 36, 40, 42, 45, 48, 49, 50, 54, 56, 60, 63, 64, 66, 70, 72, 75, 77, 80, 81, 84, 90, 91, 96, 98, 99, 100, 104, 105, 108, 110, 112, 120, 121, 125, 126, 128, 130, 132, 135, 140, 143, 144
Offset: 1

Views

Author

Peter Kagey, Feb 22 2016

Keywords

Crossrefs

Complement of A255363.

A255363 Numbers with the property that A006255(k) = A070229(k).

Original entry on oeis.org

5, 7, 11, 13, 14, 17, 19, 21, 22, 23, 26, 29, 31, 33, 34, 37, 38, 39, 41, 43, 44, 46, 47, 51, 52, 53, 55, 57, 58, 59, 61, 62, 65, 67, 68, 69, 71, 73, 74, 76, 78, 79, 82, 83, 85, 86, 87, 88, 89, 92, 93, 94, 95, 97, 101, 102, 103, 106, 107, 109, 111, 113, 114
Offset: 1

Views

Author

Peter Kagey, Feb 21 2015

Keywords

Comments

A070229(n) is a lower bound of A006255(n) for all n in A102750.
This list contains all primes greater than 3 and no perfect squares.
Let k be a fixed integer, then k*p is found in this list for all sufficiently large primes p.

A323135 a(n) is the least number of iterations that n requires to reach a power of a prime under the map x -> A070229(x), or -1 if we never reach a power of a prime.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 3, 0, 5, 2, 0, 0, 5, 0, 1, 4, 9, 0, 1, 0, 11, 0, 3, 0, 3, 0, 0, 8, 15, 2, 11, 0, 17, 10, 9, 0, 1, 0, 7, 8, 21, 0, 15, 0, 7, 14, 9, 0, 17, 6, 7, 16, 27, 0, 9, 0, 29, 6, 0, 8, 5, 0, 13, 20, 5, 0, 15, 0, 35, 14, 15, 4, 7, 0, 13, 0
Offset: 1

Views

Author

Rémy Sigrist, Jan 05 2019

Keywords

Comments

The powers of primes correspond to A000961.
Apparently, a(n) >= 0 for any n > 0.
For a given number n, while iterating A070229, we may encounter several prime increments (=several greatest prime factors). It is likely that the number of distinct increments before reaching a power of a prime is not bounded.
For k = 0..9, the least numbers with k distinct increments are:
k n Increments
- ------ ------------------------------------------
0 1 {}
1 6 {3}
2 12 {3, 5}
3 72 {3, 5, 17}
4 135 {5, 7, 11, 17}
5 686 {7, 11, 13, 19, 41}
6 12408 {47, 53, 59, 71, 89, 149}
7 35378 {19, 23, 67, 89, 101, 179, 211}
8 127581 {43, 53, 73, 103, 113, 227, 283, 457}
9 222111 {37, 79, 97, 191, 233, 239, 311, 359, 631}

Examples

			For n = 12:
- 12 = 2^2 * 3,
- A070229(12) = 12 + 3 = 15 = 3 * 5,
- A070229(15) = 15 + 5 = 20 = 2^2 * 5,
- A070229(20) = 20 + 5 = 25 = 5^5,
- hence we need at least 3 iterations of A070229 to reach a power of a prime,
- and a(12) = 3.
		

Crossrefs

See A323136 for the corresponding powers of primes.

Programs

  • PARI
    a(n) = for (k=0, oo, if (omega(n) <= 1, return (k), my (f=factor(n)); n += f[#f~, 1]))

Formula

a(n) = 0 iff n belongs to A000961.

A323136 a(n) is the least power of a prime that n reaches under the map x -> A070229(x), or -1 if we never reach a power of a prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 7, 8, 9, 25, 11, 25, 13, 49, 25, 16, 17, 49, 19, 25, 49, 121, 23, 27, 25, 169, 27, 49, 29, 49, 31, 32, 121, 289, 49, 169, 37, 361, 169, 121, 41, 49, 43, 121, 121, 529, 47, 289, 49, 121, 289, 169, 53, 361, 121, 121, 361, 841, 59, 169, 61, 961
Offset: 1

Views

Author

Rémy Sigrist, Jan 05 2019

Keywords

Comments

The powers of primes correspond to A000961.
Apparently, a(n) > 0 for all n > 0.

Examples

			For n = 12:
- 12 = 2^2 * 3,
- A070229(12) = 12 + 3 = 15 = 3 * 5,
- A070229(15) = 15 + 5 = 20 = 2^2 * 5,
- A070229(20) = 20 + 5 = 25 = 5^5,
- hence a(12) = 25.
		

Crossrefs

See A323135 for the corresponding number of iterations.

Programs

  • PARI
    a(n) = for (k=0, oo, if (omega(n) <= 1, return (n), my (f=factor(n)); n += f[#f~, 1]))

Formula

a(n) = n iff n belongs to A000961.
A006530(a(n)) >= A006530(n) when a(n) > 0.

A334245 Let S = A061228, T = A070229, and F = S o T (where o denotes composition). Then a(n) is the least number in the intersection of the sequences F^k(n) and F^k(S(n)), k>=0, or the intersection of the sequences T(F^k(n)) and T(F^k(S(n))), k>=0, or 0 if these intersections are empty.

Original entry on oeis.org

12, 12, 12, 15, 12, 30, 15, 21, 15, 77, 21, 77, 30, 77, 30, 77, 30, 57, 77, 30, 77, 91, 77, 77, 77, 77, 35, 105, 77, 133, 77, 91, 77, 60, 77, 111, 57, 77, 77, 133, 77, 165, 91, 65, 91, 147, 60, 105, 65, 70, 65, 165, 77, 105, 105, 91, 105, 180, 133, 231, 133, 91, 105, 105, 105, 234, 105, 147, 91
Offset: 2

Views

Author

Ali Sada and Robert Israel, Apr 19 2020

Keywords

Comments

60420 >= a(n) > 0 for n <= 6042, but either a(6043) = 0 or a(6043) > 10^30.
If p is prime, a(p) = a(2*p).
From n = 5, 55, 2, 24, 245, ... begin successive strings of exactly 1, 2, 3, 4, 5, ... identical merging points that are: 15, 105, 12, 77, 713, ... . - Bernard Schott, Jul 04 2020

Examples

			For n=5, 15 = T(F(5)) = T(S(5)) so a(5) = 15.
For n=6, 12 = F(6) = F(S(6)) so a(6) = 12.
For n=10, 15 = T(10) = T(F(10)) so a(10) = 15.
		

Crossrefs

Programs

  • Maple
    S:= x -> x + min(numtheory:-factorset(x)):
    T:= x -> x + max(numtheory:-factorset(x)):
    f:= proc(n) local s,t,i,j,ct;
      s:= S(n); i:= 0; t:= T(n); j:= 1;
      for ct from 1 to 1000 do
        if s = t and i=j then return s fi;
        if s <= t then
          if i = 0 then s:= T(s); i:= 1
          else s:= S(s); i:= 0
          fi
        elif j = 0 then t:= T(t); j:= 1
        else t:= S(t); j:= 0
        fi
      od;
      0
    end proc:
    map(f, [$2..100]);
  • Mathematica
    S[x_] := x + FactorInteger[x][[1, 1]];
    T[x_] := x + FactorInteger[x][[-1, 1]];
    f[n_] := Module[{s = S[n], t = T[n], i = 0, j = 1, ct}, For[ct = 1, ct <= 1000, ct++, If[s == t && i == j, Return[s]]; If[s <= t, If[i == 0, s = T[s]; i = 1, s = S[s]; i = 0], If[j == 0, t = T[t]; j = 1, t = S[t]; j = 0]]]; 0];
    f /@ Range[2, 100] (* Jean-François Alcover, Aug 15 2020, after Maple *)

Formula

a(2^m+2) = a(2^m). - Bernard Schott, Jun 27 2020

A006255 R. L. Graham's sequence: a(n) = smallest m for which there is a sequence n = b_1 < b_2 < ... < b_t = m such that b_1*b_2*...*b_t is a perfect square.

Original entry on oeis.org

1, 6, 8, 4, 10, 12, 14, 15, 9, 18, 22, 20, 26, 21, 24, 16, 34, 27, 38, 30, 28, 33, 46, 32, 25, 39, 35, 40, 58, 42, 62, 45, 44, 51, 48, 36, 74, 57, 52, 50, 82, 56, 86, 55, 60, 69, 94, 54, 49, 63, 68, 65, 106, 70, 66, 72, 76, 87, 118, 75, 122, 93, 77, 64, 78, 80, 134, 85, 92, 84
Offset: 1

Views

Author

Keywords

Comments

Every nonprime appears exactly once in this sequence.
If n is a square we can take t=1 and a(n) = n. If n is a prime > 3, then a(n) = 2n and t=3. If n is twice a prime, say p, then a(n) = 3p most of the time. The sequence b_1 < b_2 < ... < b_t will not contain either perfect squares or primes for they bring nothing to the solution. Also I know of no n such that t = 2. - Robert G. Wilson v, Jan 30 2002
Let k be a fixed integer and p be a prime, then a(k*p) = (k+1)*p for sufficiently large p. - Peter Kagey, Feb 03 2015
From David A. Corneth, Oct 26 2016: (Start)
Is for all k*p in A277624, a(k*p) = (k+1) * p?
Conjecture: Let b(n) = A006530(A007913(n)). If b(n)^2 >= 2 * n then a(n) = n + b(n) except for n = 3, 10, and 171.
(End)
a(n) <= A072905(n).
a(n) <= 2*n for all n > 3.
a(n) >= n + A006530(A007913(n)) for all nonsquare n. - Peter Kagey, Feb 21 2015

Examples

			a(2) = 6 because the best such sequence is 2,3,6.
For n = 3 through 6 the {smallest m then smallest t then smallest product} solutions are 3,6,8; 4; 5,8,10; 6,8,12.
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 2nd. ed., Problem 4.39, pages 147, 616, 533. [Reference revised by N. J. A. Sloane, Jan 13 2014]
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Having minimized m, next minimize t, then minimize product: A066400 and A066401 give values of t and square root of b_1*...*b_t.
If squares are omitted we get A233421.
A067565 is the inverse of R. L. Graham's sequence.

Programs

  • Mathematica
    Table[k = 0; Which[IntegerQ@ Sqrt@ n, k, And[PrimeQ@ n, n > 3], k = n, True, While[Length@ Select[n Map[Times @@ # &, n + Rest@ Subsets@ Range@ k], IntegerQ@ Sqrt@ # &] == 0, k++]]; k + n, {n, 40}] (* Michael De Vlieger, Oct 26 2016 *)

Formula

If n is a square we can take t=1 and a(n)=n.
a(n) = A245499(n,A066400(n)). - Reinhard Zumkeller, Jul 25 2014
a(n) = A092487(n) + n. - Peter Kagey, Oct 22 2016

Extensions

More terms from Robert G. Wilson v, Jan 30 2002
Erroneous program (pointed out by Peter Kagey) removed by Reinhard Zumkeller, Nov 28 2014

A061228 a(1) = 2, a(n) = smallest number greater than n that is not coprime to n.

Original entry on oeis.org

2, 4, 6, 6, 10, 8, 14, 10, 12, 12, 22, 14, 26, 16, 18, 18, 34, 20, 38, 22, 24, 24, 46, 26, 30, 28, 30, 30, 58, 32, 62, 34, 36, 36, 40, 38, 74, 40, 42, 42, 82, 44, 86, 46, 48, 48, 94, 50, 56, 52, 54, 54, 106, 56, 60, 58, 60, 60, 118, 62, 122, 64, 66, 66, 70, 68, 134, 70, 72, 72
Offset: 1

Views

Author

Amarnath Murthy, Apr 23 2001

Keywords

Examples

			a(9) = 12 as 10 and 11 are coprime to 9.
a(11) = 22 as 11 is a prime.
		

Crossrefs

Programs

  • Haskell
    a061228 n = n + a020639 n  -- Reinhard Zumkeller, May 06 2015
    
  • Maple
    for n from 1 to 150 do if n=1 then printf(`%d,`,2); fi: for k from n+1 to 2*n do if igcd(n,k)>1 then printf(`%d,`,k); break; fi: od: od:
    # alternative:
    2, seq(t + min(numtheory:-factorset(t)), t = 2..1000); # Robert Israel, Oct 21 2015
  • Mathematica
    Table[n+First@(First/@FactorInteger[n]),{n,200}] (* Vladimir Joseph Stephan Orlovsky, Apr 08 2011 *)
    nxt[{n_,a_}]:=Module[{c=n+2},While[CoprimeQ[n+1,c],c++];{n+1,c}]; NestList[nxt,{1,2},70][[;;,2]] (* Harvey P. Dale, May 21 2025 *)
  • PARI
    a(n) = n + if(n == 1, 1, factor(n)[1,1]); \\ Amiram Eldar, Apr 10 2025

Formula

a(n) = A020639(n) + n.
a(2m) = 2m+2, a(p) = 2p if p is a prime.
a(n) = n + the smallest divisor of n that is larger than 1, for n >= 2.
a(p^k) = p^k + p if p is prime. - Robert Israel, Oct 21 2015
a(n) = A087349(n-1) + 1 for n >= 2. - Amiram Eldar, Apr 10 2025

Extensions

More terms from James Sellers, Apr 24 2001

A076271 a(1) = 1, a(2) = 2, and for n > 2, a(n) = a(n-1) + gpf(a(n-1)), where gpf = greatest prime factor = A006530.

Original entry on oeis.org

1, 2, 4, 6, 9, 12, 15, 20, 25, 30, 35, 42, 49, 56, 63, 70, 77, 88, 99, 110, 121, 132, 143, 156, 169, 182, 195, 208, 221, 238, 255, 272, 289, 306, 323, 342, 361, 380, 399, 418, 437, 460, 483, 506, 529, 552, 575, 598, 621, 644, 667, 696, 725, 754, 783, 812, 841
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 04 2002

Keywords

Comments

a(n+1) is the smallest number such that the largest prime divisor of a(n) is the highest common factor of a(n) and a(n+1). - Amarnath Murthy, Oct 17 2002
Essentially the same as A036441(n) = a(n+1) and A180107(n) = a(n-1) (n > 1).
The equivalent sequence with A020639 = spf instead of A006530 = gpf begins a(1) = 1, a(2) = 2, and from then on we get all even numbers: a(n) = a(2) + 2*(n-2), n > 1. - M. F. Hasler, Apr 08 2015
From David James Sycamore, Apr 27 2017: (Start)
The sequence contains only one prime; a(2)=2, all other terms (excluding a(1)=1) being composite, since if a(n) for some n > 2 is assumed to be the first prime after 2, then a(n) = a(n-1) + gpf(a(n-1))= m*q+q = q*(m+1) for some integer m > 1 and some prime q. This number is composite; contradiction. Terms after a(3)=4 alternate between even and odd values since each is created by addition of a prime (odd term).
All terms a(n) arise as consecutive multiples of consecutive primes occurring in their natural ascending order, 2,3,5,7.... (A000040). The number of (consecutive) terms which arise as multiples of p(n)= A000040(n) is 1 + p(n+1)- p(n-1), namely n-th term of the sequence: 2,4,5,7,7,7,7,7,11, etc. Example: Number of multiples of 17, the 7th prime, is 1+p(8)-p(6) = 1+19-13 = 7.
For any pair of consecutive primes, p,q (p < q) a(p+q-1) = p*q, the (semiprime) term where multiples of p end and multiples of q start. Example a(7+11-1) = a(17) = 77 = 11*7, the last multiple of 7 and first multiple of 11. Every string of multiples of prime p contains the term p^2, located at a(2*p-1). E.g.: a(3)=4, a(5)=9, a(9)=25. (End)

Crossrefs

Cf. A036441, A076272(n) = a(n+1) - a(n).
See also A180107.
Cf. A070229.

Programs

  • Haskell
    a076271 n = a076271_list !! (n-1)
    a076271_list = iterate a070229 1  -- Reinhard Zumkeller, Nov 07 2015
  • Mathematica
    NestList[#+FactorInteger[#][[-1,1]]&,1,60] (* Harvey P. Dale, May 11 2015 *)
  • PARI
    print1(n=1);for(i=1,199,print1(","n+=A006530(n))) \\ M. F. Hasler, Apr 08 2015
    

Formula

a(A076274(n)) = A008578(n)^2 for all n.
a(n+1) = A070229(a(n)). - Reinhard Zumkeller, Nov 07 2015

Extensions

Edited by M. F. Hasler, Apr 08 2015

A076563 a(n) = n - greatest prime divisor of n, for n>1.

Original entry on oeis.org

0, 0, 2, 0, 3, 0, 6, 6, 5, 0, 9, 0, 7, 10, 14, 0, 15, 0, 15, 14, 11, 0, 21, 20, 13, 24, 21, 0, 25, 0, 30, 22, 17, 28, 33, 0, 19, 26, 35, 0, 35, 0, 33, 40, 23, 0, 45, 42, 45, 34, 39, 0, 51, 44, 49, 38, 29, 0, 55, 0, 31, 56, 62, 52, 55, 0, 51, 46, 63, 0, 69, 0, 37, 70, 57, 66, 65, 0, 75
Offset: 2

Views

Author

Zak Seidov, Oct 19 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[n-Last@(First/@FactorInteger[n]),{n,2,200}] (* Vladimir Joseph Stephan Orlovsky, Apr 08 2011 *)
  • PARI
    a(n) = n - vecmax(factor(n)[,1]); \\ Michel Marcus, Aug 07 2022
    
  • Python
    from sympy import factorint
    def a(n): return n - max(factorint(n))
    print([a(n) for n in range(2, 81)]) # Michael S. Branicky, Aug 07 2022

Formula

a(p) = 0 for prime p.
a(n) = n - A006530(n). - Michel Marcus, Jan 16 2015

A256393 Start from a(1) = 2, then alternately add either the largest (if n is even), or the smallest (if n is odd) prime factor of the preceding term a(n-1) to get a(n).

Original entry on oeis.org

2, 4, 6, 9, 12, 15, 18, 21, 24, 27, 30, 35, 40, 45, 48, 51, 54, 57, 60, 65, 70, 77, 84, 91, 98, 105, 108, 111, 114, 133, 140, 147, 150, 155, 160, 165, 168, 175, 180, 185, 190, 209, 220, 231, 234, 247, 260, 273, 276, 299, 312, 325, 330, 341, 352, 363, 366, 427
Offset: 1

Views

Author

Jan Guichelaar, Mar 28 2015

Keywords

Comments

After the initial term, each even-indexed term equals the preceding term plus its largest prime factor, and each odd-indexed term equals the preceding term plus its smallest prime factor.
See also sequence A076271 where a(n+1) = a(n) + lpf(a(n)).
Each term shares exactly one prime factor with the immediately preceding term, and because the sequence is strictly increasing, all the terms after 2 are composite. - Antti Karttunen, Apr 19 2015
From a(3) onward, the terms are alternately even and odd. - Jan Guichelaar, Apr 24 2015
a(2*n) = A070229(a(2*n-1)); a(2*n+1) = A061228(a(2*n)). - Reinhard Zumkeller, May 06 2015
For prime p let [p] denote the sequence with a(1)=p, and generated as for the terms of the current sequence (which according to this notation is then the same as [2]). It so happens that the sequence [p] (for any p?) merges with [2] sooner or later, taking the form of a "tree" as shown in the attached image (Including prime starts up to p=67). Is this pattern of merging bounded or not? Is there just one tree or are there many? Interesting to speculate. The numbers corresponding to the arrival points in [2] of [p] is the sequence 2,6,15,21,51,57,77,84.... The sequence of ("excluded") numbers which do not arise in [p] for any prime p starts as 8,16,20,25,28,32,36,44... Other sequences may refer to the number of iterations required to merge [p] into [2]. See tree picture. - David James Sycamore, Aug 25 2016
In this picture, one could also include some [c] sequences, with composite c, see A276269. - Michel Marcus, Aug 26 2016

Crossrefs

Cf. A006530 (greatest prime factor), A020639 (least prime factor), A076271.
Cf. A257244 (the first differences; the unique prime factors shared by each pair of successive terms), A257245, A257246 (their bisections), A257247 (numbers n such that GCD(a(2n-1),a(2n)) = GCD(a(2n),a(2n+1)), which is prime).

Programs

  • Haskell
    a256393 n = a256393_list !! (n-1)
    a256393_list = 2 : zipWith ($) (cycle [a070229, a061228]) a256393_list
    -- Reinhard Zumkeller, May 06 2015
  • Maple
    a[1]:= 2;
    for n from 2 to 100 do
      if n::even then a[n]:= a[n-1] + max(numtheory:-factorset(a[n-1]))
      else a[n]:= a[n-1] + min(numtheory:-factorset(a[n-1]))
      fi
    od:
    seq(a[i],i=1..100); # Robert Israel, May 03 2015
  • Mathematica
    f[n_] := Block[{pf = First /@ FactorInteger@ n}, If[EvenQ@ n, Max@ pf, Min@ pf]]; s = {2}; lmt = 58; For[k = 2, k <= lmt, k++, AppendTo[s, s[[k - 1]] + f@ s[[k - 1]]]]; s (* Michael De Vlieger, Apr 19 2015 *)
    FoldList[Function[f, If[EvenQ@ #2, #1 + First@ f, #1 + Last@ f]][FactorInteger[#1][[All, 1]]] &, Range[2, 59]] (* Michael De Vlieger, Aug 26 2016 *)
  • PARI
    lista(nn) = {print1(a = 2, ", "); for (n=2, nn, f = factor(a); if (n % 2, a += f[1, 1], a += f[#f~, 1]); print1(a, ", "););} \\ Michel Marcus, Apr 02 2015
    
  • Scheme
    ;; With memoization-macro definec.
    (definec (A256393 n) (cond ((= 1 n) 2) ((even? n) (+ (A256393 (- n 1)) (A006530 (A256393 (- n 1))))) (else (+ (A256393 (- n 1)) (A020639 (A256393 (- n 1))))))) ;; Antti Karttunen, Apr 18 2015
    

Formula

a(1) = 2; a(2n) = a(2n-1) + gpf(a(2n-1)), a(2n+1) = a(2n) + lpf(a(2n)), where gpf = greatest prime factor = A006530, lpf = least prime factor = A020639.

Extensions

More terms from Michel Marcus, Apr 02 2015
Replaced the name with more succinct description, moved old name to comments - Antti Karttunen, Apr 18-19 2015
Showing 1-10 of 13 results. Next