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 17 results. Next

A325961 a(n) is the least k >= A061228(n)-1 such that n-k and n-(sigma(n)-k) are relatively prime, or 0 if no such k <= sigma(n) exists.

Original entry on oeis.org

1, 3, 0, 5, 0, 7, 0, 9, 11, 11, 0, 13, 0, 15, 20, 17, 0, 19, 0, 21, 24, 23, 0, 25, 29, 27, 30, 29, 0, 31, 0, 33, 38, 35, 40, 37, 0, 39, 42, 41, 0, 43, 0, 45, 50, 47, 0, 49, 55, 51, 58, 53, 0, 55, 60, 57, 60, 59, 0, 61, 0, 63, 66, 65, 70, 67, 0, 69, 74, 71, 0, 73, 0, 75, 78, 77, 84, 79, 0, 81, 83, 83, 0, 85, 90, 87, 92, 89, 0, 91, 100
Offset: 1

Views

Author

Antti Karttunen, May 29 2019

Keywords

Comments

a(n) attains the value of A325818(n) only with n = 1, 2 and the even terms of A000396. Note that A000203(n) > ((n+A020639(n))-1) with composite n.

Crossrefs

Programs

  • PARI
    A020639(n) = if(1==n, n, factor(n)[1, 1]);
    A325961(n) = { my(s=sigma(n)); for(i=(-1)+n+A020639(n), s, if(1==gcd(n-i, n-(s-i)), return(i))); (0); };

Formula

a(n) = 0 if and only if n is either an odd prime or an odd perfect number, but if n is neither, then a(n) = 2n - A325962(n).

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

A070229 Next m>n such that m is divisible by lpf(n), lpf=A006530 largest prime factor.

Original entry on oeis.org

2, 4, 6, 6, 10, 9, 14, 10, 12, 15, 22, 15, 26, 21, 20, 18, 34, 21, 38, 25, 28, 33, 46, 27, 30, 39, 30, 35, 58, 35, 62, 34, 44, 51, 42, 39, 74, 57, 52, 45, 82, 49, 86, 55, 50, 69, 94, 51, 56, 55, 68, 65, 106, 57, 66, 63, 76, 87, 118, 65, 122
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2002

Keywords

Comments

Or, for n>1, n + (largest prime divisor of n). [Anne Robinson, daughter of Herman P. Robinson, Oct 08 1981]

Crossrefs

Cf. A036441.
Iterations: A076271 (start=1), A036441 (start=2), A123581 (start=3).

Programs

Formula

a(n) = (n/lpf(n)+1)*lpf(n).
a(n) = n+lpf(n) where lpf=A006530 largest prime factor. For example, a(14)=14+7=21 (instead of ((14/7)+1)*7). - Philippe Lallouet (philip.lallouet(AT)wanadoo.fr), Jun 14 2007

A046666 a(n) = n - (smallest prime dividing n).

Original entry on oeis.org

0, 0, 2, 0, 4, 0, 6, 6, 8, 0, 10, 0, 12, 12, 14, 0, 16, 0, 18, 18, 20, 0, 22, 20, 24, 24, 26, 0, 28, 0, 30, 30, 32, 30, 34, 0, 36, 36, 38, 0, 40, 0, 42, 42, 44, 0, 46, 42, 48, 48, 50, 0, 52, 50, 54, 54, 56, 0, 58, 0, 60, 60, 62, 60, 64, 0, 66, 66, 68, 0, 70, 0
Offset: 2

Views

Author

Keywords

Comments

From Reinhard Zumkeller, Jul 08 2010: (Start)
a(n)=0 iff n is not composite;
for composite n: a(n) = max(m: m < n and gcd(m,n) > 1). (End)

Crossrefs

Programs

Formula

a(n) = n - A020639(n). - Michel Marcus, Jan 07 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

A326074 Numbers n for which A326073(n) is equal to abs(1+A326146(n)).

Original entry on oeis.org

3, 6, 28, 221, 391, 496, 1189, 1421, 1961, 2419, 5429, 7811, 8128, 11659, 15049, 18871, 36581, 44461, 48689, 57721, 80851, 86519, 98431, 107869, 117739, 146171, 169511, 181829, 207761, 235421, 240199, 280151, 312131, 387349, 437669, 497951, 525991, 637981, 685801, 735349, 752249, 804101, 885119, 950821, 1009009
Offset: 1

Views

Author

Antti Karttunen, Jun 10 2019

Keywords

Comments

Numbers n such that 1+(A001065(n)-A020639(n)) is not zero and divides 1+n-A020639(n).
Note that whenever n is even, then the above condition reduces to "(even) numbers n such that A048050(n) is not zero and divides n-1", which is a condition satisfied only by the even terms of A000396.
a(375) = 360866239 = 449 * 509 * 1579 is the first term with more than two distinct prime factors, the second is a(392) = 413733139 = 199 * 239 * 8699, and the third is a(485) = 718660177 = 41 * 853 * 20549.
Question: Are any of these terms present also in A326064 and A326148? None of the first 564 terms are. If such intersections are empty, then there are no odd perfect numbers.
If one selects only semiprimes from this sequence, one is left with 6, 221, 391, 1189, 1961, 2419, 5429, 7811, 11659, 15049, 18871, 36581, ... (555 terms out of the first 564 terms). Their smaller prime factors are: 2, 13, 17, 29, 37, 41, 61, 73, 89, 101, 113, 157, 173, 181, 197, 233, 241, 257, 269, 281, 313, ... while their larger prime factors are: 3, 17, 23, 41, 53, 59, 89, 107, 131, 149, 167, 233, 257, 269, 293, 347, 359, 383, 401, 419, 467, 503, 521, ..., and both sequences of primes seem to be monotonic.

Crossrefs

Cf. A000396 (a subsequence, the even terms of this sequence if there are no odd perfect numbers).

Programs

A159475 a(1) = 1; for n >= 1, a(n) is the smallest number m > n such that gcd(n,m) > 1.

Original entry on oeis.org

1, 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

Jaroslav Krizek, Apr 13 2009

Keywords

Comments

Essentially the same as A061228. [R. J. Mathar, Apr 16 2009]

Crossrefs

Programs

  • Magma
    [1] cat [n + PrimeDivisors(n)[1]: n in [2..100]]; // Vincenzo Librandi, Dec 02 2018
  • Mathematica
    f[n_]:= n + FactorInteger[n][[1, 1]]; Join[{1}, Array[f, 70, 2]] (* Vincenzo Librandi, Dec 02 2018 *)
  • PARI
    a(n) = if (n==1, 1, n+factor(n)[1,1]); \\ Michel Marcus, Dec 02 2018
    

Formula

If n = Product (p_i^e_i), where p_1 < p_2 < ... < p_k, a(n) = n + p_1. For p = primes (A000040), a(p) = 2*p.
a(n) = n + A020639(n), for n > 1. - Michel Marcus, Dec 02 2018

Extensions

More terms from Michel Marcus, Dec 02 2018

A177980 Iterate (n + lpf(n)) / 2 until a prime is reached, where lpf equals the least prime factor. a(n) is that terminating prime.

Original entry on oeis.org

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

Views

Author

Grant Garcia, Dec 16 2010

Keywords

Comments

The function (n + lpf(n)) / 2 reduces the input according to its lowest prime factor if it is composite or simply returns the input if it is prime.
Sequence contains only prime numbers (and every prime number).

Examples

			7 is prime, so (7 + lpf(7)) / 2 = (7 + 7) / 2 = 7.
15 is composite: (15 + 3) / 2 = 9, (9 + 3) / 2 = 6, (6 + 2) / 2 = 4, (4 + 2) / 2 = 3.
		

Crossrefs

Programs

  • Mathematica
    g[n_] := (n + FactorInteger[n][[1, 1]])/2; f[n_] := Last@ NestWhileList[g, n, !PrimeQ@ # &]; Array[f, 73, 2]
  • Python
    from sympy import factorint, isprime
    def a177980(n):
        while True:
            if isprime(n): return n
            else: n=int((n+A020639(n))/2)
    [a177980(n) for n in range(2, 160)] # Dumitru Damian, Dec 15 2021

A326146 a(n) = sigma(n) - A020639(n) - n, where A020639 gives the smallest prime factor of n, and sigma is the sum of divisors of n.

Original entry on oeis.org

-1, -1, -2, 1, -4, 4, -6, 5, 1, 6, -10, 14, -12, 8, 6, 13, -16, 19, -18, 20, 8, 12, -22, 34, 1, 14, 10, 26, -28, 40, -30, 29, 12, 18, 8, 53, -36, 20, 14, 48, -40, 52, -42, 38, 30, 24, -46, 74, 1, 41, 18, 44, -52, 64, 12, 62, 20, 30, -58, 106, -60, 32, 38, 61, 14, 76, -66, 56, 24, 72, -70, 121, -72, 38, 46, 62, 12, 88
Offset: 1

Views

Author

Antti Karttunen, Jun 10 2019

Keywords

Crossrefs

Programs

Formula

a(n) = A000203(n) - A020639(n) - n = A000203(n) - A061228(n).
a(n) = A001065(n) - A020639(n).
For n > 1, a(n) = A105086(n) - n.

A087349 a(n) = n + (smallest prime-factor of n+1).

Original entry on oeis.org

3, 5, 5, 9, 7, 13, 9, 11, 11, 21, 13, 25, 15, 17, 17, 33, 19, 37, 21, 23, 23, 45, 25, 29, 27, 29, 29, 57, 31, 61, 33, 35, 35, 39, 37, 73, 39, 41, 41, 81, 43, 85, 45, 47, 47, 93, 49, 55, 51, 53, 53, 105, 55, 59, 57, 59, 59, 117, 61, 121, 63, 65, 65, 69, 67, 133, 69, 71, 71
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 20 2003

Keywords

Crossrefs

Programs

  • Haskell
    a087349 n = a020639 (n + 1) + n  -- Reinhard Zumkeller, Mar 31 2014
    
  • Mathematica
    a[n_] := n + FactorInteger[n+1][[1,1]]; Array[a, 100] (* Amiram Eldar, Apr 10 2025 *)
  • PARI
    a(n) = n + factor(n+1)[1,1]; \\ Amiram Eldar, Apr 10 2025

Formula

a(n) = n + A020639(n+1).
a(n) = A061228(n+1) - 1.
Showing 1-10 of 17 results. Next