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.

A067513 Number of divisors d of n such that d+1 is prime.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Feb 12 2002

Keywords

Comments

1, 2 and 4 are the only numbers such that for every divisor d, d+1 is a prime.
These and only these primes appear as prime divisors of any term of InvPhi(n) set if n is not empty, i.e., if n is from A002202. - Labos Elemer, Jun 24 2002
a(n) is the number of integers k such that n = k - k/p where p is one of the prime divisors of k. (See, e.g., A064097 and A333123, which are related to the mapping k -> k - k/p.) - Robert G. Wilson v, Jun 12 2022

Examples

			a(12) = 5 as the divisors of 12 are 1, 2, 3, 4, 6 and 12 and the corresponding primes are 2,3,5,7 and 13. Only 3+1 = 4 is not a prime.
		

Crossrefs

Even-indexed terms give A046886.
Cf. A005408 (positions of 1's), A051222 (of 2's).

Programs

  • Haskell
    a067513 = sum . map (a010051 . (+ 1)) . a027750_row
    -- Reinhard Zumkeller, Jul 31 2012
    
  • Maple
    A067513 := proc(n)
        local a,d;
        a := 0 ;
        for d in numtheory[divisors](n) do
            if isprime(d+1) then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A067513(n),n=1..100) ; # R. J. Mathar, Aug 07 2022
  • Mathematica
    a[n_] := Length[Select[Divisors[n]+1, PrimeQ]]
    Table[Count[Divisors[n],?(PrimeQ[#+1]&)],{n,110}] (* _Harvey P. Dale, Feb 29 2012 *)
    a[n_] := DivisorSum[n, 1 &, PrimeQ[# + 1] &]; Array[a, 100] (* Amiram Eldar, Jan 11 2025 *)
  • PARI
    a(n)=sumdiv(n,d,isprime(d+1)) \\ Charles R Greathouse IV, Dec 23 2011
    
  • Python
    from sympy import divisors, isprime
    def a(n): return sum(1 for d in divisors(n, generator=True) if isprime(d+1))
    print([a(n) for n in range(1, 104)]) # Michael S. Branicky, Jul 12 2022

Formula

a(n) = 2 iff Bernoulli number B_{n} has denominator 6 (cf. A051222). - Vladeta Jovovic, Feb 13 2002
a(n) <= A141197(n). - Reinhard Zumkeller, Oct 06 2008
a(n) = A001221(A027760(n)). - Enrique Pérez Herrero, Dec 23 2011
a(n) = Sum_{k = 1..A000005(n)} A010051(A027750(n,k)+1). - Reinhard Zumkeller, Jul 31 2012
a(n) = A001221(A185633(n)) = A001222(A322312(n)). - Antti Karttunen, Jul 12 2022
Sum_{k=1..n} a(k) = n * (log(log(n)) + B) + O(n/log(n)), where B is a constant (Prachar, 1955). - Amiram Eldar, Jan 11 2025

Extensions

Edited by Dean Hickerson, Feb 12 2002

A322977 Number of even divisors d of n such that d-1 is prime.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 04 2019

Keywords

Comments

Equally: Number of divisors d of n such that d-1 is an odd prime.

Crossrefs

Programs

  • Mathematica
    Array[DivisorSum[#, 1 &, And[EvenQ@ #, PrimeQ[# - 1]] &] &, 105] (* Michael De Vlieger, Jan 04 2019 *)
  • PARI
    A322977(n) = sumdiv(n, d, (!(d%2))*isprime(d-1));

Formula

a(n) = Sum_{d|n, d>1} A059841(d)*A010051(d-1).
a(n) <= A183063(n).

A322975 Number of divisors d of n such that d-2 is prime.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 0, 1, 1, 2, 2, 0, 0, 1, 2, 1, 1, 2, 0, 2, 1, 1, 1, 0, 2, 2, 0, 1, 2, 2, 0, 2, 1, 1, 4, 0, 0, 1, 2, 2, 0, 2, 0, 1, 2, 2, 1, 0, 0, 3, 1, 1, 4, 1, 2, 1, 0, 1, 1, 2, 0, 2, 1, 0, 4, 2, 1, 2, 0, 2, 2, 0, 0, 3, 2, 1, 0, 1, 0, 4, 3, 1, 1, 0, 2, 1, 0, 2, 3, 3, 0, 0, 1, 2, 5
Offset: 1

Views

Author

Antti Karttunen, Jan 04 2019

Keywords

Examples

			10395 has 32 divisors: [1, 3, 5, 7, 9, 11, 15, 21, 27, 33, 35, 45, 55, 63, 77, 99, 105, 135, 165, 189, 231, 297, 315, 385, 495, 693, 945, 1155, 1485, 2079, 3465, 10395]. When 2 is subtracted from each, as 1-2 = -1, 3-2 = 1, 5-2 = 3, etc, the only differences that are primes are: [3, 5, 7, 13, 19, 31, 43, 53, 61, 97, 103, 163, 229, 313, 383, 691, 1153, 1483, 3463], thus (a10395) = 19.
		

Crossrefs

Programs

  • Mathematica
    Array[DivisorSum[#, 1 &, PrimeQ[# - 2] &] &, 105] (* Michael De Vlieger, Jan 04 2019 *)
  • PARI
    A322975(n) = sumdiv(n, d, isprime(d-2));

Formula

a(n) = Sum_{d|n, d>2} A010051(d-2).
a(A000040(n)) = A062301(n).

A360326 a(n) is the number of divisors of n that have only prime-indexed prime factors.

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Feb 03 2023

Keywords

Comments

First differs from A322976 at n = 21.
Equivalently, a(n) is the number of divisors of the largest divisor of n that has only prime-indexed prime factors.
The asymptotic mean of this sequence is Product_{p in A006450} p/(p-1) > 3. See A076610 for a numerical estimate of the value of this product.

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := If[PrimeQ[PrimePi[p]], e+1, 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n), p = f[,1], e = f[,2]); prod(i = 1, #p, if(isprime(primepi(p[i])), e[i]+1, 1));}

Formula

a(n) = 1 if and only if n is in A320628.
a(n) = A000005(n) if and only if n is in A076610.
a(n) = A000005(A360325(n)).
Multiplicative with a(p^e) = e+1 if p is a prime-indexed prime (A006450), and 1 otherwise.
Showing 1-4 of 4 results.