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.

User: Jonathan Sondow

Jonathan Sondow's wiki page.

Jonathan Sondow has authored 468 sequences. Here are the ten most recent ones:

A327033 N(p-1)/p + D(p-1)/p^2 with p the n-th prime and B(k) = N(k)/D(k) the k-th Bernoulli number.

Original entry on oeis.org

0, 1, 1, 1, 1, -37, -211, 2311, 37153, -818946931, 277930363757, -711223555487930419, -6367871182840222481, 35351107998094669831, 12690449182849194963361, -15116334304443206742413679091, 1431925649981017658678758915153153, -19921854762028779869513196624259348280501
Offset: 1

Author

Jonathan Sondow, Aug 15 2019

Keywords

Comments

a(n) is an integer, as conjectured by Thomas Ordowski and proved by the author in A309132 and A326690.
Ordowski also conjectured that the sequence is a subsequence of A174341.

Examples

			Prime(6) = 13 and B(12) = -691/2730, so a(6) = -691/13 + 2730/13^2 = -37.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := With[{p = Prime[n]}, With[{b = BernoulliB[p - 1]}, (p  Numerator[b] + Denominator[b])/p^2]];
    Table[a[n], {n, 1, 18}]
  • PARI
    a(n) = my(p = prime(n), b = bernfrac(p-1)); numerator(b)/p + denominator(b)/p^2; \\ Michel Marcus, Aug 16 2019

A326716 3-term arithmetic progressions of primes whose indices are also primes in arithmetic progression.

Original entry on oeis.org

5, 11, 17, 461, 617, 773, 401, 599, 797, 877, 1087, 1297, 1471, 1597, 1723, 1217, 1847, 2477, 3001, 3259, 3517, 3001, 3637, 4273, 2417, 3407, 4397, 2081, 3299, 4517, 4339, 4549, 4759, 3733, 4801, 5869, 7193, 8117, 9041, 11927, 12203, 12479, 13103, 13217, 13331
Offset: 1

Author

Jonathan Sondow, Aug 11 2019

Keywords

Comments

3-term arithmetic progressions are ordered first by highest term, then by middle term, and last by lowest term.
Is there a proof that the sequence is infinite?

Examples

			The indices of 5,11,17 form the arithmetic progression of primes 3,5,7.
The indices of 461,617,773 form the arithmetic progression of primes 89,113,137.
		

Crossrefs

Programs

  • Maple
    l:= NULL: nn:= 2000:  # nn = upper limit for index of largest prime found
    for n from 3 to nn do
      if isprime(n) then
        for i from iquo(n-1, 2) to 1 by -1 do
          if isprime(n-i) and isprime(n-2*i) then
            p, q, r:= map(ithprime, [seq(n-i*j, j=0..2)])[];
            if p-q = q-r then l:= l, r, q, p
    fi fi od fi od: l;  # Alois P. Heinz, Aug 12 2019

Formula

a(3*k+2) - a(3*k+1) = a(3*k+3) - a(3*k+2) for k >= 0.
pi(a(3*k+2)) - pi(a(3*k+1)) = pi(a(3*k+3)) - pi(a(3*k+2)) for k >= 0.
a(n) = prime(pi(a(n))) = A000040(A000720(a(n))).
pi(a(n)) = prime(pi(pi(a(n)))).

Extensions

More terms from Alois P. Heinz, Aug 12 2019

A326715 Values of n for which the denominator of (Sum_{prime p | n} 1/p - 1/n) is 1.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 30, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241
Offset: 1

Author

Jonathan Sondow, Jul 20 2019

Keywords

Comments

n is in the sequence iff either n = 1 or n is a prime or n is a Giuga number, by one definition of Giuga numbers A007850.

Examples

			a(30) = denominator(Sum_{prime p | 30} 1/p - 1/30) = denominator(1/2 + 1/3 + 1/5 - 1/30) = denominator(1/1) = 1, and 30 is a Giuga number.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local p;
       denom(add(1/p, p = numtheory:-factorset(n))-1/n)=1
    end proc:
    select(filter, [$1..300]); # Robert Israel, Dec 15 2020
  • Mathematica
    PrimeFactors[n_] := Select[Divisors[n], PrimeQ];
    f[n_] := Denominator[Sum[1/p, {p, PrimeFactors[n]}] - 1/n];
    Select[Range[148], f[#] == 1 &]

Formula

n such that A326690(n) = 1.

A326691 a(n) = n/denominator(Sum_{prime p | n} 1/p - 1/n).

Original entry on oeis.org

1, 2, 3, 1, 5, 2, 7, 1, 1, 2, 11, 3, 13, 2, 1, 1, 17, 2, 19, 1, 3, 2, 23, 1, 1, 2, 1, 1, 29, 30, 31, 1, 1, 2, 1, 1, 37, 2, 3, 1, 41, 2, 43, 1, 1, 2, 47, 3, 1, 2, 1, 1, 53, 2, 5, 7, 3, 2, 59, 1, 61, 2, 1, 1, 1, 6, 67, 1, 1, 2, 71, 1, 73, 2, 3, 1, 1, 2, 79
Offset: 1

Author

Jonathan Sondow, Jul 20 2019

Keywords

Comments

Denominator(Sum_{prime p | n} 1/p - 1/n) is a factor of n, since all primes in the sum divide n. So a(n) is an integer.

Examples

			a(18) = 18/denominator(Sum_{prime p | 18} 1/p - 1/18) = 18/denominator(1/2 + 1/3 - 1/18) = 18/denominator(7/9) = 18/9 = 2.
a(30) = 30/denominator(Sum_{prime p | 30} 1/p - 1/30) = 30/denominator(1/2 + 1/3 + 1/5 - 1/30) = 30/denominator(1/1) = 30/1 = 30, and 30 is a Giuga number.
		

Programs

  • Mathematica
    PrimeFactors[n_] := Select[Divisors[n], PrimeQ];
    f[n_] := Denominator[Sum[1/p, {p, PrimeFactors[n]}] - 1/n];
    Table[n/f[n], {n, 79}]
  • PARI
    A326691(n) = (n/A326690(n)); \\ Antti Karttunen, Mar 15 2021

Formula

a(n) = n/A326690(n).
a(n) = n > 1 iff n is either a prime or a Giuga number A007850.
a(n) = gcd(n, 1+((n-1)*A003415(n))). [Conjectured, after an empirical formula found by LODA miner. This holds at least up to n=2^27] - Antti Karttunen, Mar 15 2021

A326692 Values of k for which the denominator of (Sum_{prime p | k} 1/p - 1/k) is k.

Original entry on oeis.org

1, 4, 8, 9, 15, 16, 20, 24, 25, 27, 28, 32, 33, 35, 36, 40, 44, 45, 49, 51, 52, 60, 63, 64, 65, 68, 69, 72, 76, 77, 81, 85, 87, 88, 91, 92, 95, 96, 99, 100, 104, 108, 112, 115, 116, 117, 119, 121, 123, 124, 125, 128, 133, 135, 136, 140, 141, 143, 144, 145, 148
Offset: 1

Author

Jonathan Sondow, Jul 20 2019

Keywords

Comments

Any prime power p^k with k > 1 is a term, as 1/p - 1/p^k = (p^(k-1) - 1)/p^k which is in reduced form and has denominator p^k.
Are there infinitely many Carmichael numbers A002997 in the sequence?

Examples

			1/3 + 1/5 - 1/15 = 7/15 has denominator 15, so 15 is a term.
		

Crossrefs

Programs

  • Mathematica
    PrimeFactors[n_] := Select[Divisors[n], PrimeQ];
    f[n_] := Denominator[Sum[1/p, {p, PrimeFactors[n]}] - 1/n];
    Select[Range[148], f[#] == # &]
  • PARI
    is(k) = {my(p = factor(k)[,1]); denominator(sum(i = 1, #p, 1/p[i]) - 1/k) == k;} \\ Amiram Eldar, Apr 26 2024

Formula

Solutions of A326690(x) = x. That is, fixed points of A326690.

A326689 Numerator of the fraction (Sum_{prime p | n} 1/p - 1/n).

Original entry on oeis.org

-1, 0, 0, 1, 0, 2, 0, 3, 2, 3, 0, 3, 0, 4, 7, 7, 0, 7, 0, 13, 3, 6, 0, 19, 4, 7, 8, 17, 0, 1, 0, 15, 13, 9, 11, 29, 0, 10, 5, 27, 0, 20, 0, 25, 23, 12, 0, 13, 6, 17, 19, 29, 0, 22, 3, 5, 7, 15, 0, 61, 0, 16, 29, 31, 17, 10, 0, 37, 25, 29, 0, 59, 0, 19, 13, 41
Offset: 1

Author

Jonathan Sondow, Jul 18 2019

Keywords

Comments

See Comments on denominators in A326690.

Examples

			-1/1, 0/1, 0/1, 1/4, 0/1, 2/3, 0/1, 3/8, 2/9, 3/5, 0/1, 3/4, 0/1, 4/7, 7/15, 7/16, 0/1, 7/9, 0/1, 13/20, 3/7, 6/11, 0/1, 19/24, 4/25, 7/13, 8/27, 17/28, 0/1, 1/1
		

Crossrefs

Denominators are A326690. Cf. also A007850, A309132, A309235, A309378.
Cf. A028235.

Programs

  • Mathematica
    PrimeFactors[n_] := Select[Divisors[n], PrimeQ];
    g[n_] := Numerator[Sum[1/p, {p, PrimeFactors[n]}] - 1/n];
    Table[ g[n], {n, 100}]
  • PARI
    a(n) = numerator(sumdiv(n, d, isprime(d)/d) - 1/n); \\ Michel Marcus, Jul 19 2019

Formula

a(p) = 0 if p is a prime.
a(g) = 1 if g is a known Giuga number (see my 2nd comment in A007850).

A326690 Denominator of the fraction (Sum_{prime p | n} 1/p - 1/n).

Original entry on oeis.org

1, 1, 1, 4, 1, 3, 1, 8, 9, 5, 1, 4, 1, 7, 15, 16, 1, 9, 1, 20, 7, 11, 1, 24, 25, 13, 27, 28, 1, 1, 1, 32, 33, 17, 35, 36, 1, 19, 13, 40, 1, 21, 1, 44, 45, 23, 1, 16, 49, 25, 51, 52, 1, 27, 11, 8, 19, 29, 1, 60, 1, 31, 63, 64, 65, 11, 1, 68, 69, 35, 1, 72
Offset: 1

Author

Jonathan Sondow, Jul 18 2019

Keywords

Comments

Theorem. If n is a prime or a Carmichael number, then a(n) = A309132(n) = denominator of (N(n-1)/n + D(n-1)/n^2), where B(k) = N(k)/D(k) is the k-th Bernoulli number. This is a generalization of Theorem 1 in A309132 that A309132(p) = 1 if p is a prime. The proof generalizes that in A309132. As an application of Theorem, for n a prime or a Carmichael number one can compute A309132(n) without calculating Bernoulli numbers; see A309268.
A composite number n is a Giuga number A007850 if and only if a(n) = 1. (In fact, Sum_{prime p | n} 1/p - 1/n = 1 for all known Giuga numbers n.)
Semiprimes m = pq such that 1/p + 1/q - 1/m = p/q are exactly A190275. - Amiram Eldar and Thomas Ordowski, Jul 22 2019
The preceding comment may be rephrased as "Semiprimes m = pq such that A326689(m) = p and a(m) = q are exactly A190275." - Jonathan Sondow, Jul 22 2019
More generally, semiprimes m = pq such that 1/p + 1/q - 1/m = P/Q are exactly A190273, where P <> Q are primes. In other words, semiprimes m such that A326689(m) is prime and a(m) is prime are exactly A190273. - Amiram Eldar and Thomas Ordowski, Jul 25 2019

Examples

			-1/1, 0/1, 0/1, 1/4, 0/1, 2/3, 0/1, 3/8, 2/9, 3/5, 0/1, 3/4, 0/1, 4/7, 7/15, 7/16, 0/1, 7/9, 0/1, 13/20, 3/7, 6/11, 0/1, 19/24, 4/25, 7/13, 8/27, 17/28, 0/1, 1/1
a(12) = denominator of (Sum_{prime p | 12} 1/p - 1/12) = denominator of (1/2 + 1/3 - 1/12) = denominator of 3/4 = 4.
Computing A309132(561) involves numerator(B(560)) which has 865 digits. But 561 is a Carmichael number, so Theorem implies A309132(561) = a(561) = denominator(1/3 + 1/11 + 1/17 - 1/561) = denominator(90/187) = 187.
		

Crossrefs

Numerators are A326689. Quotients n/a(n) are A326691.
Cf. A069359, A007947 (denominator of Sum_{prime p | n} 1/p).

Programs

  • Magma
    [1] cat [Denominator(&+[1/p:p in PrimeDivisors(k)]-1/k):k in [2..72]]; // Marius A. Burtea, Jul 27 2019
  • Maple
    A326690 := n -> denom((A069359(n)-1)/n):
    seq(A326690(n), n=1..72); # Peter Luschny, Jul 22 2019
  • Mathematica
    PrimeFactors[n_] := Select[Divisors[n], PrimeQ];
    f[n_] := Denominator[Sum[1/p, {p, PrimeFactors[n]}] - 1/n];
    Table[ f[n], {n, 100}]
  • PARI
    a(n) = denominator(sumdiv(n, d, isprime(d)/d) - 1/n); \\ Michel Marcus, Jul 19 2019
    
  • SageMath
    p = lambda n: [n//f[0] for f in factor(n)]
    A326690 = lambda n: ((sum(p(n)) - 1)/n).denominator()
    [A326690(n) for n in (1..72)] # Peter Luschny, Jul 22 2019
    

Formula

a(n) = 1 if n is a prime or a Giuga number A007850.
a(n) = denominator of (N(n-1)/n + D(n-1)/n^2) if n is a Carmichael number A002997.
a(n) = denominator((A069359(n) - 1)/n). - Peter Luschny, Jul 22 2019

A324977 Denominator(Bernoulli_{m-1}) / m, where m is the n-th Carmichael number.

Original entry on oeis.org

26805565070, 76004922, 702286000198710990, 302278602666, 5360679390, 423023231634556544606744470770, 582934735516230690164248578, 106515855804560422705933720818, 8763422623117673428800595536306232967379299351012370, 9231375124608836430, 94422948020637332890056101961518875879389605546105043450762033482730
Offset: 1

Author

Jonathan Sondow, Mar 28 2019

Keywords

Comments

a(n) is an integer, because an odd composite number m is a Carmichael number iff m divides the denominator of Bernoulli_{m-1} (by Korselt's criterion and the von Staudt-Clausen theorem). See Pomerance, Selfridge, & Wagstaff, page 1006, and Kellner & Sondow, section on Bernoulli numbers.

Examples

			The 1st Carmichael number is 561, and the denominator of Bernoulli_560 is 15037922004270, so a(1) = 15037922004270 / 561 = 26805565070.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A324977 := proc(n) local C, Fc;
    if n = 1 or irem(n,2) = 0 or isprime(n) then return NULL fi;
    Fc := select(isprime, map(i->i+1, divisors(n-1)));
    C := mul(i, i=Fc); if irem(C, n) <> 0 then NULL else C/n fi end:
    seq(A324977(n), n=1..40000); # Peter Luschny, May 21 2019
  • Mathematica
    carnum = Cases[Range[1, 100000, 2], n_ /; Mod[n, CarmichaelLambda[n]] == 1 && ! PrimeQ[n]];
    Table[Denominator[BernoulliB[m - 1]]/m, {m, carnum}]

Formula

a(n) = A027642(A002997(n)-1)/A002997(n).

A324976 Rank of the n-th primary Carmichael number.

Original entry on oeis.org

12, 8, 18, 12, 52, 52, 20, 32, 16, 54, 8, 36, 124, 34, 12, 72, 96, 26, 28, 76, 98, 1804, 108, 124, 18, 72, 172, 120, 10, 104, 32, 244, 130, 376, 18, 92, 780, 36, 172, 92, 284, 24, 198, 12, 244, 64, 234, 340, 100, 284, 24, 124, 44, 518, 364, 16, 82, 148, 8, 206
Offset: 1

Author

Keywords

Comments

See A324974 for definition and explanation of rank of a special polygonal number, hence of rank of a primary Carmichael number A324316 by Kellner and Sondow 2019.

Examples

			If m = A324316(1) = 1729 = 7*13*19, then p = 19, so a(1) = 2+2*((1729/19)-1)/(19-1) = 12.
		

Crossrefs

Subsequence of A324975 (rank of the n-th Carmichael number A002997) and of A324974 (rank of the n-th special polygonal number A324973).
Cf. also A324316, A324972.

Programs

  • Mathematica
    SD[n_, p_] := If[n < 1 || p < 2, 0, Plus @@ IntegerDigits[n, p]];
    LP[n_] := Transpose[FactorInteger[n]][[1]];
    TestCP[n_] := (n > 1) && SquareFreeQ[n] && VectorQ[LP[n], SD[n, #] == # &];
    T = Select[Range[1, 10^7, 2], TestCP[#] &];
    GPF[n_] := Last[Select[Divisors[n], PrimeQ]];
    Table[2 + 2*(T[[i]]/GPF[T[[i]]] - 1)/(GPF[T[[i]]] - 1), {i, Length[T]}]

Formula

a(n) = 2+2*((m/p)-1)/(p-1), where m = A324316(n) and p is its greatest prime factor. Hence a(n) is even; see Formula in A324975.

Extensions

More terms from Amiram Eldar, Mar 27 2019

A324973 Special polygonal numbers.

Original entry on oeis.org

6, 15, 66, 70, 91, 190, 231, 435, 561, 703, 715, 782, 861, 946, 1045, 1105, 1426, 1653, 1729, 1770, 1785, 1794, 1891, 2035, 2278, 2465, 2701, 2821, 2926, 3059, 3290, 3367, 3486, 3655, 4371, 4641, 4830, 5005, 5083, 5151, 5365, 5551, 5565, 5995, 6441, 6545, 6601
Offset: 1

Author

Keywords

Comments

Squarefree polygonal numbers P(r,p) = (p^2*(r-2)-p*(r-4))/2 whose greatest prime factor is p >= 3, and whose rank (or order) is r >= 3 (see A324974).
The Carmichael numbers A002997 and primary Carmichael numbers A324316 are subsequences. See Kellner and Sondow 2019.

Examples

			P(3,5) = 15 is squarefree, and its greatest prime factor is 5, so 15 is a member.
More generally, if p is an odd prime and P(3,p) is squarefree, then P(3,p) is a member, since P(3,p) = (p^2+p)/2 = p*(p+1)/2, so p is its greatest prime factor.
CAUTION: P(6,7) = 91 = 7*13 is a member even though 7 is NOT its greatest prime factor, as P(6,7) = P(3,13) and 13 is its greatest prime factor.
		

Crossrefs

Subsequence of A324972 = intersection of A005117 and A090466.
A002997, A324316, A324319 and A324320 are subsequences.

Programs

  • Mathematica
    GPF[n_] := Last[Select[Divisors[n], PrimeQ]];
    T = Select[Flatten[Table[{p, (p^2*(r - 2) - p*(r - 4))/2}, {p, 3, 150}, {r, 3, 100}], 1], SquareFreeQ[Last[#]] && First[#] == GPF[Last[#]] &];
    Take[Union[Table[Last[t], {t, T}]], 47]
  • PARI
    is(k) = if(issquarefree(k) && k>1, my(p=vecmax(factor(k)[, 1]), r); p>2 && (r=2*(k/p-1)/(p-1)) && denominator(r)==1, 0); \\ Jinyuan Wang, Feb 18 2021

Extensions

Several missing terms inserted by Jinyuan Wang, Feb 18 2021