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.

Previous Showing 11-17 of 17 results.

A139416 a(n) is the smallest positive integer k such that d(k) = d(k+2*n) = 2*n, where d(m) (A000005) is the number of positive divisors of m, or 0 if no such k exists.

Original entry on oeis.org

3, 6, 12, 70, 600281, 60, 1458, 264, 450, 266875, 12670498046853, 480, 3998684814453099, 11968722, 299538, 3640, 49921080474853515591, 1980, 6107691150665283203125, 14960, 575047378296833, 4068173828125, 13936286848094463348388671875, 6552, 5035427051913
Offset: 1

Views

Author

Leroy Quet, Apr 20 2008

Keywords

Comments

Does this sequence have a term for every positive integer n, or are there no solutions for some n?
There is no solution for any odd positive integer n to d(k) = d(k+n) = n.
If n is prime, then a(n) exists if and only if there exist either three primes p, q, r such that p^(2*n-1) +- 2*n = q^(n-1)*r or four primes p_1, q_1, p_2, q_2 such that p_1^(n-1)*q_1 + 2*n = p_2^(n-1)*q_2. - Vladimir Shevelev, Jul 14 2015

Examples

			For a(4) we want the smallest integer m such that d(m) = d(m+8) = 8. The positive integers that have 8 divisors each form the sequence: 24, 30, 40, 42, 54, 56, 66, 70, 78, 88, 102, 104, 105, 110, ... (A030626)
The first (not necessarily adjacent) pair of integers with 8 divisors each that is separated by exactly 8 is (70,78). So a(4) is the least element of this pair, which is 70.
Let n=5, a(5) = 600281. According to our comment, 600281 is the smallest number such that there exist either three primes p, q, r such that p^9 +- 10 = q^4*r or four primes p_1, q_1, p_2, q_2 such that p_1^4*q_1 + 10 = p_2^4*q_2. Here p_1 = 11, q_1 = 41, p_2 = 3, q_2 = 7411. - _Vladimir Shevelev_, Jul 14 2015
		

Crossrefs

A subsequence of A175304.

Programs

  • Mathematica
    f[n_] := Block[{a = {}, d, k, lim = 1000000}, d[x_] := DivisorSigma[0, x]; Do[k = 1; While[Nand[d[k] == d[k + d[k]], d[k] == 2 i] && k <= lim, k++]; If[k > lim, AppendTo[a, 0], AppendTo[a, k]], {i, n}]; a]; f@ 10 (* Michael De Vlieger, Jul 13 2015 *)
  • PARI
    A_simple(n)=local(m=2);n*=2;until(numdiv(m)==n&numdiv(m+n)==n,m++);m
    A_try_pair(p,q,n,limit)=
    {
    /* Helper for A_prime() */
    /* Look for solution which is 0 mod p^(n-1) and -n*2 mod q^(n-1) */
    local(m = chinese(Mod(0,p^(n-1)), Mod(-n*2,q^(n-1))));
    forstep(x=lift(m), limit, component(m,1),
    if(isprime(x\p^(n-1)) & isprime((x+n*2)\q^(n-1)), return(x)));
    limit
    }
    A_try_above_below(m,n)=
    {
    /* Helper for A_prime() */
    /* Function presumes that numdiv(m)==n*2 */
    if(numdiv(m-n*2)==n*2, limit=m-n*2,
    if(numdiv(m+n*2)==n*2, limit=m,
    0))
    }
    A_prime(n,limit,pairmax=30)=
    {
    if (n%2==0 || !isprime(n), error("Only works for odd primes"));
    if (default(primelimit) < limit\nextprime(pairmax+1)^(n-1),
    default(primelimit, limit\nextprime(pairmax+1)^(n-1));
    );
    /* Evens with numdiv==n*2 are {2^(n*2-1)} u {2*p^(n-1)} u {2^(n-1)*p} */
    /* Potential solutions must come from different sets */
    /* Try above and below first two sets */
    A_try_above_below(2^(n*2-1),n);
    forprime(p=3, (limit\2)^(1/(n-1)),
    if (A_try_above_below(2*p^(n-1),n), break));
    /* Odd numbers with numdiv==n*2 are {p^(n*2-1)} u {p^(n-1)*q} */
    /* Try where a(n) and a(n)+n*2 are (small prime)^(n-1)*(big prime) */
    forprime(p=3, pairmax, forprime(q=3, pairmax,
    if (p!=q, limit = A_try_pair(p,q,n,limit))));
    /* Try above and below all other odd numbers with numdiv==n*2 */
    forprime(p=pairmax+1, (limit\3)^(1/(n-1)),
    forprime(q=3, limit\p^(n-1),
    if (p!=q & A_try_above_below(p^(n-1)*q,n), break)));
    forprime(p=3, limit^(1/21),
    if (A_try_above_below(p^21,n), break));
    limit
    } /* Martin Fuller, Apr 20 2008 */

Extensions

First 10 terms calculated by M. F. Hasler
a(11)-a(20) from Martin Fuller, Apr 20 2008
a(21)-a(25) from Jinyuan Wang, Sep 24 2021

A260581 Numbers n for which d(n+d(n)) > d(n), where d(n) is the number of divisors of n.

Original entry on oeis.org

1, 2, 7, 8, 9, 13, 14, 18, 19, 23, 25, 26, 31, 37, 38, 40, 43, 46, 47, 49, 50, 53, 61, 62, 67, 73, 74, 77, 79, 80, 83, 86, 88, 89, 94, 95, 97, 98, 99, 103, 104, 106, 108, 109, 113, 121, 122, 124, 127, 131, 132, 134, 136, 139, 143, 146, 148, 151, 152, 154, 156
Offset: 1

Views

Author

Vladimir Shevelev, Jul 29 2015

Keywords

Comments

Complement to the union of A175304 and A260577. All primes and their squares, except for 4 and the smaller members of pairs of twin primes (A001359), are in the sequence. If odd prime p is not the smaller member of a twin pair, then 2*p is in the sequence; if for prime p, 2*p+3 is neither prime nor square of prime, then 4*p is in the sequence; for prime p>7, 8*p is in the sequence; for every prime p, 2*p^2 is always in the sequence.

Examples

			8 is in the sequence since d(8+d(8)) = d(12)= 6 > d(8) = 4.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@156,DivisorSigma[0,#+DivisorSigma[0,#]]>DivisorSigma[0,#]&] (* Ivan N. Ianakiev, Aug 13 2015 *)
  • PARI
    first(m)=my(v=vector(m),r=1);for(i=1,m,while(!(numdiv(r+numdiv(r)) > numdiv(r)),r++);v[i]=r;r++;);v; \\ Anders Hellström, Aug 16 2015
    
  • Perl
    use ntheory ":all"; my @A = grep { my $d=scalar(divisors($)); scalar(divisors($+$d)) > $d; } 1..100; say "@A"; # Dana Jacobsen, Apr 28 2017

A282391 Numbers j such that d(j) = d(j + 3*d(j)), where d(j) is the number of divisors of j.

Original entry on oeis.org

5, 7, 10, 11, 13, 14, 15, 17, 21, 22, 23, 26, 27, 30, 31, 32, 34, 37, 39, 41, 42, 45, 46, 47, 50, 53, 54, 57, 60, 61, 62, 65, 67, 72, 73, 74, 78, 82, 83, 90, 94, 96, 97, 98, 99, 101, 103, 104, 106, 107, 111, 114, 120, 122, 128, 129, 130, 131, 133, 134, 143
Offset: 1

Views

Author

Vladimir Shevelev, Feb 14 2017

Keywords

Comments

The sequence contains the smaller member of every pair of sexy primes (A023201).
The sequence contains no perfect squares. Indeed, let a(m) = k^2 for some m. Then, by the definition, d(k^2 + 3*d(k^2)) = d(k^2). Note that d(k^2) is odd. On the other hand, it is known (cf. A046522) that d(k^2) < 2*k. Hence (k+3)^2 - k^2 = 6*k + 1 > 3*d(k^2). Thus k^2 < k^2 + 3*d(k^2) < (k+3)^2. Note that, evidently, k^2 + 3*d(k^2) cannot be (k+2)^2. Let us also show that k^2 + 3*d(k^2) cannot be (k+1)^2, or, equivalently, 3*d(k^2) cannot be equal to 2*k + 1. Indeed, let 3*d(k^2) = 2*k + 1. For some prime p, let p^a || k (that is, p^a | k, but p^(a+1) !| k), a > 0, so 2*k + 1 == 1 (mod p). But now we have 3*p^(a+1) | 3*d(k^2) and thus 3*p^(a+1)|2*k + 1, so 2*k + 1 == 0 (mod p). Contradiction. Therefore, we conclude that k^2 + 3*d(k^2) cannot be a square. Hence, d(k^2 + 3*d(k^2)) is even, which is a contradiction.

Crossrefs

Programs

Extensions

More terms from Peter J. C. Moses, Feb 14 2017

A282843 Numbers k for which id(k) = id(k + id(k)), where id(k) = A037445(k) is the number of infinitary divisors of k.

Original entry on oeis.org

2, 3, 5, 6, 7, 8, 9, 10, 11, 14, 17, 18, 22, 23, 28, 29, 32, 34, 35, 41, 44, 46, 47, 48, 51, 58, 59, 64, 65, 70, 71, 76, 79, 81, 82, 87, 88, 91, 94, 95, 96, 101, 102, 107, 111, 112, 115, 118, 119, 125, 128, 129, 130, 132, 137, 141, 142, 143, 144, 149, 152, 155
Offset: 1

Views

Author

Vladimir Shevelev, Feb 22 2017

Keywords

Comments

The infinitary analog of A175304. The sequence contains smaller of pairs(p,q) of terms of A050376 if q-p=2 (Fermi-Dirac twin primes). Unlike A175304, this sequence contains some squares (64,81,144,...).

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := 2^DigitCount[e, 2, 1]; id[1] = 1; id[n_] := Times @@ f @@@ FactorInteger[n]; Select[Range[200], id[#] == id[# + id[#]] &] (* Amiram Eldar, Apr 11 2025 *)
  • PARI
    id(n)=2^vecsum(apply(hammingweight, factor(n)[,2]))
    is(n)=my(i=id(n)); id(n+i)==i \\ Charles R Greathouse IV, Feb 22 2017

Extensions

More term from Peter J. C. Moses, Feb 22 2017

A285004 Numbers n that enter a cycle of greater length than that for any k < n in the iteration sequence s(0)=n, s(k+1) = s(k) + (-1)^k*d(s(k)), where d(n) is the number of divisors of n (A000005).

Original entry on oeis.org

3, 93, 273, 684, 3993, 58695, 91355, 167055, 441519, 2337513, 20225991, 20625997, 148789675, 470944675, 494359089, 3252701700, 3472027000, 9096968436
Offset: 1

Views

Author

Amiram Eldar, Apr 07 2017

Keywords

Comments

Claudia Spiro conjectured that for every initial number n the iteration sequence is eventually periodic.
The corresponding cycle lengths are: 2, 4, 6, 10, 12, 14, 16, 20, 22, 26, 28, 32, 34, 36, 44, 46, 52, 54.

Examples

			The sequence for 93 is 93, 93 + d(93) = 97, 97 - d(97) = 95, 95 + d(95) = 99, 99 - d(99) = 93, 93 + d(93) = 97, ... with a cycle of (93, 97, 95, 99) whose length is 4. All initial numbers < 93 end in a cycle whose length < 4, thus 93 is in the sequence.
		

Crossrefs

Cf. A000005, A049820, A062249, A175304 (numbers with cycle of length 2), A288070.

Programs

  • Mathematica
    lengths={}; Records={}; For[n=2, n<100, n++; c=1; v={}; m=0; s=1; a=n; i={}; While[m<10^6, AppendTo[v, a]; If[Length[v] > 3, i=LongestCommonSubsequencePositions[v[[1;; -3]], v[[-2;; -1]]], i = {}]; If[Length[i]==2 && Differences[i[[1]]][[1]]==1, c=Length[v]-i[[1]][[1]]-1; Break[]]; m++; a = a + s*DivisorSigma[0, a]; s = -s; ];  If[Length[lengths]==0 || c>lengths[[-1]], AppendTo[lengths, c]; AppendTo[Records, n]]]; Records

Extensions

a(11)-a(18) from Giovanni Resta, Apr 07 2017
Wrong term 1 removed by Amiram Eldar, Jun 05 2017

A288070 a(n) is the least number that enters a cycle of length 2n in the iteration sequence s(0)=n, s(k+1) = s(k) + (-1)^k*d(s(k)), where d(n) is the number of divisors of n (A000005).

Original entry on oeis.org

3, 93, 273, 1617, 684, 3993, 58695, 91355, 572793, 167055, 441519, 13991016, 2337513, 20225991, 48163788, 20625997, 148789675, 470944675, 626064036, 506112555, 963071088, 494359089, 3252701700, 3972446520, 4515893681, 3472027000, 9096968436
Offset: 1

Views

Author

Michel Marcus, Jun 05 2017

Keywords

Crossrefs

Cf. A000005, A049820, A062249, A175304 (numbers with cycle of length 2), A285004 (records of this sequence).

Programs

  • Mathematica
    nmax=10;lst=ConstantArray[0,nmax];For[n=2, n<10^6, n++; c=1; v={}; m=0; s=1; a=n; i={}; While[m<10^6, AppendTo[v, a]; If[Length[v] > 3, i=LongestCommonSubsequencePositions[v[[1;; -3]], v[[-2;; -1]]], i = {}];
    If[Length[i]==2 && Differences[i[[1]]][[1]]==1, c=Length[v]-i[[1]][[1]]-1; Break[]]; m++; a = a + s*DivisorSigma[0, a]; s = -s; ]; If[c/2Amiram Eldar, Jun 05 2017 *)
  • PARI
    findpos(v, new) = {for(i=1, #v, if (v[#v-i+1] == new, return (i)););}
    loop(n) = {my(k = 1, ok = 0, v = []); while(!ok, new = n + k*numdiv(n); if (pos = findpos (v, new), if (#v > pos, if (v[#v] == v[#v - pos], return (pos)););); n = new; k = -k; v = concat(v, new););}
    a(n) = my(k=3); while (loop(k) != 2*n, k++); k;

Extensions

a(19)-a(27) from Giovanni Resta, Jun 06 2017

A348337 For n >= 1; x = n, then iterate x --> x + d(x) until d(x + d(x)) >= d(x). a(n) gives the number of iteration steps where d(i) is the number of divisors of i, A000005(i).

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Oct 13 2021

Keywords

Comments

a(n) = 1 for n from A260577.

Examples

			n = 1; x(1) = 1 + d(1) = 2, d(1 + d(1)) >= d(1) thus x(2) = 2 + d(2) = 4, d(2 + d(2)) >= d(2) thus x(3) = 4 + d(4) = 7, d(4 + d(4)) < d(4), stop. a(1) = 3.
		

Crossrefs

Programs

  • Mathematica
    d[n_] := DivisorSigma[0, n]; x[n_] := n + d[n]; a[n_] := Length@ NestWhileList[x, n, d[#] <= d[x[#]] &]; Array[a, 100] (* Amiram Eldar, Oct 15 2021 *)
Previous Showing 11-17 of 17 results.