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-4 of 4 results.

A347191 Number of divisors of n^2-1.

Original entry on oeis.org

2, 4, 4, 8, 4, 10, 6, 10, 6, 16, 4, 16, 8, 12, 8, 18, 4, 24, 8, 16, 8, 20, 6, 20, 12, 16, 8, 32, 4, 28, 8, 14, 16, 24, 8, 24, 8, 20, 8, 40, 4, 32, 12, 16, 12, 24, 6, 36, 12, 24, 8, 32, 8, 40, 16, 20, 8, 32, 4, 32, 12, 16, 24, 32, 8, 32, 8, 32, 8, 60, 4, 30, 12, 16, 24, 32, 8, 48, 10, 24
Offset: 2

Views

Author

Bernard Schott, Aug 22 2021

Keywords

Comments

Inspired by problem A1885 in Diophante (see link).
As n^2-1 > 0 is never square, all terms are even.
a(n) = 2 iff n = 2.
a(n) = 4 iff n = 3 or iff n is average of twin prime pairs 'n-1' and 'n+1'; i.e. n is a member of ({3} Union A014574) or equivalently n is a term of A129297 \ {0,1,2}.
a(n) = 6 iff n is such that the two adjacent integers of n are a prime and a square of another prime: 8, 10, 24, 48, 168, 360, ... (A347194).

Examples

			a(5) = tau(5^2-1) = tau(24) = 8.
a(18) = tau(18^2-1) = tau(17*19) = 4, 18 is average of twin primes 17 and 19.
		

Crossrefs

Cf. A347192 (records), A347193 (smallest k with a(k) = n), A347194 (a(n)=6).

Programs

  • Maple
    with(numtheory):
    seq(tau(n^2-1), n=2..81);
  • Mathematica
    a[n_] := Length[Divisors[n^2 - 1]]; Table[a[n], {n, 2, 81}] (* Robert P. P. McKone, Aug 22 2021 *)
    Table[DivisorSigma[0, n^2 - 1], {n, 2, 100}] (* Vaclav Kotesovec, Aug 23 2021 *)
  • PARI
    a(n) = numdiv(n^2-1); \\ Michel Marcus, Aug 23 2021
    
  • PARI
    a(n)=my(a=valuation(n-1,2),b=valuation(n+1,2)); numdiv((n-1)>>a)*numdiv((n+1)>>b)*(a+b+1) \\ Charles R Greathouse IV, Sep 17 2021
    
  • PARI
    first(n)=my(v=vector(n-1),x=[1,factor(1)],y=[2,factor(2)]); forfactored(k=3,n+1,  my(e=max(valuation(x[1],2), valuation(k[1],2))); v[k[1]-2]=numdiv(k)*numdiv(x)*(e+2)/(2*e+2); x=y; y=k); v \\ Charles R Greathouse IV, Sep 17 2021
    
  • Python
    from math import prod
    from sympy import factorint
    def a(n):
        ft = factorint(n+1, multiple=True) + factorint(n-1, multiple=True)
        return prod((e + 1) for e in (ft.count(f) for f in set(ft)))
    print([a(n) for n in range(2, 82)]) # Michael S. Branicky, Sep 17 2021

Formula

a(n) = A000005(A005563(n-1)).
a(n) = 2 * A129296(n).
Sum_{k=2..n} a(k) ~ (6/Pi^2) * n*log(n)^2 (Dudek, 2016). - Amiram Eldar, Apr 07 2023

A347192 Integers k such that the number of divisors of k^2 - 1 (A347191) sets a new record.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 19, 29, 41, 71, 109, 161, 169, 181, 379, 449, 649, 701, 881, 1079, 1189, 1871, 2449, 3079, 4159, 5851, 11969, 19601, 23561, 23869, 24751, 43471, 82081, 94249, 157249, 222641, 252449, 313039, 627199, 677249, 790399, 1276001, 2308879, 4058209
Offset: 1

Views

Author

Bernard Schott, Sep 16 2021

Keywords

Comments

The first ten terms are the same as A090481 and A189828, then a(11) = 109 while A090481(11) = 179 and A189828(11) = 161.
The first eleven terms are the same as A335325, then a(12) = 161, which is nonprime, while A335325(12) = 181.
The corresponding records obtained are 2, 4, 8, 10, 16, 18, 24, 32, 40, 60, 64, 70, 80, 96, ...

Examples

			tau(71^2-1) = 60 and there is no integer k < 71 such that tau(k^2-1) >= 60, hence 71 is a term and a(10) = 71.
		

Crossrefs

Cf. A090481, A189828, A335325 (similar, with k = p prime).

Programs

  • Mathematica
    s[n_] := DivisorSigma[0, n^2 - 1]; sm = 0; seq = {}; Do[If[(sn = s[n]) > sm, sm = sn; AppendTo[seq, n]], {n, 2, 10^6}]; seq (* Amiram Eldar, Sep 16 2021 *)
    DeleteDuplicates[Table[{k,DivisorSigma[0,k^2-1]},{k,2,4060000}],GreaterEqual[#1[[2]],#2[[2]]]&] [[;;,1]] (* Harvey P. Dale, Dec 04 2023 *)

A347194 Numbers such that the two adjacent integers are a prime and the square of another prime.

Original entry on oeis.org

8, 10, 24, 48, 168, 360, 840, 1368, 1848, 2208, 3720, 5040, 7920, 10608, 11448, 16128, 17160, 19320, 29928, 36480, 44520, 49728, 54288, 57120, 66048, 85848, 97968, 113568, 128880, 177240, 196248, 201600, 218088, 241080, 273528, 292680, 323760, 344568, 368448, 426408, 458328, 516960, 528528, 537288, 552048, 564000, 573048, 579120
Offset: 1

Views

Author

Bernard Schott, Sep 23 2021

Keywords

Comments

-> Equivalently, numbers k such that tau(k^2-1) = A347191(k) = 6 (see example; used for Maple code).
Proof: tau(k^2-1) = 6 <==> k^2-1 = p^5 or k^2-1 = p*q^2 with p <> q primes; but k^2-p^5 = 1 is impossible, as a consequence of the Catalan-Mihăilescu theorem; now, (k-1)*(k+1) = p*q^2 ==> (k-1 = p and k+1 = q^2) or (k-1 = q^2 and k+1 = p), because k-1 = q and k+1 = p*q is not possible, otherwise 2 = q*(p-1), which would contradict p <> q.
-> There are two possible configurations with p, q primes: (q^2 < a(n) < p) or (p < a(n) < q^2).
The unique configuration q^2 < a(n) < p is for q = 3, a(2) = 10 and p = 11.
All the other configurations, for n = 1 or n >= 3, are of the form p < a(n) < q^2 with p = A049002(n) and q = A062326(n).
-> Note that there is only one integer such that the two adjacent integers are a prime and the square of that prime: it is 3, which lies between 2 and 2^2; in this case, tau(3^2-1) = 4.

Examples

			8 is a term since 8 lies between 7 (prime) and 9 = 3^2 (square of prime); also tau(8^2-1) = tau(63) = 6.
10 is a term since 10 lies between 9 = 3^2 (square of prime) and 11 (prime); also tau(10^2-1) = tau(99) = 6.
24 is a term since 24 lies between 23 (prime) and 25 = 5^2 (square of prime); also tau(24^2-1) = tau(575) = 6.
		

Crossrefs

Subsequence of A163492 (between prime and a perfect square).

Programs

  • Maple
    with(numtheory):
    filter := q-> tau(q^2-1) = 6 : select(filter, [$2..580000]);
  • Mathematica
    q[n_] := Module[{e1 = FactorInteger[n - 1][[;; , 2]], e2 = FactorInteger[n + 1][[;; , 2]]}, (e1 == {1} && e2 == {2}) || (e1 == {2} && e2 == {1})]; Select[Range[4, 600000], q] (* Amiram Eldar, Sep 23 2021 *)
  • PARI
    isok(m) = my(pa, pb); (isprimepower(m-1, &pa)*isprimepower(m+1, &pb) == 2) && (pa != pb); \\ Michel Marcus, Sep 23 2021
    
  • PARI
    upto(n) = { my(res = List()); forprime(i = 3, sqrtint(n-1), if(isprime(i^2 - 2), listput(res, i^2-1); ); if(isprime(i^2 + 2), listput(res, i^2 + 1); ) ); res } \\ David A. Corneth, Sep 23 2021

Formula

For n >= 3: a(n) = A049002(n) + 1 = a(n) = A146981(n) - 1 = (A049002(n) + A146981(n))/2 = A062326(n)^2 - 1.

A353008 a(n) is the smallest positive k such that k^2 + 1 has 2*n divisors, or -1 if no such k exists.

Original entry on oeis.org

1, 3, 7, 13, 182, 43, 1068, 47, 268, 443, 15905182, 157, 1832311432, 14557, 16432, 307, 255250280182, 1407, 355101282318, 3307, 92682, 3626068, 21346690797155182, 993, 313932, 120813568, 51982, 16693, 982692130687379186432, 2943, 2444574943897581751068, 2163
Offset: 1

Views

Author

Jon E. Schoenfield, May 15 2022

Keywords

Comments

From Jon E. Schoenfield, Jun 14 2024: (Start)
For integers k, neither 3 nor 4 ever divides k^2 + 1, so there exists no prime p < 5 such that p^2 divides k^2 + 1.
For n <= 32, the only n for which the 5-adic valuation of a(n)^2 + 1 is not gpf(n) - 1 is n = 16 (see Examples).
Conjecture: a(n) is never -1. (End)

Examples

			From _Jon E. Schoenfield_, Jun 14 2024: (Start)
From a(5) = 182 because 182 is the smallest positive integer k such that k^2 + 1 has 2*5 divisors: 182^2 + 1 = 33125 = 5^4 * 53.
a(16) = 307 because 307 is the smallest positive integer k such that k^2 + 1 has 2*16 divisors: 307^2 + 1 = 94250 = 2 * 5^3 * 377.
a(31) = 2444574943897581751068: 2444574943897581751068^2 + 1 = 5975946656331864965715445578098297119140625 = 5^30 * 6416623862896477837609. (End)
		

Crossrefs

Extensions

a(26), a(29), and a(31) corrected by Jon E. Schoenfield, Jun 14 2024
Showing 1-4 of 4 results.