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

A014574 Average of twin prime pairs.

Original entry on oeis.org

4, 6, 12, 18, 30, 42, 60, 72, 102, 108, 138, 150, 180, 192, 198, 228, 240, 270, 282, 312, 348, 420, 432, 462, 522, 570, 600, 618, 642, 660, 810, 822, 828, 858, 882, 1020, 1032, 1050, 1062, 1092, 1152, 1230, 1278, 1290, 1302, 1320, 1428, 1452, 1482, 1488, 1608
Offset: 1

Views

Author

Keywords

Comments

With an initial 1 added, this is the complement of the closure of {2} under a*b+1 and a*b-1. - Franklin T. Adams-Watters, Jan 11 2006
Also the square root of the product of twin prime pairs + 1. Two consecutive odd numbers can be written as 2k+1,2k+3. Then (2k+1)(2k+3)+1 = 4(k^2+2k+1) = 4(k+1)^2, a perfect square. Since twin prime pairs are two consecutive odd numbers, the statement is true for all twin prime pairs. - Cino Hilliard, May 03 2006
Or, single (or isolated) composites. Nonprimes k such that neither k-1 nor k+1 is nonprime. - Juri-Stepan Gerasimov, Aug 11 2009
Numbers n such that sigma(n-1) = phi(n+1). - Farideh Firoozbakht, Jul 04 2010
Aside from the first term in the sequence, all remaining terms have digital root 3, 6, or 9. - J. W. Helkenberg, Jul 24 2013
Numbers n such that n^2-1 is a semiprime. - Thomas Ordowski, Sep 24 2015
Every term but the first is a multiple of 6. - Harvey P. Dale, Mar 31 2023

References

  • Archimedeans Problems Drive, Eureka, 30 (1967).

Crossrefs

A068507 is the intersection of A002182 and this sequence.

Programs

  • GAP
    a:=1+Filtered([1..2000],p->IsPrime(p) and IsPrime(p+2)); # Muniru A Asiru, May 20 2018
  • Haskell
    a014574 n = a014574_list !! (n-1)
    a014574_list = [x | x <- [2,4..], a010051 (x-1) == 1, a010051 (x+1) == 1]
    -- Reinhard Zumkeller, Apr 11 2012
    
  • Maple
    P := select(isprime,[$1..1609]): map(p->p+1,select(p->member(p+2,P),P)); # Peter Luschny, Mar 03 2011
    A014574 := proc(n) option remember; local p ; if n = 1 then 4 ; else p := nextprime( procname(n-1) ) ; while not isprime(p+2) do p := nextprime(p) ; od ; return p+1 ; end if ; end proc: # R. J. Mathar, Jun 11 2011
  • Mathematica
    Select[Table[Prime[n] + 1, {n, 260}], PrimeQ[ # + 1] &] (* Ray Chandler, Oct 12 2005 *)
    Mean/@Select[Partition[Prime[Range[300]],2,1],Last[#]-First[#]==2&] (* Harvey P. Dale, Jan 16 2014 *)
  • Maxima
    A014574(n) := block(
        if n = 1 then
            return(4),
        p : A014574(n-1) ,
        for k : 2 step 2 do (
            if primep(p+k-1) and primep(p+k+1) then
                return(p+k)
        )
    )$ /* R. J. Mathar, Mar 15 2012 */
    
  • PARI
    p=2;forprime(q=3,1e4,if(q-p==2,print1(p+1", "));p=q) \\ Charles R Greathouse IV, Jun 10 2011
    

Formula

a(n) = (A001359(n) + A006512(n))/2 = 2*A040040(n) = A054735(n)/2 = A111046(n)/4.
a(n) = A129297(n+4). - Reinhard Zumkeller, Apr 09 2007
A010051(a(n) - 1) * A010051(a(n) + 1) = 1. Reinhard Zumkeller, Apr 11 2012
a(n) = 6*A002822(n-1), n>=2. - Ivan N. Ianakiev, Aug 19 2013
a(n)^4 - 4*a(n)^2 = A062354(a(n)^2 - 1). - Raphie Frank, Oct 17 2013

Extensions

Offset changed to 1 by R. J. Mathar, Jun 11 2011

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

A129296 Number of divisors of n^2 - 1 that are not greater than n.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 5, 3, 5, 3, 8, 2, 8, 4, 6, 4, 9, 2, 12, 4, 8, 4, 10, 3, 10, 6, 8, 4, 16, 2, 14, 4, 7, 8, 12, 4, 12, 4, 10, 4, 20, 2, 16, 6, 8, 6, 12, 3, 18, 6, 12, 4, 16, 4, 20, 8, 10, 4, 16, 2, 16, 6, 8, 12, 16, 4, 16, 4, 16, 4, 30, 2, 15, 6, 8, 12, 16, 4, 24, 5, 12, 5, 16, 4, 16, 8, 10, 4, 30, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 09 2007

Keywords

Comments

a(n) = #{d: d<=n and A005563(n+1) mod d = 0};
a(n)>1 for n>2, see A129297 for m such that a(m)=2: a(A129297(n)) = 2.
If a(6n) = 2 for n>=1, then 6n-1 and 6n+1 are twin primes see A129297. - Fred Daniel Kline, Jan 02 2014
For n>1, a(n) is the number of positive integers k such that k+n divides k*n+1. - Thomas Ordowski, Dec 01 2024

Examples

			a(100) = #{1,3,9,11,33,99} = 6.
		

Crossrefs

Programs

Formula

a(n) = A000005(n^2-1)/2 for n >= 2. - Robert Israel, Aug 03 2015

A129293 Numbers m such that m^4-1 has no divisors d with 1 < d < m-1.

Original entry on oeis.org

3, 4, 6, 150, 180, 240, 270, 420, 570, 1290, 1320, 2310, 2550, 2730, 3360, 3390, 4260, 4650, 5850, 5880, 6360, 6780, 9000, 9240, 9630, 10530, 10890, 11970, 13680, 13830, 14010, 14550, 16230, 16650, 18060, 18120, 18540, 19140, 19380, 21600, 21840, 23370
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 09 2007

Keywords

Comments

Essentially the same as A070155, since m^4-1=(m-1)(m+1)(1+m^2). - R. J. Mathar, Jun 14 2008

Examples

			{1,5,7,35,37,185,259,1295} is the set of divisors of 6^4-1, therefore 6 is a term, A129292(6) = #{1,3} = 2.
		

Crossrefs

Programs

  • PARI
    is(k) = k == 3 || (isprime(k-1) && isprime(k+1) && isprime(k^2+1)); \\ Amiram Eldar, Apr 15 2024

Formula

A129292(a(n)) = #{1, a(n)-1} = 2.

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 *)
Showing 1-5 of 5 results.