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

A049820 a(n) = n - d(n), where d(n) is the number of divisors of n (A000005).

Original entry on oeis.org

0, 0, 1, 1, 3, 2, 5, 4, 6, 6, 9, 6, 11, 10, 11, 11, 15, 12, 17, 14, 17, 18, 21, 16, 22, 22, 23, 22, 27, 22, 29, 26, 29, 30, 31, 27, 35, 34, 35, 32, 39, 34, 41, 38, 39, 42, 45, 38, 46, 44, 47, 46, 51, 46, 51, 48, 53, 54, 57, 48, 59, 58, 57, 57, 61, 58, 65
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of non-divisors of n in 1..n. - Jaroslav Krizek, Nov 14 2009
Also equal to the number of partitions p of n such that max(p)-min(p) = 1. The number of partitions of n with max(p)-min(p) <= 1 is n; there is one with k parts for each 1 <= k <= n. max(p)-min(p) = 0 iff k divides n, leaving n-d(n) with a difference of 1. It is easiest to see this by looking at fixed k with increasing n: for k=3, starting with n=3 the partitions are [1,1,1], [2,1,1], [2,2,1], [2,2,2], [3,2,2], etc. - Giovanni Resta, Feb 06 2006 and Franklin T. Adams-Watters, Jan 30 2011
Number of positive numbers in n-th row of array T given by A049816.
Number of proper non-divisors of n. - Omar E. Pol, May 25 2010
a(n+2) is the sum of the n-th antidiagonal of A225145. - Richard R. Forberg, May 02 2013
For n > 2, number of nonzero terms in n-th row of triangle A051778. - Reinhard Zumkeller, Dec 03 2014
Number of partitions of n of the form [j,j,...,j,i] (j > i). Example: a(7)=5 because we have [6,1], [5,2], [4,3], [3,3,1], and [2,2,2,1]. - Emeric Deutsch, Sep 22 2016

Examples

			a(7) = 5; the 5 non-divisors of 7 in 1..7 are 2, 3, 4, 5, and 6.
The 5 partitions of 7 with max(p) - min(p) = 1 are [4,3], [3,2,2], [2,2,2,1], [2,2,1,1,1] and [2,1,1,1,1,1]. - _Emeric Deutsch_, Mar 01 2006
		

Crossrefs

Cf. A000005.
One less than A062968, two less than A059292.
Cf. A161664 (partial sums).
Cf. A060990 (number of solutions to a(x) = n).
Cf. A045765 (numbers not occurring in this sequence).
Cf. A236561 (same sequence sorted into ascending order), A236562 (with also duplicates removed), A236565, A262901 and A262903.
Cf. A262511 (numbers that occur only once).
Cf. A055927 (positions of repeated terms).
Cf. A245388 (positions of squares).
Cf. A155043 (number of steps needed to reach zero when iterating a(n)), A262680 (number of nonzero squares encountered).
Cf. A259934 (an infinite trunk of the tree defined by edge-relation a(child) = parent, conjectured to be unique).
Cf. tables and arrays A047916, A051731, A051778, A173540, A173541.
Cf. also arrays A225145, A262898, A263255 and tables A263265, A263267.

Programs

Formula

a(n) = Sum_{k=1..n} ceiling(n/k)-floor(n/k). - Benoit Cloitre, May 11 2003
G.f.: Sum_{k>0} x^(2*k+1)/(1-x^k)/(1-x^(k+1)). - Emeric Deutsch, Mar 01 2006
a(n) = A006590(n) - A006218(n) = A161886(n) - A000005(n) - A006218(n) + 1 for n >= 1. - Jaroslav Krizek, Nov 14 2009
a(n) = Sum_{k=1..n} A000007(A051731(n,k)). - Reinhard Zumkeller, Mar 09 2010
a(n) = A076627(n) / A000005(n). - Reinhard Zumkeller, Feb 06 2012
For n >= 2, a(n) = A094181(n) / A051953(n). - Antti Karttunen, Nov 27 2015
a(n) = Sum_{k=1..n} ((n mod k) + (-n mod k))/k. - Wesley Ivan Hurt, Dec 28 2015
G.f.: Sum_{j>=2} (x^(j+1)*(1-x^(j-1))/(1-x^j))/(1-x). - Emeric Deutsch, Sep 22 2016
Dirichlet g.f.: zeta(s-1)- zeta(s)^2. - Ilya Gutkovskiy, Apr 12 2017
a(n) = Sum_{i=1..n-1} sign(i mod n-i). - Wesley Ivan Hurt, Sep 27 2018

Extensions

Edited by Franklin T. Adams-Watters, Jan 30 2012

A230115 Numbers n such that tau(n+1) - tau(n) = 2; where tau(n) = the number of divisors of n (A000005).

Original entry on oeis.org

5, 7, 13, 27, 37, 51, 61, 62, 73, 74, 91, 115, 123, 146, 153, 157, 164, 187, 188, 193, 206, 235, 245, 267, 274, 277, 278, 284, 291, 313, 355, 356, 362, 369, 386, 397, 403, 411, 421, 422, 423, 425, 427, 428, 451, 457, 538, 541, 605, 613, 637, 657, 661, 667, 673
Offset: 1

Views

Author

Jaroslav Krizek, Oct 09 2013

Keywords

Comments

Numbers n such that A051950(n+1) = 2.
Numbers n such that A049820(n) - A049820(n+1) = 1.
Sequence of starts of first run of n (n>=2) consecutive integers m_1, m_2, ..., m_n such that tau(m_k) - tau(m_k-1) = 2, for all k=n...2: 5, 61, 421, ... (a(5) > 100000); example for n=4: tau(421) = 2, tau(422) = 4, tau(423) = 6, tau(424) = 8.

Examples

			Number 7 is in sequence because tau(8) - tau(7) = 4 - 2 = 2.
		

Crossrefs

Cf. A000005, A055927 (numbers n such that tau(n+1) - tau(n) = 1).
Subsequence of A162318. - Michel Marcus, Mar 26 2017

Programs

  • Mathematica
    Select[ Range[ 50000], DivisorSigma[0, # ] + 2 == DivisorSigma[0, # + 1] &]
    Flatten[Position[Partition[DivisorSigma[0,Range[700]],2,1],? (#[[2]]- #[[1]] == 2&),{1},Heads->False]] (* _Harvey P. Dale, Aug 03 2014 *)
  • PARI
    isok(n) = (numdiv(n+1) - numdiv(n)) == 2; \\ Michel Marcus, Mar 26 2017
    
  • Python
    from sympy.ntheory import divisor_count
    [n for n in range(1000) if divisor_count(n + 1) - divisor_count(n) == 2] # Indranil Ghosh, Mar 26 2017

A230653 Numbers k such that tau(k+1) - tau(k) = 3, where tau(k) = the number of divisors of k (A000005).

Original entry on oeis.org

49, 99, 1023, 1681, 1935, 2499, 8649, 9603, 20449, 21903, 23715, 29583, 30975, 38024, 43263, 58563, 60515, 71824, 74528, 110223, 130321, 136899, 145924, 150543, 154449, 165649, 181475, 216224, 224675, 233288, 243049, 256035, 258063, 265225, 294849, 300303
Offset: 1

Views

Author

Jaroslav Krizek, Oct 27 2013

Keywords

Comments

Numbers k such that A051950(k+1) = 3.
Numbers k such that A049820(k) - A049820(k+1) = 2.
k or k+1 is a perfect square. - David A. Corneth, Feb 16 2024

Examples

			99 is in the sequence because tau(100) - tau(99) = 9 - 6 = 3.
		

Crossrefs

Cf. A055927 (numbers n such that tau(n+1) - tau(n) = 1), A230115 (numbers n such that tau(n+1) - tau(n) = 2), A000005.

Programs

  • Mathematica
    Select[ Range[ 50000], DivisorSigma[0, # ] + 3 == DivisorSigma[0, # + 1] &]
    Position[Differences[DivisorSigma[0,Range[300400]]],3]//Flatten (* Harvey P. Dale, Jun 30 2022 *)
  • PARI
    isok(n) = numdiv(n+1) - numdiv(n) == 3; \\ Michel Marcus, Oct 27 2013
    
  • Python
    from sympy import divisor_count as tau
    from itertools import count, islice
    def agen(): # generator of terms, using comment by David A. Corneth
        for m in count(1):
            mm = m*m
            tmm = tau(mm)
            if tmm - tau(mm-1) == 3: yield mm-1
            if tau(mm+1) - tmm == 3: yield mm
    print(list(islice(agen(), 36))) # Michael S. Branicky, Feb 16 2024

Extensions

More terms from Michel Marcus, Oct 27 2013

A230654 Numbers n such that tau(n+1) - tau(n) = 4, where tau(n) = the number of divisors of n (A000005).

Original entry on oeis.org

11, 17, 19, 31, 39, 43, 55, 65, 67, 69, 77, 87, 97, 129, 134, 163, 175, 183, 185, 194, 207, 211, 221, 237, 241, 247, 249, 254, 265, 283, 295, 309, 321, 327, 331, 337, 343, 351, 365, 398, 404, 417, 437, 454, 458, 459, 469, 471, 473, 482, 493, 494, 497, 505, 517
Offset: 1

Views

Author

Jaroslav Krizek, Nov 03 2013

Keywords

Comments

Numbers n such that A051950(n+1) = 4. Numbers n such that A049820(n) - A049820(n+1) = 3. Sequence of starts of first run of n (n>=2) consecutive integers m_1, m_2, ..., m_n such that tau(m_k) - tau(m_k-1) = 4, for all k=n...2: 11, 458, 3013, ... (a(5) > 100000); example for n=4: tau(3013) = 4, tau(3014) = 8, tau(3015) = 12, tau(3016) = 16.

Examples

			19 is in sequence because tau(20) - tau(19) = 6 - 2 = 4.
		

Crossrefs

Cf. A055927 (numbers n such that tau(n+1) - tau(n) = 1), A230115 (numbers n such that tau(n+1) - tau(n) = 2), A230653 (numbers n such that tau(n+1) - tau(n) = 3), A000005.

Programs

  • Mathematica
    Select[ Range[ 50000], DivisorSigma[0, # ] + 4 == DivisorSigma[0, # + 1] &]

A075046 a(n) = the smallest number k such that the number of divisors of the n numbers from k through k+n-1 are in nondescending order.

Original entry on oeis.org

1, 1, 1, 1, 241, 241, 12853, 12853, 234613, 376741, 78312721, 125938261, 4019167441, 16586155153, 35237422882, 1296230533473, 42301168491121, 61118966262061
Offset: 1

Views

Author

Amarnath Murthy, Sep 03 2002

Keywords

Comments

tau(k) <= tau(k+1) <= ... <= tau(k+n-1).
a(16) > 10^12. - Donovan Johnson, Oct 13 2009
a(17) > 10^13. - Giovanni Resta, Apr 12 2017
a(19) > 2.64*10^15. - Jud McCranie, Mar 27 2019
If a(n) > 1, then A013632(a(n)) >= n. Might be useful to help speed up brute force search. - Chai Wah Wu, May 04 2017

Examples

			a(5) = 241 = a(6) as tau(241) = 2 < tau(242) = tau(243) = tau(244) = tau(245) = 6 < tau(246).
		

Crossrefs

Programs

  • Mathematica
    k = 1; Do[ While[t = Table[ DivisorSigma[0, i], {i, k, k + n - 1}]; t != Sort[t], k++ ]; Print[k], {n, 1, 11}]

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 19 2003
a(11) from Robert G. Wilson v, Sep 07 2003
a(12)-a(15) from Donovan Johnson, Oct 13 2009
a(16) from Fred Schneider, Mar 29 2017
a(17)-a(18) from Jud McCranie, Mar 27 2019

A228453 Numbers k such that tau(k+1) - tau(k) = 5, where tau(k) = the number of divisors of k (A000005).

Original entry on oeis.org

35, 169, 289, 529, 961, 1369, 2809, 3135, 4489, 7921, 9409, 10609, 10815, 11881, 12769, 16129, 18495, 18769, 22201, 22801, 26569, 27889, 32041, 33855, 38809, 44521, 49729, 51529, 52441, 53823, 58081, 61503, 69169, 72361, 76729, 78961, 80089, 96721
Offset: 1

Views

Author

Jaroslav Krizek, Nov 03 2013

Keywords

Comments

Numbers k such that A051950(k+1) = 5.
Numbers k such that A049820(k) - A049820(k+1) = 4.
Either k or k+1 is a square. - Amiram Eldar, Apr 17 2024

Examples

			35 is in sequence because tau(36) - tau(35) = 9 - 4 = 5.
		

Crossrefs

Numbers k such that tau(k+1) - tau(k) = m: A055927 (m = 1), A230115 (m = 2), A230653 (m = 3), A230654 (m = 4), this sequence (m = 5).

Programs

  • Mathematica
    Select[ Range[ 50000], DivisorSigma[0, # ] + 5 == DivisorSigma[0, # + 1] &]
  • PARI
    lista(kmax) = {my(d); for(k = 2, kmax, d = numdiv(k^2); if(d == numdiv(k^2-1) + 5, print1(k^2-1, ", ")); if(d == numdiv(k^2+1) - 5, print1(k^2, ", ")));} \\ Amiram Eldar, Apr 17 2024

A227874 Numbers n such that tau(n+1) - tau(n) = -2, where tau(n) = the number of divisors of n (A000005).

Original entry on oeis.org

6, 10, 20, 22, 32, 45, 46, 50, 58, 68, 76, 82, 92, 106, 117, 124, 152, 166, 170, 174, 178, 212, 226, 236, 261, 262, 272, 325, 333, 338, 346, 358, 382, 405, 412, 424, 435, 436, 452, 464, 466, 474, 477, 478, 495, 502, 506, 512, 530, 555, 562, 567, 574, 578, 586
Offset: 1

Views

Author

Jaroslav Krizek, Nov 03 2013

Keywords

Comments

Numbers n such that tau(n) - tau(n+1) = 2. Numbers n such that A051950(n+1) = -2. Numbers n such that A049820(n) - A049820(n+1) = -3.
Sequence of starts of first run of n (n>=2) consecutive integers m_1, m_2, ..., m_n such that tau(m_k) - tau(m_k-1) = -2, for all k=n...2: 6, 45, 1016, ... (a(5) > 100000); example for n=4: tau(1016) = 8, tau(1017) = 6, tau(1018) = 4, tau(1019) = 2.

Examples

			45 is in sequence because tau(46) - tau(45) = 4 - 6 = -2.
		

Crossrefs

Cf. A000005.
Cf. A055927 (numbers n such that tau(n+1) - tau(n) = 1).
Cf. A230115 (numbers n such that tau(n+1) - tau(n) = 2).
Cf. A230653 (numbers n such that tau(n+1) - tau(n) = 3).
Cf. A230654 (numbers n such that tau(n+1) - tau(n) = 4).
Cf. A228453 (numbers n such that tau(n+1) - tau(n) = 5).

Programs

  • Mathematica
    Select[ Range[ 50000], DivisorSigma[0, # ] - 2 == DivisorSigma[0, # + 1] &]

A343018 a(n) is the smallest number m such that tau(m+1) = tau(m) + n.

Original entry on oeis.org

2, 1, 5, 49, 11, 35, 23, 399, 47, 1849, 59, 143, 119, 1599, 167, 575, 179, 1295, 239, 4355, 629, 2303, 359, 899, 959, 9215, 1007, 39999, 719, 20735, 839, 5183, 1799, 46655, 1259, 36863, 1679, 7055, 3023, 986049, 2879, 3599, 6479, 82943, 2519, 193599, 3359, 207935
Offset: 0

Views

Author

Jaroslav Krizek, Apr 02 2021

Keywords

Comments

tau(m) = the number of divisors of m (A000005).
Sequences of numbers m such that tau(m+1) = tau(m) + n for 0 <= n <= 5:
n = 0: 2, 14, 21, 26, 33, 34, 38, 44, 57, 75, 85, 86, 93, ... (A005237).
n = 1: 1, 3, 9, 15, 25, 63, 121, 195, 255, 361, 483, 729, ... (A055927).
n = 2: 5, 7, 13, 27, 37, 51, 61, 62, 73, 74, 91, 115, 123, ... (A230115).
n = 3: 49, 99, 1023, 1681, 1935, 2499, 8649, 9603, 20449, ... (A230653).
n = 4: 11, 17, 19, 31, 39, 43, 55, 65, 67, 69, 77, 87, 97, ... (A230654).
n = 5: 35, 169, 289, 529, 961, 1369, 2809, 3135, 4489, ... (A228453).

Examples

			For n = 3; a(3) = 49 because 49 is the smallest number such that tau(50) = 6 = tau(49) + 3 = 3 + 3.
		

Crossrefs

Programs

  • Magma
    Ax:=func; [Ax(n): n in [0..50]];
    
  • Maple
    N:= 60: # for a(0)..a(N)
    V:= Array(0..N): count:=0: t:= numtheory:-tau(1):
    for m from 1 while count < N+1 do
      s:= numtheory:-tau(m+1); v:= s - t;
      if v >= 0 and v <= N and V[v] = 0 then count:= count+1; V[v]:= m; fi;
      t:= s;
    od:
    convert(V, list); # Robert Israel, Jan 03 2025
  • Mathematica
    d = Differences @ Table[DivisorSigma[0, n], {n, 1, 10^6}]; a[n_] := If[(p = Position[d, n]) != {}, p[[1, 1]], 0]; s = {}; n = 0; While[(a1 = a[n]) > 0, AppendTo[s, a1]; n++]; s (* Amiram Eldar, Apr 03 2021 *)
  • PARI
    a(n) = my(m=1); while (numdiv(m+1) != numdiv(m) + n, m++); m; \\ Michel Marcus, Apr 03 2021
    
  • Python
    from itertools import count, pairwise
    from sympy import divisor_count
    def A343018(n): return next(m+1 for m, t in enumerate(pairwise(map(divisor_count,count(1)))) if t[1] == t[0]+n) # Chai Wah Wu, Jul 25 2022

Formula

a(n) = A086550(n) - 1.

A343144 a(n) is the smallest number m with n divisors such that m + 1 has n + 1 divisors; or 0 if no such number exists.

Original entry on oeis.org

1, 3, 9, 15, 0, 63, 729, 195, 96393124, 0, 59049, 0, 0, 0, 58564, 65535, 0, 0, 0, 18224, 339086603837890624, 0, 302862043149743582494593171234930481, 456975, 4785795436938284970984441531228412302268149380473357781656407371343376, 0, 8990453124, 0, 0, 0
Offset: 1

Views

Author

Jaroslav Krizek, Apr 06 2021

Keywords

Comments

a(n) is the smallest number m such that tau(m) = tau(m+1) - 1 = n, where tau(m) = the number of divisors of m (A000005).
Other terms: a(32) = 1476224, a(48) = 7529535, a(80) = 27709695. There are no other positive terms <= 10^8.
Next terms: a(44) = 358913024, a(63) = 288422289, a(64) = 116985855, a(224) = 10702937024. - Vaclav Kotesovec, Apr 07 2021
The number m = 27285093123 is the first start of run of 3 consecutive integers m, m+1 and m+2 with triplet [tau(m), tau(m+1), tau(m+2)] = [tau(m), tau(m) + 1, tau(m) + 2]: [tau(27285093123), tau(27285093124), tau(27285093125)] = [8, 9, 10].
From Amiram Eldar, Apr 08 2021: (Start)
a(5) = 0. Proof: If tau(m) = 5 then m = p^4, where p is an odd prime. Then m+1 is even and tau(m+1) = 6.
There are 3 possible forms of m+1 = p^4+1 that we have to consider:
1) m+1 = 2^5 which is not a solution since tau(31) = 2.
2) m+1 = 4*q, where q is an odd prime, which is impossible since p^4 + 1 = 4*q has no solution as p^4 == 1 (mod 4) for an odd prime p.
3) m+1 = 2*q^2, where q is an odd prime, which is impossible since p^4 + 1 = 2*q^2 has no solution with p and q primes (see Cohn, 1997). (End)
From David A. Corneth, Apr 09 2021: (Start)
a(10) = 0. Proof: if m has 10 divisors and m + 1 has 11 divisors then m + 1 = p^10 for some prime p. Then m = p^10 - 1 = (p - 1)*(p + 1)*(p^4 - p^3 + p^2 - p + 1)*(p^4 + p^3 + p^2 + p + 1) which has as least 16 divisors for p > 2. Case p = 2 does not give a solution.
a(12) = 0. Proof: if m has 12 divisors and m + 1 has 13 divisors then m + 1 = p^12 for some prime p. Then m = p^12 - 1 = (p - 1)*(p + 1)*(p^2 - p + 1)*(p^2 + 1)*(p^2 + p + 1)*(p^4 - p^2 + 1) which has at least 24 divisors for p >= 2. So m cannot have 12 divisors. (End)
From Jon E. Schoenfield, Apr 21 2021: (Start)
For each n (except where a(n) = 0), since m and m+1 have n and n+1 divisors, respectively, and either n or n+1 is odd, it follows that either m or m+1 is a square; i.e., each term is either a square or one less than a square.
The only terms <= 10^16 not listed above are a(39) = 5633825050624, a(56) = 8601122276288, a(95) = 281354730471424, a(104) = 9274308890624, a(128) = 2326566604374015, a(144) = 5409275354546175, a(255) = 1778655385595664, a(384) = 357507737015624, and a(512) = 14765267353599. (Two additional known terms and one known upper bound are far larger; see below.)
For each prime p, a(p) = q^(p-1) where q is the smallest prime such that q^(p-1) + 1 has p+1 divisors (or, if no such prime q exists, a(p) = 0). At present, the only primes p for which such a prime q is known to exist are p = 2, 3, 7, 11, 23, 31, and 47, yielding the terms a(2) = 3^1 = 3, a(3) = 3^2 = 9, a(7) = 3^6 = 729, a(11) = 3^10 = 59049, a(23) = 41^22 = 302862043149743582494593171234930481, a(31) = 2183431^30 (a 191-digit number), and the upper bound a(47) <= 1483^46, respectively. (a(47) is 1459^46 or 1483^46, depending on whether 1459^46+1 has 48 divisors.) (Observation: for each prime p in {2, 3, 7, 11, 23, 31, 47}, p+1 is 3-smooth.)
Conjecture: a(n) = 0 for more than 95% of the indices n in 1..1000. (End)

Examples

			a(4) = 15 because 15 is the smallest number m such that tau(m) = tau(15) = 4 and tau(16) = tau(m) + 1 = 5.
		

Crossrefs

Programs

  • Magma
    Ax:=func; [Ax(n): n in [1..4]];

Formula

a(n) = |A341654(n,n-1)|.

Extensions

a(10), a(12) from David A. Corneth, Apr 09 2021
a(13)-a(14) from Jinyuan Wang, Apr 18 2021
a(17)-a(19) from Jon E. Schoenfield, Apr 19 2021
a(21)-a(22), a(25)-a(26), a(28)-a(30) from Jinyuan Wang, Apr 23 2021

A172438 Numbers k such that tau(k^2+1) - tau(k^2) = 1 where the function tau(k) is the number of positive divisors of k.

Original entry on oeis.org

1, 3, 5, 11, 19, 27, 29, 59, 61, 71, 79, 101, 125, 131, 139, 181, 199, 242, 243, 271, 333, 349, 379, 387, 409, 423, 449, 461, 477, 521, 569, 571, 603, 631, 641, 661, 739, 747, 751, 772, 788, 821, 881, 929, 991, 1017, 1031, 1039, 1051, 1058, 1069, 1075, 1083
Offset: 1

Views

Author

Michel Lagneau, Feb 02 2010

Keywords

Comments

Square roots of perfect squares in A055927. [Juri-Stepan Gerasimov, Apr 06 2011]

Examples

			k=1, tau(2) - tau(1) = 2 - 1 = 1.
k=3, tau(10) - tau(9) = 4 - 3 = 1.
k=5, tau(26) - tau(25) = 4 - 3 = 1.
k=387, tau(149770)- tau(149769) = 16 - 15 = 1.
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 840.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 38.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Chap. II. (For inequalities, etc.)

Crossrefs

Programs

  • Magma
    [m:m in [1..1100]| #Divisors(m^2+1) - #Divisors(m^2) eq 1]; // Marius A. Burtea, Jul 12 2019
  • Maple
    with(numtheory): for n from 1 to 100000 do; if tau(n^2+1)-tau(n^2)= 1 then print(n); else fi ; od;
  • Mathematica
    dsQ[n_]:=Module[{n2=n^2},DivisorSigma[0,n2+1]-DivisorSigma[0,n2]==1]; Select[Range[1200],dsQ] (* Harvey P. Dale, May 05 2011 *)
    Select[Sqrt[#]&/@Flatten[Position[Partition[DivisorSigma[0,Range[1200000]],2,1],?(#[[2]]-#[[1]]==1&),1,Heads->False]],IntegerQ] (* _Harvey P. Dale, Apr 09 2022 *)
Showing 1-10 of 13 results. Next